Commit graph

56 commits

Author SHA1 Message Date
Jacob Young
5060ab99c9 aarch64: add new from scratch self-hosted backend 2025-07-22 19:43:47 -07:00
Jacob Young
1f98c98fff x86_64: increase passing test coverage on windows
Now that codegen has no references to linker state this is much easier.

Closes #24153
2025-06-19 18:41:12 -04:00
Ali Cheraghi
872f68c9cb
rename spirv backend name
`stage2_spirv64` -> `stage2_spirv`
2025-06-16 13:22:19 +03:30
Alex Rønne Petersen
9d534790eb std.Target: Introduce Cpu convenience functions for feature tests.
Before:

* std.Target.arm.featureSetHas(target.cpu.features, .has_v7)
* std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov })
* std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory })

After:

* target.cpu.has(.arm, .has_v7)
* target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov })
* target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
2025-06-05 06:12:00 +02:00
Jacob Young
9edfccb9a7
Legalize: implement scalarization of overflow intrinsics 2025-06-01 08:24:01 +01:00
Ali Cheraghi
aec0f9b3e7
test: skip failing tests with spirv-vulkan 2025-02-24 19:39:42 +01:00
Jacob Young
fa9b0fa6d3 x86_64: rewrite most of the remaining float ops 2025-02-06 16:14:53 -05:00
Jacob Young
e5d5a8bc4e x86_64: implement switch jump tables 2025-01-16 20:42:08 -05:00
Alex Rønne Petersen
c9e67e71c1
std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().
The old isARM() function was a portability trap. With the name it had, it seemed
like the obviously correct function to use, but it didn't include Thumb. In the
vast majority of cases where someone wants to ask "is the target Arm?", Thumb
*should* be included.

There are exactly 3 cases in the codebase where we do actually need to exclude
Thumb, although one of those is in Aro and mirrors a check in Clang that is
itself likely a bug. These rare cases can just add an extra isThumb() check.
2024-11-03 09:29:30 +01:00
David Rubin
d9e0cafe64 riscv: add stage2_riscv to test matrix and bypass failing tests 2024-05-11 02:17:24 -07:00
Jakub Konka
52066bf8e4 x86_64+macho: pass more behavior tests 2024-02-06 19:01:17 +01:00
Robin Voetter
7dfd403da1
spirv: air mul_add 2024-02-04 19:09:30 +01:00
mlugg
9c16b2370d
test: update behavior to silence 'var is never mutated' errors 2023-11-19 09:57:03 +00:00
Jacob Young
b5dedd7c00 x86_64: implement @mulAdd of floats for baseline 2023-10-08 04:41:55 -04:00
Techatrix
ab970094ab wasm: enable successful behavior tests 2023-09-10 15:59:02 +02:00
Jacob Young
228c956377 std: finish cleanup up asm
This also required implementing the necessary syntax in the x86_64 backend.
2023-07-31 03:49:21 -04:00
Jacob Young
9831f27238 cbe: get behavior tests running on arm
Specifically without linking libc.
2023-07-31 01:58:10 -04:00
Eric Joldasov
d884d7050e
all: replace comptime try with try comptime
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00
Ali Chraghi
ccc490ef68
setup spirv backend in behavior tests 2023-05-11 20:31:52 +02:00
Jacob Young
6778da4516 x86_64: implement binary operations for f16 and f16 vectors 2023-05-08 07:36:20 -04:00
Jacob Young
cba195c117 x86_64: implement some float and float vector movement
This allows actually storing value of these supported types in
registers, and not restricting them to stack slots.
2023-05-08 07:36:20 -04:00
Jacob Young
3a5e3c52e0 x86_64: implement @mulAdd 2023-05-08 07:36:20 -04:00
Jacob Young
6b23a7b61a behavior: enable a bunch of disabled tests 2023-04-21 16:36:31 -04:00
Andrew Kelley
e9d854743a disable more failing C backend tests 2023-04-15 10:33:08 -07:00
Andrew Kelley
a281d29881 disable not-yet-passing C backend tests 2023-04-15 10:33:08 -07:00
Techatrix
8ec7723992 wasm: implement float operations with compiler-rt 2023-03-26 22:48:56 +02:00
Jacob Young
7352d461cf behavior: fix comptime issue and disable failing test 2023-03-05 03:34:57 -05:00
Jacob Young
c478c7609e CBE: implement vector operations
Also, bigint add and sub which is all I was actually trying to do.
2023-03-05 02:59:02 -05:00
kcbanner
a9b68308b9 cbe: fixes for tls, support for not linking libc, and enabling tests
- cbe: Implement linksection support, to support TLS when not linking libc
- cbe: Support under-aligned variables / struct fields
- cbe: Support packed structs (in the C definition of packed)
- windows: Fix regression with x86 _tls_array
- compiler_rt: Add 128-bit atomics to compiler_rt
- tests: Re-enable threadlocal tests on cbe+windows, and llvm+x86
- tests: Re-enable f80 tests that now pass
- ci: change windows ci to run the CBE behaviour tests with -lc, to match how the compiler is bootstrapped
- update zig1.wasm
2023-01-29 15:04:13 -05:00
Andrew Kelley
74718a1183 disable failing CBE behavior tests failing on aarch64-windows
Also start to move redundant tests next to each other to make them
slightly more obvious that they need to be cleaned up.

