Commit graph

53 commits

Author SHA1 Message Date
Alex Rønne Petersen
3b5376eff5
std: disable a few failing tests on hexagon 2025-10-16 22:11:51 +02:00
Alex Rønne Petersen
47c932f896 std.simd: suggest more sensible vector sizes across the board 2025-09-19 04:01:08 +02:00
Luna Schwalbe
63ab0c0302
Reenable vector tests for armeb/thumbeb
https://github.com/ziglang/zig/issues/22060 has been fixed by upstream.
2025-09-04 16:23:18 +02:00
Alex Rønne Petersen
b64fe53ad5
std.simd: Increase branch quota in suggestVectorLengthForCpu()
This does a bunch of CPU family and feature checks. It would be annoying to have
to @setEvalBranchQuota() at every comptime use site.
2025-06-30 08:01:27 +02:00
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
Jacob Young
ec579aa0f3
Legalize: implement scalarization of @shuffle 2025-06-01 08:24:01 +01:00
Jacob Young
b48d6ff619
Legalize: implement scalarization of @select 2025-06-01 08:24:01 +01:00
Jacob Young
8bacf3e757 x86_64: implement integer @reduce(.Max) 2025-05-28 15:10:22 -04:00
Alex Rønne Petersen
01b5e8b296
std: Disable some vector-related tests for hexagon.
See:

* https://github.com/llvm/llvm-project/issues/118879
* https://github.com/llvm/llvm-project/issues/134659
2025-04-11 02:28:35 +02:00
Jacob Young
e5d5a8bc4e x86_64: implement switch jump tables 2025-01-16 20:42:08 -05:00
Alex Rønne Petersen
03ac40d570
std: Disable some tests affected by #22060 for thumbeb too. 2025-01-06 16:47:40 +01:00
Alex Rønne Petersen
499ad89b41
std: Disable some vector-related tests on armeb.
https://github.com/ziglang/zig/issues/22060
2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
2f65c39715
std.simd: Disable vector prefix scan test on aarch64_be.
See: https://github.com/ziglang/zig/issues/21893
2024-11-04 08:29:42 +01: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
Alex Rønne Petersen
1bca53cc20
std.Target: Change Cpu.baseline() to also be able to take OS into consideration. 2024-10-16 00:33:10 +02:00
mlugg
0fe3fd01dd
std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.

This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
2024-08-28 08:39:59 +01:00
Alex Rønne Petersen
7d88bd0b9c
std.simd: Fix an isARM() check to use isArmOrThumb() instead.
Thumb can have NEON instructions too.
2024-08-01 20:58:08 +02:00
Alex Rønne Petersen
e5c75479c2
std.Target: Rework isPPC()/isPPC64() functions.
* Rename isPPC() -> isPowerPC32().
* Rename isPPC64() -> isPowerPC64().
* Add new isPowerPC() function which covers both.

There was confusion even in the standard library about what isPPC() meant. This
change makes these functions work how I think most people actually expect them
to work, and makes them consistent with isMIPS(), isSPARC(), etc.

I chose to rename from PPC to PowerPC because 1) it's more consistent with the
other functions, and 2) it'll cause loud rather than silent breakage for anyone
who might have been depending on isPPC() while misunderstanding it.
2024-08-01 20:58:05 +02:00
Julian Vesper
3344ed8b8f aarch64: reenable tests that are no longer regressed
Closes #12012
2024-07-25 20:23:23 +03:00
David Rubin
f2301ba896
simd: correct suggestVectorLength
* the file's doc-comment was misleading and did not focus on the correct aspect of SIMD

* added cpu flag awareness to `suggestVectorLengthForCpu` in order to provide a more accurate vector length
2024-07-14 23:02:33 -07:00
Ryan Liptak
a52f12afc9 Delete compile errors for deprecated decls 2024-05-03 13:27:30 -07:00
Andrew Kelley
aa852f737b improve documentation in std
A lot of these "shorthand" doc comments were redundant, low quality
filler content. Better to let the actual modules speak for themselves
with top level doc comments rather than trying to document their
aliases.
2024-03-10 18:13:30 -07:00
Carl Åstholm
59ac0d1eed Deprecate suggestVectorSize in favor of suggestVectorLength
The function returns the vector length, not the byte size of the vector or the bit size of individual elements. This distinction is very important and some usages of this function in the stdlib operated under these incorrect assumptions.
2024-01-01 16:18:57 +01:00
Jacob Young
b0cf620fe3 x86_64: fix cond_br 2023-10-27 03:33:49 -04:00
Jacob Young
fe93332ba2 x86_64: implement enough to pass unicode tests
* implement vector comparison
 * implement reduce for bool vectors
 * fix `@memcpy` bug
 * enable passing std tests
2023-10-23 22:42:18 -04:00
Jacob Young
27fe945a00 Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""
This reverts commit 6f0198cadb.
2023-10-22 15:46:43 -04:00
Andrew Kelley
6f0198cadb Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"
This reverts commit 0c99ba1eab, reversing
changes made to 5f92b070bf.

