Manu Linares
4b13ad692a
fixes for RISC-V ABI Implementation #1567 ( #2937 )
...
* fixes for RISC-V ABI Implementation #1567
Fixed RISC-V floating-point ABI by correcting the target triple to
`riscv64-unknown-linux-gnu`, adding the `target-abi` module flag, and
ensuring ABI-required CPU features are enabled.
I tested this with:
```bash
build/c3c compile-only --target linux-riscv64 rv_hello.c3
readelf -h obj/linux-riscv64/rv_hello.o | grep Flags
# Output: Flags: 0x5, RVC, double-float ABI
```
```bash
# and qemu because I don't have a riscv machine :/
qemu-riscv64-static -L /usr/riscv64-linux-gnu ./rv_hello
```
---
@lerno I purposedly left these two failing tests to clearly see the
difference.
`test/test_suite/abi/riscv64-lp64-lp64f-abi-1.c3t`
`test/test_suite/abi/riscv64-lp64-abi.c3t`
* improve Linux cross-compilation, specifically for RISC-V
- Implement automatic sysroot and CRT object discovery for RISC-V.
- Fix dynamic linker paths and emulation flags for LLD.
- Link against libgcc to resolve required arithmetic symbols.
* Update tests.
* fix linker CRT detection by centralizing host arch check
use target_host_arch() in linker.c
move target_host_arch() from hostinfo.c to target.c
* missing debug info
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2026-02-20 01:53:29 +01:00
Christoffer Lerno
5f32c97094
- Compiler crash when using arrays of vectors in lists. #2889
2026-02-04 12:40:16 +01:00
Christoffer Lerno
378b35265b
- Raw vaargs with optional return not lowered correctly #2819
2026-01-24 23:54:20 +01:00
Christoffer Lerno
472124dab3
Bug in sysv abi when passing union in with floats #2784
2026-01-21 00:34:37 +01:00
Christoffer Lerno
3fe55b5e51
- Vectors not converted to arrays when passed as raw vaargs. #2776
2026-01-20 17:00:09 +01:00
Christoffer Lerno
fa1951642b
Add debug info
2026-01-05 00:11:48 +01:00
Christoffer Lerno
42dc2d541a
Add testcase.
2026-01-04 22:05:01 +01:00
Christoffer Lerno
034a048c8a
- Regression with npot vector in struct triggering an assert #2219 .
2025-12-05 17:26:22 +01:00
Christoffer Lerno
2a41fa6281
Passing a single value to @wasm would ignore the renaming
2025-11-18 18:25:07 +01:00
Christoffer Lerno
4e66693065
- Refactored @simd implementation.
...
- Regression vector ABI: npot vectors would load incorrectly from pointers and other things. #2576
2025-11-16 01:37:39 +01:00
Christoffer Lerno
8aaf54e8b1
- Rename @extern to @cname, deprecating the old name #2493 .
2025-10-25 15:55:25 +02:00
Christoffer Lerno
423152202f
Dev ( #2545 )
...
* Optimize vector load / store. Fixes to alignment. Support typedef with `@simd` and `@align` #2543 . Update vector ABI #2542
* Fix alignment issue with indirect arguments.
2025-10-25 12:31:06 +02:00
Christoffer Lerno
9c58db99af
With avx512, passing a 512 bit vector in a union would be lowered incorrectly, causing an assert. #2362
2025-08-02 16:56:43 +02:00
Christoffer Lerno
13bb2b6690
Const Enums From / to ordinal using casts is back. Add "--use-old-enums", deprecating lookup.
2025-06-30 21:41:52 +02:00
Christoffer Lerno
1b4b9bca94
Linking fails on operator method imported as @public #2224 .
2025-06-18 23:34:39 +02:00
Christoffer Lerno
abe4727c3a
Deprecate uXX and iXX bit suffixes.
...
Add experimental LL / ULL suffixes for int128 and uint128 literals.
2025-05-13 23:48:59 +02:00
Christoffer Lerno
a44e932806
ABI bug on x64 Linux / MacOS when passing a union containing a struct of 3 floats. #2087
2025-04-16 15:58:14 +02:00
Christoffer Lerno
8b49e6c14d
Rename def to alias.
2025-03-13 11:22:27 +01:00
Christoffer Lerno
25bccf4883
New faults and syntax ( #2034 )
...
- Remove `[?]` syntax.
- Change `int!` to `int?` syntax.
- New `fault` declarations.
- Enum associated values can reference the calling enum.
2025-03-10 00:11:35 +01:00
Christoffer Lerno
cbacd64987
Update tests to (Foo) { ... } syntax.
2025-02-18 18:53:30 +01:00
Christoffer Lerno
627f10cd18
Fix bug when a macro calling an extern function was called in another module also declaring and calling the same function. #1690
2024-12-19 20:39:23 +01:00
Christoffer Lerno
5fc6672784
Crash compiling for arm64 when returning 16 byte and smaller structs by value not a power of 2 #1649 .
2024-11-30 11:47:49 +01:00
Christoffer Lerno
e675b0c00a
Fix last test for LLVM20
2024-11-07 13:49:03 +01:00
Christoffer Lerno
95ac29559c
Fix some tests for LLVM20
2024-11-07 12:43:26 +01:00
David
204fb211ac
Fix x86_64 ABI small issue ( #1174 )
...
* Fix x86_64 ABI small issue Update tests for fix.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2024-03-25 09:39:26 +01:00
Christoffer Lerno
deb4cc7c4b
0.5.3: Single-module not respected. Fix issue with compiler defined types. Fix optimization levels for projects. Use GEP i8 on offsets. Optimize foreach on len 1 arrays. Move panic blocks last. Fix generic module wildcard imports. Deprecate init_temp / init_new. Fix issue with macro vaarg and untyped lists. Fix extern const globals.
2024-01-14 15:34:54 +01:00
Christoffer Lerno
5e8816e6df
Fixes to native backtrace.
2023-11-13 17:20:46 +01:00
Christoffer Lerno
e81e91be93
Fix void* <=> protocol casts. Fix of tests.
2023-10-13 12:44:58 +02:00
Christoffer Lerno
942d53a678
Fix tests. Refactoring MacOS SDK.
2023-10-12 14:10:46 +02:00
Christoffer Lerno
a9c28cce6d
Default protocols. Closes #1039
2023-10-10 23:30:33 +02:00
Christoffer Lerno
c4228e08c5
MacOS uses regular stacktrace for errors.
2023-09-21 16:39:13 +02:00
Christoffer Lerno
50e99b571f
Add frame pointer on "enable stacktrace". Set no-trapping-math. Update fmuladd.
2023-09-06 14:38:21 +02:00
Christoffer Lerno
a23112fae6
Added parentof.
2023-08-29 11:51:09 +02:00
Christoffer Lerno
de9bb1d0cc
Fix test.
2023-07-23 21:51:38 +02:00
Christoffer Lerno
45d1b1d671
Fix where bitstructs in subarrays triggered the wrong lowering. Fixes #877
2023-07-23 20:50:53 +02:00
Christoffer Lerno
4325d017c8
Compacted section list. Somewhat more controlled ctarg search.
2023-07-15 16:31:53 +02:00
Christoffer Lerno
848a5212ef
Fixes #811 . Update some stdlib methods. Header printout correctly picks a name. #804
2023-07-03 13:17:43 +02:00
Christoffer Lerno
3e54d13b62
Prefer def
2023-06-02 20:08:45 +02:00
Christoffer Lerno
275e3c6a09
Update with CPU type.
2023-05-30 16:42:15 +02:00
Christoffer Lerno
b794c893d6
Dynamic dispatch.
2023-05-25 22:28:45 +02:00
Christoffer Lerno
2a79e0f1cf
Introduce def as a trial. Fixup of timeit.
2023-04-21 17:42:38 +02:00
Christoffer Lerno
809321e20c
Updated grammar. Removal of elif. Removal of ':' ';' in some ct statements. Empty faults is now an error. Remove "define" for types. Remove "private". Better errors on incorrect bitstruct syntax. Introduction of wildcard type rather than optional wildcard. Removal of scaled vector type. mkdir and rmdir. Disallow define @Foo() = { @inline }. Add handling for @optreturn and change it to @return!. Restrict interface style functions. Updated x64 ABI. stdlib updates to string. Removed deprecated functions. Update how variadics are implemented. Extended error messages. x86 ABI fixes. Shift check fixes. '!' and '?' are flipped. No trailing ',' allowed in functions. Fix to string parsing. Allow l suffix. Simplifying flatpath. any replaces variant, anyfault replaces anyerr. Allow getting the underlying type of anyfault. De-duplicate string constants. Fix of readme. Extended list. Fix of "(MyEnum)x + 1". Clock and DateTime types. Fixes to array concat.
2023-04-21 10:56:39 +02:00
Christoffer Lerno
0dcad6f5cf
Improve and simplify casts.
2023-03-01 22:43:50 +01:00
Christoffer Lerno
afa41f0c10
Updated name mangling.
2023-02-20 17:48:47 +01:00
Christoffer Lerno
e3416a1c40
Allow @test with modules. Change name mangling for non exports.
2023-02-20 16:02:30 +01:00
Christoffer Lerno
df77b692d6
Support "typedef"
2023-02-14 16:49:27 +01:00
Christoffer Lerno
3b49b87784
Fix for nolibc (eg wasm). Add multi global declarations. Simplicity wasm export / import. Prevent "extern" functions to have a function body.
2023-02-11 11:16:31 +01:00
Christoffer Lerno
6cef75b608
Removes win x86 target. Add win aarch64. Fixes to jump buffer sizes. Fix returning bool[2] in the SysV ABI. Array comparison now works. Prevent flexible array comparisons. Prevent zero size unions.
2023-02-06 18:09:31 +01:00
Christoffer Lerno
4ea81fe636
More riscv tests. Fix missing zero/signext attributes on calls. Fixes and simplification to riscv ABI.
2023-01-31 14:09:32 +01:00
Christoffer Lerno
0afd55425a
More ABI cleanup and fixes to RISC-V ABI + tests for riscv32.
2023-01-30 23:46:06 +01:00