Commit Graph

104 Commits

Author SHA1 Message Date
gingerBill
1744f57d01 Use permanent_alloc_item directly rather than through the gb_alloc_item generic interface 2026-03-16 16:03:27 +00:00
Laytan
e7ecb16a1e llvm 21 support 2025-10-14 19:55:00 +02:00
gingerBill
5d3092bf2d Again, better const union stuff 2025-09-24 14:27:44 +01:00
Laytan
d0890c2135 fix dropping part of particular vecs 2025-08-01 19:18:43 +02:00
Laytan
5527982c20 fix vec offset calculation 2025-07-31 22:01:17 +02:00
Laytan
f32ee28e6d amd64 support half in the abi too 2025-07-31 20:50:46 +02:00
Laytan
c3bae964d0 amd64 abi fixes regarding vectors
- Fixes the code so SSEUp is grouped/skipped over properly (Fixes #5429)
- Fixes f16 vectors using garbage widths, because it would call
LLVMGetIntTypeWidth and an f16 is not an int so doesn't have that
function
2025-07-31 20:26:22 +02:00
Laytan Laats
3a86bc9c6d Fix WASM C ABI for raw unions 2025-06-20 22:04:53 +02:00
Laytan Laats
2d00f8d69d fix compat with earlier llvm versions 2025-05-15 19:20:04 +02:00
Laytan Laats
f9b9e9e7dc some ABI fixups and improvements
Started with trying to enable asan in the CI for MacOS, noticed it wasn't enabled on the `tests/internal`
folder, it came up with a couple of issues with the abi/OdinLLVMBuildTransmute that this also solves.

- Looking at clang output for arm64, we should be promoting `{ i64, i32 }` to `{ i64, i64 }`
- after doing the previous point, I noticed this is not handled well in OdinLLVMBuildTransmute
  which was emitting loads and stores into the space of a value that was alignment, asan does not want this,
  looking at clang output again, a memcpy is the appropriate way of handling this.
- Having done this we don't need the hacky "return is packed" set anymore in the amd64 sysv ABI anymore either
2025-05-09 23:03:17 +02:00
gingerBill
2d4cb79baa Fix SysV ABI bug 2025-04-15 11:26:41 +01:00
gingerBill
d209af5094 Update to LLVM 20.1.0 2025-03-18 15:39:18 +00:00
gingerBill
c305c9dd04 [ABI FIX] Fix 128-bit ABI issues 2024-10-04 11:16:33 +01:00
gingerBill
4b6410e225 ABI BREAKING for SysV: Change how multiple return values are handled to be separate like all other ABIs 2024-09-30 12:32:55 +01:00
gingerBill
b173fa1b9a Fix LLVM 18 ABI for 128-bit integers (because LLVM broke things) 2024-09-30 11:45:24 +01:00
gingerBill
b116e8ff55 Fix 128-bit integer support for wasm targets 2024-09-20 01:29:39 +01:00
Laytan Laats
5b22bfa2b7 unify LB_ABI_INFO and LB_ABI_INFO_CTX 2024-08-20 14:07:47 +02:00
Laytan
ca6ef95b03 add support for linux_riscv64 and freestanding_riscv64 2024-08-20 14:06:40 +02:00
gingerBill
8650180ccc Change Odin calling convention to not do a copy on byval for SysV 2024-07-14 12:59:55 +01:00
gingerBill
3dff83f3dc Mock out #no_capture for future use 2024-07-14 12:39:30 +01:00
Laytan Laats
ef6a73c7ef fix not setting cc before using it in abi computations 2024-07-01 01:30:44 +02:00
Laytan Laats
e3dde8caf8 make structs with multiple fields always return indirect in wasm c abi 2024-07-01 00:50:10 +02:00
Laytan Laats
9ad9236c3b fix large ints amd64 sysv abi
Fixes #3707
2024-06-09 02:47:05 +02:00
Laytan Laats
e8c5bb4629 compiler: support returning 0 sized types in arm64 abi 2024-04-24 19:50:39 +02:00
Laytan Laats
133b45d843 fix amd64 sysv abi to pass asan everywhere
I verified the PR by running the entire test suite of Odin itself with
`-sanitize:address` and also the ols test suite (which caused unique problems
before).

A test has also been added with some problematic code, Windows seems to
have problems with asan in CI or in general so it is not ran there.

The LB_ABI_COMPUTE_RETURN_TYPES block has been removed entirely because
it was unused, I got pretty confused why it didn't effect anything at
first.

Fixes #3211
2024-04-04 23:45:23 +02:00
gingerBill
fbff2b4fd6 Merge pull request #3372 from laytan/fix-lbarg-ignore-logic
fix lbArg_Ignore logic
2024-04-04 18:09:12 +01:00
Laytan Laats
31407d9b1b fix 128 bit int alignment on arm64
Fixes #2403
2024-04-04 18:39:41 +02:00
Laytan Laats
a7056f2b4f fix lbArg_Ignore logic
Fixes #2698
2024-04-04 16:58:22 +02:00
gingerBill
308e9112f2 Disable packing on ARM64 and AMD64 2024-03-28 10:58:40 +00:00
gingerBill
6588fe35b3 Fix wasm abi 2024-03-26 16:47:29 +00:00
Laytan Laats
07a9969a41 darwin: arm64 abi fixes
Since commit b4fe9677a1 some core tests
segfault during build, upon investigation it is because some arg types
were of size 0 and you can't have a 0 sized int.

It also applies the earlier fix for parameters to the return types, this
fixes #3223

Thought I would put this PR up, but I am in no way an expert in abi so
feel free to close for a better fix if there is one.

I am able to run the entire core test suite with `-sanitize:address`
with these changes.
2024-03-23 23:17:01 +01:00
gingerBill
c17adc98f5 Try doing <{i64, i32}> instead of [i64, i64] for ARM64 12-byte parameters 2024-03-20 17:39:00 +00:00
gingerBill
e804fbd891 Force packed structs in ABI parameters 2024-03-20 17:27:05 +00:00
gingerBill
b4fe9677a1 Change ARM64 ABI for integer-like parameters 2024-03-20 16:06:50 +00:00
gingerBill
1514d64964 Update ARM64 ABI return type 2024-03-20 11:12:43 +00:00
gingerBill
082324d7b9 Begin work on making the type info table be constantly initialized 2023-09-22 14:39:51 +01:00
gingerBill
295cfc905c Fix typo in wasm64p32 abi 2023-06-07 00:53:31 +01:00
gingerBill
204924927a Ignore non-variable parameters 2023-06-07 00:35:11 +01:00
gingerBill
f622a8393c Change ABI for wasm64p32 on slices and structs 2023-06-07 00:30:14 +01:00
gingerBill
4a75a1e839 Merge branch 'master' into separate-int-word-sizes 2023-06-06 22:42:04 +01:00
gingerBill
6cbce9fdff Merge pull request #2563 from charles-l/master
WASM: Use BasicC ABI convention for arguments that have `proc "c"`
2023-05-29 23:33:58 +01:00
charles
052051244f WASM: Use BasicC ABI convention for arguments that have a proc "c" annotation 2023-05-29 18:20:25 -04:00
gingerBill
f3a463000d Fix #2561 - ARM64 ABI bug for homogenous structs with more than 4 elements 2023-05-29 22:50:28 +01:00
gingerBill
685f7d0fea Rename word_size to ptr_size internally to make it clearer 2023-04-20 12:18:13 +01:00
gingerBill
f5d9ca64f9 Begin work on new pseudo-architecture: wasm64p32 2023-04-20 12:02:32 +01:00
gingerBill
fe533fb809 Improve llreg integer type generation for SysV ABI 2023-03-19 01:29:53 +00:00
gingerBill
1f5bb99548 Improve SysV ABI for multiple return values that fit into a single register; Fixes #2384 2023-03-19 00:51:57 +00:00
gingerBill
b9a2426e57 Merge branch 'master' into compiler-improvements-2022-12 2022-12-21 23:59:31 +00:00
gingerBill
81037b3091 Change the order of the args and ret for Arm64 ABI 2022-12-21 23:56:34 +00:00
gingerBill
6cdec65ca1 gb_internal LLVM backend 2022-12-18 22:32:05 +00:00