See tracking issue #13876
2022-12-10 16:28:49 -07:00
Koakuma
f9e9ba784f stage2: sparc64: Skip unimplemented tests 2022-12-10 21:51:46 +07:00
Andrew Kelley
c8aba15c22 remove references to stage1 in behavior tests
Good riddance.
2022-12-06 19:06:48 -07:00
Jacob Young
94425fe46e cbe: improve floating point type support 2022-10-25 05:22:55 -04:00
Jacob Young
6021edd7ce cbe: add support for all float literals types 2022-10-25 05:22:55 -04:00
Jacob Young
1bab854868 cbe: implement 128-bit and fix smaller integer builtins 2022-10-25 05:11:29 -04:00
Jacob Young
6a4266d62a cbe: fix infinite recursion on recursive types 2022-10-25 05:11:28 -04:00
Cody Tapscott
34863224c3 Re-enable mulAdd f128 tests on i386-linux 2022-10-13 12:53:30 -07:00
Cody Tapscott
1e278131e3 Re-enable @mulAdd f128 tests on aarch64-darwin
Closes #9900
2022-10-13 12:53:29 -07:00
Jakub Konka
abfe21a4fe skip failing f80 behavior tests on Windows 2022-08-23 22:43:19 +02:00
Luuk de Gram
3868864695 Revert "wasm: Enable f16 behavior tests"
This reverts commit 3c34c9f13c.
2022-06-24 08:12:17 +02:00
Luuk de Gram
ba37bc81e9 wasm: Enable f16 behavior tests 2022-06-24 08:12:17 +02:00
Andrew Kelley
758ec9bdd4 enable newly passing behavior tests
closes #11030
2022-04-27 17:24:36 -07:00
Luuk de Gram
a0a587ff85 wasm: Enable passing behavior tests
This shuffles some tests do ensure the new instructions are tested for the wasm backend,
by moving vectors into their own tests as well as move the f16 test cases as those require
special operating also.
2022-04-02 21:54:01 +02:00
Andrew Kelley
80642b5984 remove unnecessary TODO comment
`testing.expect` is better than `testing.expectEqual` for behavior
tests. Better for behavior tests to stick to only testing the limited
behavior they are meant to test and avoid functions such as
`expectEqual` that drag in too much of the standard library (in this
case to print helpful diffs about why a value is not equal to another).
2022-03-16 20:35:41 -07:00
John Schmidt
c8ed813097 Implement @mulAdd for vectors 2022-03-16 20:11:05 -07:00
Andrew Kelley
488eb8ac29 disable failing @mulAdd test 2022-03-06 16:18:51 -07:00
Andrew Kelley
71b8760d3b stage2: rework @mulAdd
* mul_add AIR instruction: use `pl_op` instead of `ty_pl`. The type is
   always the same as the operand; no need to waste bytes redundantly
   storing the type.
 * AstGen: use coerced_ty for all the operands except for one which we
   use to communicate the type.
 * Sema: use the correct source location for requireRuntimeBlock in
   handling of `@mulAdd`.
 * native backends: handle liveness even for the functions that are
   TODO.
 * C backend: implement `@mulAdd`. It lowers to libc calls.
 * LLVM backend: make `@mulAdd` handle all float types.
   - improved fptrunc and fpext to handle f80 with compiler-rt calls.
 * Value.mulAdd: handle all float types and use the `@mulAdd` builtin.
 * behavior tests: revert the changes to testing `@mulAdd`. These
   changes broke the test coverage, making it only tested at
   compile-time.

Improved f80 support:
 * std.math.fma handles f80
 * move fma functions from freestanding libc to compiler-rt
   - add __fmax and fmal
   - make __fmax and fmaq only exported when they don't alias fmal.
   - make their linkage weak just like the rest of compiler-rt symbols.
 * removed `longDoubleIsF128` and replaced it with `longDoubleIs` which
   takes a type as a parameter. The implementation is now more accurate
   and handles more targets. Similarly, in stage2 the function
   CTypes.sizeInBits is more accurate for long double for more targets.
2022-03-06 16:11:39 -07:00
John Schmidt
6637335981 stage2: implement @mulAdd for scalar floats 2022-03-06 15:36:56 -07:00
Andrew Kelley
ed2364a148 stage2: introduce anonymous struct literals 2022-03-01 23:46:57 -07:00
Veikka Tuominen
4411f9c019 add behavior tests for f80 2022-01-28 11:45:04 -07:00