authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-26 21:45:45-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-26 22:35:38-04:00
log6ad22cd964741ec646eb551877591d719e0c41f5
tree3101238c5e330ba642a0f4625cf4862870533d02
parent48526c0eb6c394b778cba11559a66daf8d5ec3c7

x86_64: add missing spills


17 files changed, 36 insertions(+), 97 deletions(-)

lib/std/compress/deflate/compressor.zig-2
......@@ -1069,8 +1069,6 @@ var deflate_tests = [_]DeflateTest{
10691069};
10701070
10711071test "deflate" {
1072 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1073
10741072 for (deflate_tests) |dt| {
10751073 var output = ArrayList(u8).init(testing.allocator);
10761074 defer output.deinit();
lib/std/compress/deflate/compressor_test.zig+1-18
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const expect = std.testing.expect;
43const fifo = std.fifo;
54const io = std.io;
......@@ -154,8 +153,6 @@ fn testToFromWithLimit(input: []const u8, limit: [11]u32) !void {
154153}
155154
156155test "deflate/inflate" {
157 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
158
159156 var limits = [_]u32{0} ** 11;
160157
161158 var test0 = [_]u8{};
......@@ -180,8 +177,6 @@ test "deflate/inflate" {
180177}
181178
182179test "very long sparse chunk" {
183 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
184
185180 // A SparseReader returns a stream consisting of 0s ending with 65,536 (1<<16) 1s.
186181 // This tests missing hash references in a very large input.
187182 const SparseReader = struct {
......@@ -243,7 +238,7 @@ test "very long sparse chunk" {
243238}
244239
245240test "compressor reset" {
246 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
241 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
247242
248243 for (std.enums.values(deflate.Compression)) |c| {
249244 try testWriterReset(c, null);
......@@ -295,8 +290,6 @@ fn testWriterReset(level: deflate.Compression, dict: ?[]const u8) !void {
295290}
296291
297292test "decompressor dictionary" {
298 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
299
300293 const dict = "hello world"; // dictionary
301294 const text = "hello again world";
302295
......@@ -337,8 +330,6 @@ test "decompressor dictionary" {
337330}
338331
339332test "compressor dictionary" {
340 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
341
342333 const dict = "hello world";
343334 const text = "hello again world";
344335
......@@ -385,8 +376,6 @@ test "compressor dictionary" {
385376// Update the hash for best_speed only if d.index < d.maxInsertIndex
386377// See https://golang.org/issue/2508
387378test "Go non-regression test for 2508" {
388 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
390379 var comp = try compressor(
391380 testing.allocator,
392381 io.null_writer,
......@@ -404,8 +393,6 @@ test "Go non-regression test for 2508" {
404393}
405394
406395test "deflate/inflate string" {
407 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
408
409396 const StringTest = struct {
410397 filename: []const u8,
411398 limit: [11]u32,
......@@ -453,8 +440,6 @@ test "deflate/inflate string" {
453440}
454441
455442test "inflate reset" {
456 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
457
458443 const strings = [_][]const u8{
459444 "lorem ipsum izzle fo rizzle",
460445 "the quick brown fox jumped over",
......@@ -501,8 +486,6 @@ test "inflate reset" {
501486}
502487
503488test "inflate reset dictionary" {
504 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
505
506489 const dict = "the lorem fox";
507490 const strings = [_][]const u8{
508491 "lorem ipsum izzle fo rizzle",
lib/std/compress/deflate/deflate_fast.zig-2
......@@ -649,8 +649,6 @@ test "best speed shift offsets" {
649649}
650650
651651test "best speed reset" {
652 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
653
654652 // test that encoding is consistent across a warparound of the table offset.
655653 // See https://github.com/golang/go/issues/34121
656654 const fmt = std.fmt;
lib/std/compress/deflate/deflate_fast_test.zig-5
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const expect = std.testing.expect;
43const io = std.io;
54const mem = std.mem;
......@@ -12,8 +11,6 @@ const inflate = @import("decompressor.zig");
1211const deflate_const = @import("deflate_const.zig");
1312
1413test "best speed" {
15 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
16
1714 // Tests that round-tripping through deflate and then inflate recovers the original input.
1815 // The Write sizes are near the thresholds in the compressor.encSpeed method (0, 16, 128), as well
1916 // as near `deflate_const.max_store_block_size` (65535).
......@@ -96,8 +93,6 @@ test "best speed" {
9693}
9794
9895test "best speed max match offset" {
99 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
100
10196 const abc = "abcdefgh";
10297 const xyz = "stuvwxyz";
10398 const input_margin = 16 - 1;
lib/std/compress/deflate/huffman_bit_writer.zig-7
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const io = std.io;
43
54const Allocator = std.mem.Allocator;
......@@ -845,8 +844,6 @@ const testing = std.testing;
845844const ArrayList = std.ArrayList;
846845
847846test "writeBlockHuff" {
848 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
849
850847 // Tests huffman encoding against reference files to detect possible regressions.
851848 // If encoding/bit allocation changes you can regenerate these files
852849
......@@ -1571,8 +1568,6 @@ const TestType = enum {
15711568};
15721569
15731570test "writeBlock" {
1574 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1575
15761571 // tests if the writeBlock encoding has changed.
15771572
15781573 const ttype: TestType = .write_block;
......@@ -1588,8 +1583,6 @@ test "writeBlock" {
15881583}
15891584
15901585test "writeBlockDynamic" {
1591 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1592
15931586 // tests if the writeBlockDynamic encoding has changed.
15941587
15951588 const ttype: TestType = .write_dyn_block;
lib/std/compress/zlib.zig-2
......@@ -264,8 +264,6 @@ test "sanity checks" {
264264}
265265
266266test "compress data" {
267 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
268
269267 const allocator = testing.allocator;
270268 const rfc1951_txt = @embedFile("testdata/rfc1951.txt");
271269
lib/std/crypto/25519/ed25519.zig+2-1
......@@ -685,7 +685,8 @@ test "ed25519 signatures with streaming" {
685685}
686686
687687test "ed25519 key pair from secret key" {
688 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
688 if (builtin.zig_backend == .stage2_x86_64 and
689 !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .avx)) return error.SkipZigTest;
689690
690691 const kp = try Ed25519.KeyPair.create(null);
691692 const kp2 = try Ed25519.KeyPair.fromSecretKey(kp.secret_key);
lib/std/crypto/chacha20.zig-6
......@@ -1029,8 +1029,6 @@ test "crypto.chacha20 test vector 5" {
10291029}
10301030
10311031test "seal" {
1032 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1033
10341032 {
10351033 const m = "";
10361034 const ad = "";
......@@ -1081,8 +1079,6 @@ test "seal" {
10811079}
10821080
10831081test "open" {
1084 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1085
10861082 {
10871083 const c = [_]u8{ 0xa0, 0x78, 0x4d, 0x7a, 0x47, 0x16, 0xf3, 0xfe, 0xb4, 0xf6, 0x4e, 0x7f, 0x4b, 0x39, 0xbf, 0x4 };
10881084 const ad = "";
......@@ -1147,8 +1143,6 @@ test "open" {
11471143}
11481144
11491145test "crypto.xchacha20" {
1150 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1151
11521146 const key = [_]u8{69} ** 32;
11531147 const nonce = [_]u8{42} ** 24;
11541148 const m = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.";
lib/std/crypto/ecdsa.zig+12-24
......@@ -372,10 +372,8 @@ pub fn Ecdsa(comptime Curve: type, comptime Hash: type) type {
372372}
373373
374374test "ECDSA - Basic operations over EcdsaP384Sha384" {
375 switch (builtin.zig_backend) {
376 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
377 else => {},
378 }
375 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
376 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
379377
380378 const Scheme = EcdsaP384Sha384;
381379 const kp = try Scheme.KeyPair.create(null);
......@@ -391,10 +389,8 @@ test "ECDSA - Basic operations over EcdsaP384Sha384" {
391389}
392390
393391test "ECDSA - Basic operations over Secp256k1" {
394 switch (builtin.zig_backend) {
395 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
396 else => {},
397 }
392 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
393 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
398394
399395 const Scheme = EcdsaSecp256k1Sha256oSha256;
400396 const kp = try Scheme.KeyPair.create(null);
......@@ -410,10 +406,8 @@ test "ECDSA - Basic operations over Secp256k1" {
410406}
411407
412408test "ECDSA - Basic operations over EcdsaP384Sha256" {
413 switch (builtin.zig_backend) {
414 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
415 else => {},
416 }
409 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
410 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
417411
418412 const Scheme = Ecdsa(crypto.ecc.P384, crypto.hash.sha2.Sha256);
419413 const kp = try Scheme.KeyPair.create(null);
......@@ -429,10 +423,8 @@ test "ECDSA - Basic operations over EcdsaP384Sha256" {
429423}
430424
431425test "ECDSA - Verifying a existing signature with EcdsaP384Sha256" {
432 switch (builtin.zig_backend) {
433 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
434 else => {},
435 }
426 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
427 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
436428
437429 const Scheme = Ecdsa(crypto.ecc.P384, crypto.hash.sha2.Sha256);
438430 // zig fmt: off
......@@ -476,10 +468,8 @@ const TestVector = struct {
476468};
477469
478470test "ECDSA - Test vectors from Project Wycheproof" {
479 switch (builtin.zig_backend) {
480 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
481 else => {},
482 }
471 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
472 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
483473
484474 const vectors = [_]TestVector{
485475 .{ .key = "042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", .msg = "313233343030", .sig = "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802204cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", .result = .valid },
......@@ -893,10 +883,8 @@ fn tvTry(vector: TestVector) !void {
893883}
894884
895885test "ECDSA - Sec1 encoding/decoding" {
896 switch (builtin.zig_backend) {
897 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
898 else => {},
899 }
886 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
887 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
900888
901889 const Scheme = EcdsaP384Sha384;
902890 const kp = try Scheme.KeyPair.create(null);
lib/std/crypto/ff.zig+14-15
......@@ -6,7 +6,7 @@
66//! Parts of that code was ported from the BSD-licensed crypto/internal/bigmod/nat.go file in the Go language, itself inspired from BearSSL.
77
88const std = @import("std");
9const builtin = std.builtin;
9const builtin = @import("builtin");
1010const crypto = std.crypto;
1111const math = std.math;
1212const mem = std.mem;
......@@ -14,6 +14,7 @@ const meta = std.meta;
1414const testing = std.testing;
1515const BoundedArray = std.BoundedArray;
1616const assert = std.debug.assert;
17const Endian = std.builtin.Endian;
1718
1819// A Limb is a single digit in a big integer.
1920const Limb = usize;
......@@ -27,7 +28,7 @@ const t_bits: usize = @bitSizeOf(Limb) - carry_bits;
2728// A TLimb is a Limb that is truncated to t_bits.
2829const TLimb = meta.Int(.unsigned, t_bits);
2930
30const native_endian = @import("builtin").target.cpu.arch.endian();
31const native_endian = builtin.target.cpu.arch.endian();
3132
3233// A WideLimb is a Limb that is twice as wide as a normal Limb.
3334const WideLimb = struct {
......@@ -128,7 +129,7 @@ pub fn Uint(comptime max_bits: comptime_int) type {
128129 }
129130
130131 /// Encodes a big integer into a byte array.
131 pub fn toBytes(self: Self, bytes: []u8, comptime endian: builtin.Endian) OverflowError!void {
132 pub fn toBytes(self: Self, bytes: []u8, comptime endian: Endian) OverflowError!void {
132133 if (bytes.len == 0) {
133134 if (self.isZero()) return;
134135 return error.Overflow;
......@@ -175,7 +176,7 @@ pub fn Uint(comptime max_bits: comptime_int) type {
175176 }
176177
177178 /// Creates a new big integer from a byte array.
178 pub fn fromBytes(bytes: []const u8, comptime endian: builtin.Endian) OverflowError!Self {
179 pub fn fromBytes(bytes: []const u8, comptime endian: Endian) OverflowError!Self {
179180 if (bytes.len == 0) return Self.zero;
180181 var shift: usize = 0;
181182 var out = Self.zero;
......@@ -335,7 +336,7 @@ fn Fe_(comptime bits: comptime_int) type {
335336 }
336337
337338 /// Creates a field element from a byte string.
338 pub fn fromBytes(m: Modulus(bits), bytes: []const u8, comptime endian: builtin.Endian) (OverflowError || FieldElementError)!Self {
339 pub fn fromBytes(m: Modulus(bits), bytes: []const u8, comptime endian: Endian) (OverflowError || FieldElementError)!Self {
339340 const v = try FeUint.fromBytes(bytes, endian);
340341 var fe = Self{ .v = v };
341342 try m.shrink(&fe);
......@@ -344,7 +345,7 @@ fn Fe_(comptime bits: comptime_int) type {
344345 }
345346
346347 /// Converts the field element to a byte string.
347 pub fn toBytes(self: Self, bytes: []u8, comptime endian: builtin.Endian) OverflowError!void {
348 pub fn toBytes(self: Self, bytes: []u8, comptime endian: Endian) OverflowError!void {
348349 return self.v.toBytes(bytes, endian);
349350 }
350351
......@@ -458,13 +459,13 @@ pub fn Modulus(comptime max_bits: comptime_int) type {
458459 }
459460
460461 /// Creates a new modulus from a byte string.
461 pub fn fromBytes(bytes: []const u8, comptime endian: builtin.Endian) (InvalidModulusError || OverflowError)!Self {
462 pub fn fromBytes(bytes: []const u8, comptime endian: Endian) (InvalidModulusError || OverflowError)!Self {
462463 const v = try FeUint.fromBytes(bytes, endian);
463464 return try Self.fromUint(v);
464465 }
465466
466467 /// Serializes the modulus to a byte string.
467 pub fn toBytes(self: Self, bytes: []u8, comptime endian: builtin.Endian) OverflowError!void {
468 pub fn toBytes(self: Self, bytes: []u8, comptime endian: Endian) OverflowError!void {
468469 return self.v.toBytes(bytes, endian);
469470 }
470471
......@@ -658,7 +659,7 @@ pub fn Modulus(comptime max_bits: comptime_int) type {
658659
659660 // Returns x^e (mod m), with the exponent provided as a byte string.
660661 // `public` must be set to `false` if the exponent it secret.
661 fn powWithEncodedExponentInternal(self: Self, x: Fe, e: []const u8, endian: builtin.Endian, comptime public: bool) NullExponentError!Fe {
662 fn powWithEncodedExponentInternal(self: Self, x: Fe, e: []const u8, endian: Endian, comptime public: bool) NullExponentError!Fe {
662663 var acc: u8 = 0;
663664 for (e) |b| acc |= b;
664665 if (acc == 0) return error.NullExponent;
......@@ -801,7 +802,7 @@ pub fn Modulus(comptime max_bits: comptime_int) type {
801802 /// doesn't have to be created if a serialized representation is already available.
802803 ///
803804 /// If the exponent is public, `powWithEncodedPublicExponent()` can be used instead for a slight speedup.
804 pub fn powWithEncodedExponent(self: Self, x: Fe, e: []const u8, endian: builtin.Endian) NullExponentError!Fe {
805 pub fn powWithEncodedExponent(self: Self, x: Fe, e: []const u8, endian: Endian) NullExponentError!Fe {
805806 return self.powWithEncodedExponentInternal(x, e, endian, false);
806807 }
807808
......@@ -810,7 +811,7 @@ pub fn Modulus(comptime max_bits: comptime_int) type {
810811 /// doesn't have to be created if a serialized representation is already available.
811812 ///
812813 /// If the exponent is secret, `powWithEncodedExponent` must be used instead.
813 pub fn powWithEncodedPublicExponent(self: Self, x: Fe, e: []const u8, endian: builtin.Endian) NullExponentError!Fe {
814 pub fn powWithEncodedPublicExponent(self: Self, x: Fe, e: []const u8, endian: Endian) NullExponentError!Fe {
814815 return self.powWithEncodedExponentInternal(x, e, endian, true);
815816 }
816817 };
......@@ -912,10 +913,8 @@ const ct_unprotected = struct {
912913};
913914
914915test {
915 switch (@import("builtin").zig_backend) {
916 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
917 else => {},
918 }
916 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
917 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
919918
920919 const M = Modulus(256);
921920 const m = try M.fromPrimitive(u256, 3429938563481314093726330772853735541133072814650493833233);
lib/std/crypto/pcurves/p384.zig+2-4
......@@ -478,10 +478,8 @@ pub const AffineCoordinates = struct {
478478};
479479
480480test {
481 switch (@import("builtin").zig_backend) {
482 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
483 else => {},
484 }
481 if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest;
482 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
485483
486484 _ = @import("tests/p384.zig");
487485}
lib/std/crypto/pcurves/secp256k1.zig+2-4
......@@ -556,10 +556,8 @@ pub const AffineCoordinates = struct {
556556};
557557
558558test {
559 switch (@import("builtin").zig_backend) {
560 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
561 else => {},
562 }
559 if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest;
560 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
563561
564562 _ = @import("tests/secp256k1.zig");
565563}
lib/std/crypto/poly1305.zig-2
......@@ -196,8 +196,6 @@ pub const Poly1305 = struct {
196196};
197197
198198test "poly1305 rfc7439 vector1" {
199 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
200
201199 const expected_mac = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9";
202200
203201 const msg = "Cryptographic Forum Research Group";
lib/std/crypto/salsa20.zig-2
......@@ -623,8 +623,6 @@ test "xsalsa20poly1305 sealedbox" {
623623}
624624
625625test "secretbox twoblocks" {
626 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
627
628626 const key = [_]u8{ 0xc9, 0xc9, 0x4d, 0xcf, 0x68, 0xbe, 0x00, 0xe4, 0x7f, 0xe6, 0x13, 0x26, 0xfc, 0xc4, 0x2f, 0xd0, 0xdb, 0x93, 0x91, 0x1c, 0x09, 0x94, 0x89, 0xe1, 0x1b, 0x88, 0x63, 0x18, 0x86, 0x64, 0x8b, 0x7b };
629627 const nonce = [_]u8{ 0xa4, 0x33, 0xe9, 0x0a, 0x07, 0x68, 0x6e, 0x9a, 0x2b, 0x6d, 0xd4, 0x59, 0x04, 0x72, 0x3e, 0xd3, 0x8a, 0x67, 0x55, 0xc7, 0x9e, 0x3e, 0x77, 0xdc };
630628 const msg = [_]u8{'a'} ** 97;
lib/std/crypto/sha2.zig+1-1
......@@ -238,7 +238,7 @@ fn Sha2x32(comptime params: Sha2Params32) type {
238238 return;
239239 },
240240 // C backend doesn't currently support passing vectors to inline asm.
241 .x86_64 => if (builtin.zig_backend != .stage2_c and builtin.zig_backend != .stage2_x86_64 and comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .sha, .avx2 })) {
241 .x86_64 => if (builtin.zig_backend != .stage2_c and comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .sha, .avx2 })) {
242242 var x: v4u32 = [_]u32{ d.s[5], d.s[4], d.s[1], d.s[0] };
243243 var y: v4u32 = [_]u32{ d.s[7], d.s[6], d.s[3], d.s[2] };
244244 const s_v = @as(*[16]v4u32, @ptrCast(&s));
lib/std/treap.zig-2
......@@ -350,8 +350,6 @@ const TestTreap = Treap(u64, std.math.order);
350350const TestNode = TestTreap.Node;
351351
352352test "std.Treap: insert, find, replace, remove" {
353 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
354
355353 var treap = TestTreap{};
356354 var nodes: [10]TestNode = undefined;
357355
src/arch/x86_64/CodeGen.zig+2
......@@ -4740,6 +4740,7 @@ fn airArrayElemVal(self: *Self, inst: Air.Inst.Index) !void {
47404740
47414741 // TODO we could allocate register here, but need to expect addr register and potentially
47424742 // offset register.
4743 try self.spillEflagsIfOccupied();
47434744 const dst_mcv = try self.allocRegOrMem(inst, false);
47444745 try self.genBinOpMir(
47454746 .{ ._, .add },
......@@ -14884,6 +14885,7 @@ fn truncateRegister(self: *Self, ty: Type, reg: Register) !void {
1488414885 .bits = @intCast(ty.bitSize(mod)),
1488514886 };
1488614887 const max_reg_bit_width = Register.rax.bitSize();
14888 try self.spillEflagsIfOccupied();
1488714889 switch (int_info.signedness) {
1488814890 .signed => {
1488914891 const shift: u6 = @intCast(max_reg_bit_width - int_info.bits);