257 Commits

Author SHA1 Message Date
Stevie Hryciw
2ad6ca581d Add behavior test for copying self-referential struct
Closes #6312. In the C++ implementation this caused a stack overflow
from infinite recursion during analysis.
2023-08-06 18:23:28 -07:00
Jacob Young
3f13987a76 x86_64: add missing padding to global unions 2023-06-25 19:14:03 -04:00
Jacob Young
614c807702 x86_64: fix packed store crash 2023-06-25 19:14:03 -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
Luuk de Gram
44b322ce64
wasm-linker: correctly resolve undefined functions
We now resolve undefined symbols during incremental-compilation
where we discard the current symbol if we detect we found
an existing symbol which is not the one currently being updated.
The symbol will always be discarded in favor of the existing symbol
in such a case.
2023-06-16 17:16:56 +02:00
Luuk de Gram
1cfad29f10
codegen: fix union padding
This regressed during the internpool merges. This commit
reinstates the padding logic for unions.
2023-06-16 17:16:56 +02: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
Jacob Young
44d8cf9331 wasm: address behavior test regressions 2023-06-10 20:51:10 -07:00
Jacob Young
d40b83de45 behavior: pass more tests on llvm again 2023-06-10 20:47:56 -07:00
Andrew Kelley
629f0d23b5
Merge pull request #15579 from squeek502/mem-delimiters
Split `std.mem.split` and `tokenize` into `sequence`, `any`, and `scalar` versions
2023-06-03 13:51:02 -07:00
Luuk de Gram
1042deb86f
enable passing behavior tests 2023-05-31 18:04:33 +02:00
Evin Yulo
235b776d61 fix #15778: Binary operations on empty vectors crash 2023-05-29 13:01:11 +03:00
Jacob Young
729daed591 x86_64: rewrite casts 2023-05-18 20:42:38 -04:00
Jacob Young
904ffb41de x86_64: implement calling function references 2023-05-15 03:07:51 -04:00
Jacob Young
e36e9323f4 x86_64: implement union_init 2023-05-15 03:07:51 -04:00
Ryan Liptak
815e53b147 Update all std.mem.tokenize calls to their appropriate function
Everywhere that can now use `tokenizeScalar` should get a nice little performance boost.
2023-05-13 13:45:04 -07:00
Ali Chraghi
ccc490ef68
setup spirv backend in behavior tests 2023-05-11 20:31:52 +02:00
Jacob Young
5d4288c5f6 x86_64: fix unordered float equality 2023-05-08 07:36:19 -04:00
Jacob Young
1a261917ce x86_64: implement @ctz and @clz for u128 2023-05-08 07:36:19 -04:00
Jacob Young
36a39267b8 x86_64: fix feature confusion 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
Jakub Konka
bc69d5a00f macho: invalidate GOT/stub relocs after segment shift in memory 2023-04-26 19:08:38 -04:00
Jacob Young
b5b0b55582 x86_64: fix tlv references 2023-04-26 19:05:17 -04:00
Jacob Young
894406b9d3 behavior: update passing cbe tests 2023-04-26 19:05:17 -04:00
Andrew Kelley
a5c910adb6 change semantics of @memcpy and @memset
Now they use slices or array pointers with any element type instead of
requiring byte pointers.

This is a breaking enhancement to the language.

The safety check for overlapping pointers will be implemented in a
future commit.

closes #14040
2023-04-25 11:23:40 -07:00
Jacob Young
780f654e19 behavior: disable flaky test on x86_64
Also reenable stage2_x86_64 windows behavior tests in case it is failing
for the same reason.

Closes #15324
2023-04-16 17:07:07 -04:00
Jacob Young
c1a2da6b78 x86_64: implement packed load and store 2023-04-16 17:05:35 -04:00
Andrew Kelley
a281d29881 disable not-yet-passing C backend tests 2023-04-15 10:33:08 -07:00
Jacob Young
0165187cd0 x86_64: fix some of the mass confusion about the meaning of MCValue 2023-04-13 04:17:47 -04:00
Jacob Young
5900dc0580 x86_64: fix typos 2023-04-03 18:02:55 +02:00
Jacob Young
272acb7ee5 x86_64: implement storing large immediates 2023-04-03 17:45:16 +02:00
Jacob Young
b80cdde4f0 x86_64: implement struct_field_val for large packed structs 2023-04-02 04:49:53 -04:00
Jacob Young
83a208c355 x86_64: implement large cmp 2023-04-02 04:49:53 -04:00
Jacob Young
677427bc3a x86_64: implement error name 2023-04-02 04:49:53 -04:00
Jacob Young
802c2e4fae x86_64: fix popcnt and disable regressed test 2023-03-27 05:58:00 -04:00
Jacob Young
1e080e5056 x86_64: implement atomic loops 2023-03-25 16:23:55 -04:00
Jacob Young
8f385e77ca x86_64: implement struct_field_val for packed containers 2023-03-25 16:23:55 -04:00
Jacob Young
0cfc0d0d13 x86_64: implement struct_field_ptr for packed containers 2023-03-25 16:23:55 -04:00
Jacob Young
dbe1b4a7e5 x86_64: fix value tracking bugs 2023-03-24 17:57:58 -04:00
Jacob Young
f316cb29cc x86_64: implement atomic and fence ops 2023-03-21 08:49:54 +01:00
Jacob Young
f95faac5ae x86_64: (re)implement optional ops
Note that this commit also changes the layout of optional for all
other backends using `src/codegen.zig` without updating them!
2023-03-21 08:49:54 +01:00
Jacob Young
c51930b060 behavior: enable passing behavior tests on stage2_x86_64 2023-03-15 01:04:21 -04:00
Ian Johnson
adc6dec26b Sema: avoid panic on callconv(.C) generic return type
Fixes #14854
2023-03-13 13:17:13 +02:00
Jacob Young
93d696e84e CBE: implement some big integer and vector unary operations 2023-03-05 02:59:01 -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
d284c00fda Sema: handle lazy values in more places
* resolve lazy values in anon structs being passed to anytype params
* use `resolveMaybeUndefValIntable` where appropriate

Closes #14356
2023-01-22 00:12:36 +02:00
Michael Dusan
e0fb4c29cb llvm codegen: fix f16,f32,f64 nan bitcasts
@bitCast from integer NaN representation to float NaN resulted in
changed bits in float. This only happened with signaled NaN.

- added test for signaled NaN
- added tests for quiet NaN (for completeness)

closes #14198
2023-01-05 02:22:30 -07:00
Michael Dusan
ed23615638 behavior: add test for #8277
Test `@sizeOf` reified union with zero-size payload fields.

closes #8277
2023-01-04 15:48:00 -05:00