Commit graph

2149 commits

Author SHA1 Message Date
Jacob Young
27cfff8f44 x86_64: pass exact integer bit sizes to compiler-rt routines
This was a hack around compiler-rt not computing the correct size.
2025-04-11 07:06:01 -04:00
Alex Rønne Petersen
0132be7bf3 std.Target: Rename charSignedness() to cCharSignedness().
To be consistent with the other functions that answer C ABI questions.
2025-04-11 05:22:00 -04:00
Jacob Young
73498737a2 x86_64: fix error_set_has_value of inferred error sets 2025-04-10 06:04:09 -04:00
Jacob Young
7a2963efab x86_64: add avx512 registers 2025-04-10 02:04:52 -04:00
Jacob Young
bbf8abf5d3 x86_64: support rip-relative addressing to labels in inline asm 2025-04-10 02:04:52 -04:00
Jacob Young
f4a31bed98 x86_64: remove broken const value tracking 2025-04-10 02:04:52 -04:00
Jacob Young
1eb5d70d12 x86_64: fix switch on big ints 2025-04-09 20:14:12 -04:00
Jacob Young
bc10131db1 x86_64: rewrite scalar @mulWithOverflow
Closes #19607
2025-04-09 20:14:12 -04:00
Jacob Young
55ce756868 x86_64: rewrite scalar @subWithOverflow 2025-04-09 20:14:12 -04:00
Jacob Young
80068b6e59 x86_64: rewrite scalar @addWithOverflow 2025-04-09 20:14:12 -04:00
Jacob Young
9827ffe1de x86_64: fix incorrect handling of unreusable operands
Closes #23448
2025-04-05 20:49:56 -04:00
Андрей Краевский
aac800ec65
std.meta.FieldType -> @FieldType 2025-03-27 03:49:38 +00:00
Pavel Verigo
33ad2c949e stage2-wasm: packed store/load 128 bits 2025-03-24 15:00:00 +01:00
Pavel Verigo
911f4527f0 stage2-wasm: behavior tests pass with ReleaseFast/Small 2025-03-24 15:00:00 +01:00
Pavel Verigo
47cd0961cb stage2-wasm: pass field_parent_ptr tests
Handle packed containers, also fixes packed union lowering for non int type + union field pointer logic fix
2025-03-24 15:00:00 +01:00
Pavel Verigo
58b38238f5 stage2-wasm: enable undef test + ignore undef store/memset with safety off 2025-03-24 15:00:00 +01:00
Pavel Verigo
07f14bd43b stage2-wasm: fix error union handling 2025-03-24 15:00:00 +01:00
Pavel Verigo
0e109add37 stage2-wasm: clean memcpy + fix another bug in aggr_init for optionals arr 2025-03-24 15:00:00 +01:00
Pavel Verigo
15bc2ab0a8 stage2-wasm: clz fix 2025-03-24 15:00:00 +01:00
Pavel Verigo
ca2bd6d6ef stage2-wasm: fix comparing and storing optionals 2025-03-24 14:58:05 +01:00
Jacob Young
98640cbeb8
Merge pull request #23209 from jacobly0/x86_64-rewrite
x86_64: rewrite wrapping multiplication
2025-03-23 21:56:58 -04:00
Jacob Young
3c3a6c937b x86_64: fix rare miscomp that clobbers memory 2025-03-22 04:29:18 -04:00
Bingwu Zhang
c62fb118e7
x86_64: fix packedStore miscomp by spilling EFLAGS
Fixes #20113 and #20581.

AND instructions in packedStore clobbers EFLAGS.