This caused a CI failure when it landed in master branch due to a
128-bit `@byteSwap` in std.mem.
2023-10-22 12:16:35 -07:00
Jacob Young
2e6e39a700 x86_64: fix bugs and disable erroring tests 2023-10-21 10:55:41 -04:00
Veikka Tuominen
c919e9a280 std.simd: return comptime_int from suggestVectorSize 2023-10-13 16:58:05 +03:00
Jay Petacat
37398ed2a5 std: Reactivate skipped tests w.r.t. llvm/llvm-project#55522 2023-09-27 01:37:25 +03:00
antlilja
b463e429b8 Remove len parameter from splat in standard lib 2023-07-12 15:35:57 -07:00
mlugg
f26dda2117 all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:

* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
2023-06-24 16:56:39 -07:00
Eric Joldasov
50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
xdBronch
4652729217 std.simd.suggestVectorSizeForCpu: fix missing argument in body 2023-05-13 13:35:50 +03:00
Linus Groh
94e30a756e std: fix a bunch of typos
The majority of these are in comments, some in doc comments which might
affect the generated documentation, and a few in parameter names -
nothing that should be breaking, however.
2023-04-30 18:16:04 -07:00
KOUNOIKE Yuusuke
5df31f3ef3
add wasm-simd support for suggestVectorSizeForCpu (#14992) 2023-03-20 17:45:12 +01:00
Andrew Kelley
aeaef8c0ff update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
Andrew Kelley
079f62881e std.simd.iota: make it always called at comptime
There's no reason for this to ever run at runtime; it should always be
used to generate a constant.
2023-01-04 18:37:53 -07:00
Andrew Kelley
5ca1753ff1 Revert "aarch64: reenable tests that are no longer regressed"
This reverts commit 3370d58956.

This commit was done with an LLVM build that did not have assertions
enabled. There are LLVM assertions being triggered due to this commit.

Reopens #10627
Reopens #12013
Reopens #12027
2022-12-27 20:54:27 -07:00
r00ster91
3370d58956 aarch64: reenable tests that are no longer regressed
Closes #12013
Closes #10627
Closes #12027
2022-12-10 12:34:34 +01:00
Andrew Kelley
50eb7983cd remove most conditional compilation based on stage1
There are still a few occurrences of "stage1" in the standard library
and self-hosted compiler source, however, these instances need a bit
more careful inspection to ensure no breakage.
2022-12-06 20:38:54 -07:00
Ali Chraghi
ca27055cda all: rename @maximum to @max and @minimum to @min 2022-10-18 14:15:16 +03:00
Dan Ellis Echavarria
924679abc4
std.simd: change T to u16
The `element_bit_size` would break if `T` was signed due to `ceilPowerOfTwo` only working on unsigned numbers.
2022-09-07 15:22:30 +03:00
Dan Ellis Echavarria
d1d892c83c SIMD size suggestions: suggestions code now compiles, added more
architectures
The idea behind this is using the register capabilities in safe amounts,
 there is still some consideration to be done.
+ Fixed compile error using std.Target.<arch>.featureSetHas
+ X86 MMX and "3DNOW" 64 bits register usage considered for vector size
+ Added ARM Neon recommened usage of 128 bits (The size of the register)
+ Added AARCH64 Neon and SVE for 128 bits. SVE could use in theory up to
  2048 bits, but found only evidence of functional 512 bits on a super
       computer, decided on using 128 bits as a safety
+ Added Altivec recommendation of using the 128 bits long register
+ Using MIPS msa 2x64bits capabilities, usage of 64 bits registers for MDMX
  systems, need testing on how using bigger values affect performance
+ Using V extension on RISC-V, which is extendable via instructions, decided on 128 bits
  as a value to not use all registers
+ in SPARC the 64 bits registers are used, a max of 32 registers
  are to be used for configurable simd instructions, decided on using
the size of the register, need testing on performance hit on using a
bigger sized register vector size
2022-07-22 18:58:43 +03:00
Andrew Kelley
222ea6992d std: disable aarch64 tests that regressed from LLVM 14
See #12012
2022-07-06 15:57:36 -07:00
Andrew Kelley
cbdd21cd9a std: disable tests regressed from LLVM 14 2022-07-03 15:39:39 -07:00
Andrew Kelley
095e24e537 stage2: implement alignment calculation of vectors
closes #11856
2022-06-30 19:39:41 -07:00
Veikka Tuominen
413577c881 std: adjust for stage2 semantics 2022-06-07 21:27:07 +03:00
Damien Firmenich
5fafcc2b62
zig fmt: remove trailing whitespace on doc comments
Fixes #11353

The renderer treats comments and doc comments differently since doc
comments are parsed into the Ast. This commit adds a check after getting
the text for the doc comment and trims whitespace at the end before
rendering.

The `a = 0,` in the test is here to avoid a ParseError while parsing the
test.
2022-04-05 18:08:33 +03:00