Commit graph

196 commits

Author SHA1 Message Date
Robin Voetter
075584a4d7 spirv: enable passing tests 2023-09-23 12:36:56 -07:00
Xavier Bouchoux
77dd64b5f4 Sema: fix coerceArrayLike() for vectors with padding
as explainded at https://llvm.org/docs/LangRef.html#vector-type :

"In general vector elements are laid out in memory in the same way as array types.
Such an analogy works fine as long as the vector elements are byte sized.
However, when the elements of the vector aren’t byte sized it gets a bit more complicated.
One way to describe the layout is by describing what happens when a vector such
as <N x iM> is bitcasted to an integer type with N*M bits, and then following the
rules for storing such an integer to memory."

"When <N*M> isn’t evenly divisible by the byte size the exact memory layout
is unspecified (just like it is for an integral type of the same size)."
2023-08-10 16:10:59 -07: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
Evan Haas
9b5586ab7c add behavior test for vector bitcast at comptime
closes #8184
2023-07-29 18:08:47 -07:00
Xavier Bouchoux
5ab1854602 codegen/llvm: fix memset with vectors smaller than one byte
The special case to take advantage of llvm's intrinsic
was generating invalid llvm ir:

```
Invalid bitcast
  %60 = bitcast <2 x i2> %59 to i8, !dbg !3122
thread 145453 panic: LLVM module verification failed
```
2023-07-25 18:14:10 -07:00
antlilja
a0ec2266fe Update tests to new splat syntax 2023-07-12 15:35:57 -07:00
r00ster91
adf0718316 behavior: boolean vector with 2 or more elements
Closes #12169
2023-06-27 19:57:23 -04: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
mlugg
ce88c43a4e Sema: allow indexing tuple and vector pointers
Resolves: #13852
Resolves: #14705
2023-06-14 22:07:25 -07: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
mlugg
1e7dcaa3ae Sema: resolve peer vector types before comparison
Resolves: #15732
2023-06-10 21:41:49 +03:00
Veikka Tuominen
230ea411f7 disable test on C backend
This test was previously incorrect and was not testing the intended instruction.
2023-05-25 18:49:18 +03:00
Veikka Tuominen
4a3539e449 llvm: fix vector type in vector_store_elem
Closes #15848
2023-05-25 15:57:30 +03:00
Jacob Young
60e69fdaa1 codegen: emit global vector padding 2023-05-18 20:42:38 -04:00
Jacob Young
40457a3696 x86_64: implement integer vector bitwise operations 2023-05-15 03:07:51 -04:00
Jacob Young
f39ff6cc68 x86_64: implement integer vector mul 2023-05-15 03:07:51 -04:00
Jacob Young
2cbd442a9d x86_64: implement integer vector movement 2023-05-15 03:07:51 -04:00
Ali Chraghi
ccc490ef68
setup spirv backend in behavior tests 2023-05-11 20:31:52 +02:00
Jacob Young
32ab930f1d x86_64: implement f16 conversions when supported 2023-05-08 07:36:19 -04:00
Dominic
5a3eca5d4c
Disallow named test decls with duplicate names 2023-05-08 10:59:06 +03:00
Jacob Young
a19faa2481 x86_64: implement movement of more types
* f16
 * f128
 * vector
2023-05-03 04:25:14 -04:00
Jacob Young
6de457211f behavior: update affected tests for the x86_64 backend 2023-05-01 19:22:52 -04:00
Koakuma
d339e86fb1 stage2: sparc64: Skip unimplemented tests 2023-04-28 16:45:37 -07:00
Jacob Young
894406b9d3 behavior: update passing cbe tests 2023-04-26 19:05:17 -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
Andrew Kelley
a2793f8ab8
Merge pull request #14853 from schmee/vector-peer-type-resolution
Vector type resolution/coercion fixes
2023-04-10 12:21:55 -04:00
Auguste Rame
7225a15abe
Enable new tests 2023-04-07 20:55:04 -04:00
Jacob Young
1e080e5056 x86_64: implement atomic loops 2023-03-25 16:23:55 -04:00
Jacob Young
c51930b060 behavior: enable passing behavior tests on stage2_x86_64 2023-03-15 01:04:21 -04:00
John Schmidt
0606f0aa55 sema: fix result ptr coercion array -> vector
Previously this worked for array to vector where the element type
matched exactly (e.g `[4]u8` to `@Vector(4, u8)`) since that is
performed with a simple `.bitcast` operation, but now it also works for
types where the array is coercible to the vector type (e.g `[4]u8` to
`@Vector(4, u16)`).
2023-03-09 00:55:33 +01:00
John Schmidt
505e720421 sema: add peer type resolution for vectors
This is consistent with how coercion for vectors work. So now you can do
this:

```
var a: @Vector(2, u16) = .{1, 2};
var b: @Vector(2, u8) = .{2, 1};
const c = @min(a, b);
```

where previously you had to cast explicitly:

```
var a: @Vector(2, u16) = .{1, 2};
var b: @Vector(2, u8) = .{2, 1};
var c: @Vector(2, u16) = b;
const c = @min(a, c);
```
2023-03-09 00:55:17 +01:00
Jacob Young
7352d461cf behavior: fix comptime issue and disable failing test 2023-03-05 03:34:57 -05:00
Jacob Young
33fa25ba44 CBE: ensure uniqueness of more internal identifiers 2023-03-05 02:59:02 -05:00
Jacob Young
0b0298aff2 CBE: implement select and shuffle 2023-03-05 02:59:02 -05:00
Jacob Young
aac4707902 CBE: implement splat 2023-03-05 02:59:02 -05:00
Jacob Young
8f6da78fb1 CBE: implement vector element pointers 2023-03-05 02:59:02 -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
Jacob Young
a8f4ac2b94 CBE: implement big integer and vector comparisons 2023-03-05 02:59:01 -05:00
Jacob Young
1453a595aa CBE: reuse locals with the same CType instead of Type
Many `Type`s can correspond to the same `CType`, so this reduces the
number of used locals by 27760 when compiling only-c.

Also, disabled some tests that were only passing by accident and
shouldn't really be considered working.
2023-02-24 23:41:54 -05:00
Jacob Young
434c6f42ca behavior: enable passing CBE tests 2023-02-21 09:43:23 -05:00
Andrew Kelley
f0530385b5 update existing behavior tests and std lib to new for loop semantics 2023-02-18 19:17:21 -07:00
Veikka Tuominen
5f5ab49168 Value: implement compareAllWithZero for bytes and str_lit
Closes #10692
2023-01-22 00:12:37 +02: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
Veikka Tuominen
a777373bb8 enable test on more targets
This was fixed by 8a0a6b7387 for targets
without avx512
2022-12-27 15:34:19 +02:00
Veikka Tuominen
622311fb9a update uses of overflow arithmetic builtins 2022-12-27 15:13:14 +02:00
Veikka Tuominen
81443fcde8 Sema: add error for recursive inline call
Closes #12973
2022-12-26 16:36:30 +02:00