Bug: https://github.com/ziglang/zig/issues/20113
Bug: https://github.com/ziglang/zig/issues/20581
Signed-off-by: Bingwu Zhang <xtex@aosc.io>
2025-03-22 16:06:07 +08:00
Jacob Young
2361468e23 x86_64: rewrite scalar shifts 2025-03-21 21:51:09 -04:00
Jacob Young
c5c1c8538d x86_64: rewrite wrapping multiplication 2025-03-21 21:51:08 -04:00
Jacob Young
cff90e3ae0 x86_64: implement select of register mask 2025-03-10 10:38:33 -04:00
Jacob Young
0ef3250c34 x86_64: fix symbol bugs
Closes #23143
2025-03-10 10:38:30 -04:00
Jacob Young
5d115632d4 x86_64: reuse single register code during register write splitting 2025-03-07 23:59:38 -05:00
Jacob Young
54ed62755f x86_64: implement write register splitting 2025-03-07 23:59:31 -05:00
Jacob Young
f8f2a3ea6f x86_64: rewrite aggregate init 2025-03-07 23:59:09 -05:00
Jacob Young
a6525c1762
Merge pull request #22529 from xtexx/x86-64/shl-sat-int
x86_64: Implement integer saturating left shifting codegen
2025-03-02 02:51:36 -05:00
xtex
4e32193de3
x86_64: implement integer saturating left shifting codegen
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: #17645
Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Signed-off-by: Bingwu Zhang <xtex@aosc.io>
2025-03-02 10:30:32 +08:00
Jacob Young
50b40c9621 x86_64: rewrite wrapping add/sub 2025-03-01 16:29:22 -05:00
mlugg
e0a955afb3 x86_64: use ZON for encodings 2025-02-25 22:32:00 +00:00
Andrew Kelley
eb3c7f5706 zig build fmt 2025-02-22 17:09:20 -08:00
87flowers
855445f18e arch/sparc64/CodeGen: Fix indentation in realStackOffset 2025-02-22 17:09:20 -08:00
Pavel Verigo
b25d93e7d9 stage2-wasm: implement switch_dispatch + handle > 32 bit integers in switches
Updated solution is future proof for arbitary size integer handling for both strategies .br_table lowering if switch case is dense, .br_if base jump table if values are too sparse.
2025-02-22 18:34:00 -05:00
Jacob Young
300cb4881f x86_64: rewrite scalar @bitReverse 2025-02-22 00:05:47 -05:00
Jacob Young
7d70d7b215 x86_64: rewrite scalar @popCount 2025-02-18 09:47:44 -05:00
Jacob Young
ebea56d279 x86_64: rewrite scalar @ctz 2025-02-18 09:47:44 -05:00
Andrew Kelley
d2e70ef84a
Merge pull request #22913 from jacobly0/x86_64-rewrite
x86_64: rewrite unsafe int vector multiplication
2025-02-17 16:13:22 -08:00
Alex Rønne Petersen
481b7bf3f0
std.Target: Remove functions that just wrap component functions.
Functions like isMinGW() and isGnuLibC() have a good reason to exist: They look
at multiple components of the target. But functions like isWasm(), isDarwin(),
isGnu(), etc only exist to save 4-8 characters. I don't think this is a good
enough reason to keep them, especially given that:

* It's not immediately obvious to a reader whether target.isDarwin() means the
  same thing as target.os.tag.isDarwin() precisely because isMinGW() and similar
  functions *do* look at multiple components.
* It's not clear where we would draw the line. The logical conclusion before
  this commit would be to also wrap Arch.isX86(), Os.Tag.isSolarish(),
  Abi.isOpenHarmony(), etc... this obviously quickly gets out of hand.
* It's nice to just have a single correct way of doing something.
2025-02-17 19:18:19 +01:00
Alex Rønne Petersen
e0f8d4e68e
std.builtin: Rename CallingConvention.wasm_watc to wasm_mvp. 2025-02-17 19:17:56 +01:00
Jacob Young
ff74127526 x86_64: implement prefetch 2025-02-17 06:04:43 -05:00
Jacob Young
82eedf56d7 x86_64: rewrite scalar @byteSwap 2025-02-17 05:36:18 -05:00
Jacob Young
cec6867d76 x86_64: rewrite unsafe int vector multiplication 2025-02-17 00:10:24 -05:00
Jacob Young
dcc9fe322e x86_64: rewrite unsafe scalar int multiplication 2025-02-15 04:13:21 -05:00
Jacob Young
5db585fcde x86_64: reuse integer @divTrunc for @divExact 2025-02-15 03:45:21 -05:00
Jacob Young
4ea18c22f9 x86_64: rewrite array access 2025-02-15 03:45:21 -05:00
Jacob Young
f6bcc9dbcb x86_64: rewrite scalar and vector int @rem 2025-02-15 03:45:21 -05:00