| author | |
| committer | |
| log | 8f69e977f16d55539d55e8c84852a7c1c6a8cdf3 |
| tree | 05ea1ff0469413016fa03d9776b72e786dcc82cc |
| parent | fbe8c8938b4efef12a2aa992eec3c947e5f65e70 |
* `@clz`
* `@ctz`
* `@popCount`
* `@byteSwap`
* `@bitReverse`
* various encodings used by std48 files changed, 545 insertions(+), 541 deletions(-)
lib/compiler_rt/addf3_test.zig-3| ... | @@ -76,9 +76,6 @@ fn test__subtf3(a: f128, b: f128, expected_hi: u64, expected_lo: u64) !void { | ... | @@ -76,9 +76,6 @@ fn test__subtf3(a: f128, b: f128, expected_hi: u64, expected_lo: u64) !void { |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | test "subtf3" { | 78 | test "subtf3" { |
| 79 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 80 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 81 | |||
| 82 | // qNaN - any = qNaN | 79 | // qNaN - any = qNaN |
| 83 | try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); | 80 | try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); |
| 84 | 81 |
lib/compiler_rt/divtf3_test.zig-4| ... | @@ -1,5 +1,4 @@ | ... | @@ -1,5 +1,4 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 3 | const math = std.math; | 2 | const math = std.math; |
| 4 | const testing = std.testing; | 3 | const testing = std.testing; |
| 5 | 4 | ||
| ... | @@ -31,9 +30,6 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void { | ... | @@ -31,9 +30,6 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void { |
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | test "divtf3" { | 32 | test "divtf3" { |
| 34 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 35 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 36 | |||
| 37 | // NaN / any = NaN | 33 | // NaN / any = NaN |
| 38 | try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0); | 34 | try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0); |
| 39 | // inf / any(except inf and nan) = inf | 35 | // inf / any(except inf and nan) = inf |
lib/compiler_rt/float_from_int_test.zig-22| ... | @@ -1,5 +1,4 @@ | ... | @@ -1,5 +1,4 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 3 | const testing = std.testing; | 2 | const testing = std.testing; |
| 4 | const math = std.math; | 3 | const math = std.math; |
| 5 | 4 | ||
| ... | @@ -126,9 +125,6 @@ fn test__floatuntisf(a: u128, expected: f32) !void { | ... | @@ -126,9 +125,6 @@ fn test__floatuntisf(a: u128, expected: f32) !void { |
| 126 | } | 125 | } |
| 127 | 126 | ||
| 128 | test "floattisf" { | 127 | test "floattisf" { |
| 129 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 130 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 131 | |||
| 132 | try test__floattisf(0, 0.0); | 128 | try test__floattisf(0, 0.0); |
| 133 | 129 | ||
| 134 | try test__floattisf(1, 1.0); | 130 | try test__floattisf(1, 1.0); |
| ... | @@ -175,9 +171,6 @@ test "floattisf" { | ... | @@ -175,9 +171,6 @@ test "floattisf" { |
| 175 | } | 171 | } |
| 176 | 172 | ||
| 177 | test "floatuntisf" { | 173 | test "floatuntisf" { |
| 178 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 179 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 180 | |||
| 181 | try test__floatuntisf(0, 0.0); | 174 | try test__floatuntisf(0, 0.0); |
| 182 | 175 | ||
| 183 | try test__floatuntisf(1, 1.0); | 176 | try test__floatuntisf(1, 1.0); |
| ... | @@ -374,9 +367,6 @@ fn test__floatuntidf(a: u128, expected: f64) !void { | ... | @@ -374,9 +367,6 @@ fn test__floatuntidf(a: u128, expected: f64) !void { |
| 374 | } | 367 | } |
| 375 | 368 | ||
| 376 | test "floattidf" { | 369 | test "floattidf" { |
| 377 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 378 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 379 | |||
| 380 | try test__floattidf(0, 0.0); | 370 | try test__floattidf(0, 0.0); |
| 381 | 371 | ||
| 382 | try test__floattidf(1, 1.0); | 372 | try test__floattidf(1, 1.0); |
| ... | @@ -447,9 +437,6 @@ test "floattidf" { | ... | @@ -447,9 +437,6 @@ test "floattidf" { |
| 447 | } | 437 | } |
| 448 | 438 | ||
| 449 | test "floatuntidf" { | 439 | test "floatuntidf" { |
| 450 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 451 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 452 | |||
| 453 | try test__floatuntidf(0, 0.0); | 440 | try test__floatuntidf(0, 0.0); |
| 454 | 441 | ||
| 455 | try test__floatuntidf(1, 1.0); | 442 | try test__floatuntidf(1, 1.0); |
| ... | @@ -595,9 +582,6 @@ test "floatditf" { | ... | @@ -595,9 +582,6 @@ test "floatditf" { |
| 595 | } | 582 | } |
| 596 | 583 | ||
| 597 | test "floatunditf" { | 584 | test "floatunditf" { |
| 598 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 599 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 600 | |||
| 601 | try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000); | 585 | try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000); |
| 602 | try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000); | 586 | try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000); |
| 603 | try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0); | 587 | try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0); |
| ... | @@ -619,9 +603,6 @@ fn test__floatuntitf(a: u128, expected: f128) !void { | ... | @@ -619,9 +603,6 @@ fn test__floatuntitf(a: u128, expected: f128) !void { |
| 619 | } | 603 | } |
| 620 | 604 | ||
| 621 | test "floattitf" { | 605 | test "floattitf" { |
| 622 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 623 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 624 | |||
| 625 | try test__floattitf(0, 0.0); | 606 | try test__floattitf(0, 0.0); |
| 626 | 607 | ||
| 627 | try test__floattitf(1, 1.0); | 608 | try test__floattitf(1, 1.0); |
| ... | @@ -704,9 +685,6 @@ test "floattitf" { | ... | @@ -704,9 +685,6 @@ test "floattitf" { |
| 704 | } | 685 | } |
| 705 | 686 | ||
| 706 | test "floatuntitf" { | 687 | test "floatuntitf" { |
| 707 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 708 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 709 | |||
| 710 | try test__floatuntitf(0, 0.0); | 688 | try test__floatuntitf(0, 0.0); |
| 711 | 689 | ||
| 712 | try test__floatuntitf(1, 1.0); | 690 | try test__floatuntitf(1, 1.0); |
lib/compiler_rt/fma.zig-5| ... | @@ -6,10 +6,8 @@ | ... | @@ -6,10 +6,8 @@ |
| 6 | //! https://git.musl-libc.org/cgit/musl/tree/src/math/fma.c | 6 | //! https://git.musl-libc.org/cgit/musl/tree/src/math/fma.c |
| 7 | 7 | ||
| 8 | const std = @import("std"); | 8 | const std = @import("std"); |
| 9 | const builtin = @import("builtin"); | ||
| 10 | const math = std.math; | 9 | const math = std.math; |
| 11 | const expect = std.testing.expect; | 10 | const expect = std.testing.expect; |
| 12 | const arch = builtin.cpu.arch; | ||
| 13 | const common = @import("common.zig"); | 11 | const common = @import("common.zig"); |
| 14 | 12 | ||
| 15 | pub const panic = common.panic; | 13 | pub const panic = common.panic; |
| ... | @@ -343,9 +341,6 @@ test "64" { | ... | @@ -343,9 +341,6 @@ test "64" { |
| 343 | } | 341 | } |
| 344 | 342 | ||
| 345 | test "128" { | 343 | test "128" { |
| 346 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 347 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 348 | |||
| 349 | const epsilon = 0.000001; | 344 | const epsilon = 0.000001; |
| 350 | 345 | ||
| 351 | try expect(math.approxEqAbs(f128, fmaq(0.0, 5.0, 9.124), 9.124, epsilon)); | 346 | try expect(math.approxEqAbs(f128, fmaq(0.0, 5.0, 9.124), 9.124, epsilon)); |
lib/compiler_rt/fmodx_test.zig+1-1| ... | @@ -24,7 +24,7 @@ fn test_fmodx_infs() !void { | ... | @@ -24,7 +24,7 @@ fn test_fmodx_infs() !void { |
| 24 | 24 | ||
| 25 | test "fmodx" { | 25 | test "fmodx" { |
| 26 | if (builtin.zig_backend == .stage2_x86_64 and | 26 | if (builtin.zig_backend == .stage2_x86_64 and |
| 27 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | 27 | !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .lzcnt)) return error.SkipZigTest; |
| 28 | 28 | ||
| 29 | try test_fmodx(6.4, 4.0, 2.4); | 29 | try test_fmodx(6.4, 4.0, 2.4); |
| 30 | try test_fmodx(6.4, -4.0, 2.4); | 30 | try test_fmodx(6.4, -4.0, 2.4); |
lib/compiler_rt/mulf3_test.zig-4| ... | @@ -3,7 +3,6 @@ | ... | @@ -3,7 +3,6 @@ |
| 3 | // https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c | 3 | // https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c |
| 4 | 4 | ||
| 5 | const std = @import("std"); | 5 | const std = @import("std"); |
| 6 | const builtin = @import("builtin"); | ||
| 7 | const math = std.math; | 6 | const math = std.math; |
| 8 | const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64); | 7 | const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64); |
| 9 | const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64); | 8 | const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64); |
| ... | @@ -49,9 +48,6 @@ fn makeNaN128(rand: u64) f128 { | ... | @@ -49,9 +48,6 @@ fn makeNaN128(rand: u64) f128 { |
| 49 | return @bitCast(int_result); | 48 | return @bitCast(int_result); |
| 50 | } | 49 | } |
| 51 | test "multf3" { | 50 | test "multf3" { |
| 52 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 53 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 54 | |||
| 55 | // qNaN * any = qNaN | 51 | // qNaN * any = qNaN |
| 56 | try test__multf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); | 52 | try test__multf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); |
| 57 | 53 |
lib/compiler_rt/udivmodei4.zig+2-4| ... | @@ -129,10 +129,8 @@ pub fn __umodei4(r_p: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) | ... | @@ -129,10 +129,8 @@ pub fn __umodei4(r_p: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | test "__udivei4/__umodei4" { | 131 | test "__udivei4/__umodei4" { |
| 132 | switch (builtin.zig_backend) { | 132 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 133 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | 133 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 134 | else => {}, | ||
| 135 | } | ||
| 136 | 134 | ||
| 137 | const RndGen = std.rand.DefaultPrng; | 135 | const RndGen = std.rand.DefaultPrng; |
| 138 | var rnd = RndGen.init(42); | 136 | var rnd = RndGen.init(42); |
lib/std/Build/Cache.zig-8| ... | @@ -1007,8 +1007,6 @@ test "cache file and then recall it" { | ... | @@ -1007,8 +1007,6 @@ test "cache file and then recall it" { |
| 1007 | return error.SkipZigTest; | 1007 | return error.SkipZigTest; |
| 1008 | } | 1008 | } |
| 1009 | 1009 | ||
| 1010 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1011 | |||
| 1012 | var tmp = testing.tmpDir(.{}); | 1010 | var tmp = testing.tmpDir(.{}); |
| 1013 | defer tmp.cleanup(); | 1011 | defer tmp.cleanup(); |
| 1014 | 1012 | ||
| ... | @@ -1075,8 +1073,6 @@ test "check that changing a file makes cache fail" { | ... | @@ -1075,8 +1073,6 @@ test "check that changing a file makes cache fail" { |
| 1075 | return error.SkipZigTest; | 1073 | return error.SkipZigTest; |
| 1076 | } | 1074 | } |
| 1077 | 1075 | ||
| 1078 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1079 | |||
| 1080 | var tmp = testing.tmpDir(.{}); | 1076 | var tmp = testing.tmpDir(.{}); |
| 1081 | defer tmp.cleanup(); | 1077 | defer tmp.cleanup(); |
| 1082 | 1078 | ||
| ... | @@ -1151,8 +1147,6 @@ test "no file inputs" { | ... | @@ -1151,8 +1147,6 @@ test "no file inputs" { |
| 1151 | return error.SkipZigTest; | 1147 | return error.SkipZigTest; |
| 1152 | } | 1148 | } |
| 1153 | 1149 | ||
| 1154 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1155 | |||
| 1156 | var tmp = testing.tmpDir(.{}); | 1150 | var tmp = testing.tmpDir(.{}); |
| 1157 | defer tmp.cleanup(); | 1151 | defer tmp.cleanup(); |
| 1158 | 1152 | ||
| ... | @@ -1201,8 +1195,6 @@ test "Manifest with files added after initial hash work" { | ... | @@ -1201,8 +1195,6 @@ test "Manifest with files added after initial hash work" { |
| 1201 | return error.SkipZigTest; | 1195 | return error.SkipZigTest; |
| 1202 | } | 1196 | } |
| 1203 | 1197 | ||
| 1204 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1205 | |||
| 1206 | var tmp = testing.tmpDir(.{}); | 1198 | var tmp = testing.tmpDir(.{}); |
| 1207 | defer tmp.cleanup(); | 1199 | defer tmp.cleanup(); |
| 1208 | 1200 |
lib/std/Thread/Condition.zig+2-2| ... | @@ -324,6 +324,8 @@ test "Condition - wait and signal" { | ... | @@ -324,6 +324,8 @@ test "Condition - wait and signal" { |
| 324 | return error.SkipZigTest; | 324 | return error.SkipZigTest; |
| 325 | } | 325 | } |
| 326 | 326 | ||
| 327 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 328 | |||
| 327 | const num_threads = 4; | 329 | const num_threads = 4; |
| 328 | 330 | ||
| 329 | const MultiWait = struct { | 331 | const MultiWait = struct { |
| ... | @@ -369,8 +371,6 @@ test "Condition - signal" { | ... | @@ -369,8 +371,6 @@ test "Condition - signal" { |
| 369 | return error.SkipZigTest; | 371 | return error.SkipZigTest; |
| 370 | } | 372 | } |
| 371 | 373 | ||
| 372 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 373 | |||
| 374 | const num_threads = 4; | 374 | const num_threads = 4; |
| 375 | 375 | ||
| 376 | const SignalTest = struct { | 376 | const SignalTest = struct { |
lib/std/Thread/Semaphore.zig+2| ... | @@ -39,6 +39,8 @@ test "Thread.Semaphore" { | ... | @@ -39,6 +39,8 @@ test "Thread.Semaphore" { |
| 39 | return error.SkipZigTest; | 39 | return error.SkipZigTest; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 43 | |||
| 42 | const TestContext = struct { | 44 | const TestContext = struct { |
| 43 | sem: *Semaphore, | 45 | sem: *Semaphore, |
| 44 | n: *i32, | 46 | n: *i32, |
lib/std/base64.zig-2| ... | @@ -363,8 +363,6 @@ test "base64" { | ... | @@ -363,8 +363,6 @@ test "base64" { |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | test "base64 padding dest overflow" { | 365 | test "base64 padding dest overflow" { |
| 366 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 367 | |||
| 368 | const input = "foo"; | 366 | const input = "foo"; |
| 369 | 367 | ||
| 370 | var expect: [128]u8 = undefined; | 368 | var expect: [128]u8 = undefined; |
lib/std/compress/deflate/huffman_code.zig-2| ... | @@ -360,8 +360,6 @@ fn byFreq(context: void, a: LiteralNode, b: LiteralNode) bool { | ... | @@ -360,8 +360,6 @@ fn byFreq(context: void, a: LiteralNode, b: LiteralNode) bool { |
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | test "generate a Huffman code from an array of frequencies" { | 362 | test "generate a Huffman code from an array of frequencies" { |
| 363 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 364 | |||
| 365 | var freqs: [19]u16 = [_]u16{ | 363 | var freqs: [19]u16 = [_]u16{ |
| 366 | 8, // 0 | 364 | 8, // 0 |
| 367 | 1, // 1 | 365 | 1, // 1 |
lib/std/compress/gzip.zig-2| ... | @@ -174,8 +174,6 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void { | ... | @@ -174,8 +174,6 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void { |
| 174 | // https://tools.ietf.org/rfc/rfc1952.txt length=25037 bytes | 174 | // https://tools.ietf.org/rfc/rfc1952.txt length=25037 bytes |
| 175 | // SHA256=164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67 | 175 | // SHA256=164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67 |
| 176 | test "compressed data" { | 176 | test "compressed data" { |
| 177 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 178 | |||
| 179 | try testReader( | 177 | try testReader( |
| 180 | @embedFile("testdata/rfc1952.txt.gz"), | 178 | @embedFile("testdata/rfc1952.txt.gz"), |
| 181 | @embedFile("testdata/rfc1952.txt"), | 179 | @embedFile("testdata/rfc1952.txt"), |
lib/std/compress/zlib.zig-2| ... | @@ -199,8 +199,6 @@ fn testDecompress(data: []const u8, expected: []const u8) !void { | ... | @@ -199,8 +199,6 @@ fn testDecompress(data: []const u8, expected: []const u8) !void { |
| 199 | // https://tools.ietf.org/rfc/rfc1951.txt length=36944 bytes | 199 | // https://tools.ietf.org/rfc/rfc1951.txt length=36944 bytes |
| 200 | // SHA256=5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009 | 200 | // SHA256=5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009 |
| 201 | test "compressed data" { | 201 | test "compressed data" { |
| 202 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 203 | |||
| 204 | const rfc1951_txt = @embedFile("testdata/rfc1951.txt"); | 202 | const rfc1951_txt = @embedFile("testdata/rfc1951.txt"); |
| 205 | 203 | ||
| 206 | // Compressed with compression level = 0 | 204 | // Compressed with compression level = 0 |
lib/std/crypto.zig-2| ... | @@ -314,8 +314,6 @@ test "CSPRNG" { | ... | @@ -314,8 +314,6 @@ test "CSPRNG" { |
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | test "issue #4532: no index out of bounds" { | 316 | test "issue #4532: no index out of bounds" { |
| 317 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 318 | |||
| 319 | const types = [_]type{ | 317 | const types = [_]type{ |
| 320 | hash.Md5, | 318 | hash.Md5, |
| 321 | hash.Sha1, | 319 | hash.Sha1, |
lib/std/crypto/25519/x25519.zig-4| ... | @@ -137,8 +137,6 @@ test "x25519 rfc7748 one iteration" { | ... | @@ -137,8 +137,6 @@ test "x25519 rfc7748 one iteration" { |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | test "x25519 rfc7748 1,000 iterations" { | 139 | test "x25519 rfc7748 1,000 iterations" { |
| 140 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 141 | |||
| 142 | // These iteration tests are slow so we always skip them. Results have been verified. | 140 | // These iteration tests are slow so we always skip them. Results have been verified. |
| 143 | if (true) { | 141 | if (true) { |
| 144 | return error.SkipZigTest; | 142 | return error.SkipZigTest; |
| ... | @@ -161,8 +159,6 @@ test "x25519 rfc7748 1,000 iterations" { | ... | @@ -161,8 +159,6 @@ test "x25519 rfc7748 1,000 iterations" { |
| 161 | } | 159 | } |
| 162 | 160 | ||
| 163 | test "x25519 rfc7748 1,000,000 iterations" { | 161 | test "x25519 rfc7748 1,000,000 iterations" { |
| 164 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 165 | |||
| 166 | if (true) { | 162 | if (true) { |
| 167 | return error.SkipZigTest; | 163 | return error.SkipZigTest; |
| 168 | } | 164 | } |
lib/std/crypto/aegis.zig-15| ... | @@ -17,7 +17,6 @@ | ... | @@ -17,7 +17,6 @@ |
| 17 | //! https://datatracker.ietf.org/doc/draft-irtf-cfrg-aegis-aead/ | 17 | //! https://datatracker.ietf.org/doc/draft-irtf-cfrg-aegis-aead/ |
| 18 | 18 | ||
| 19 | const std = @import("std"); | 19 | const std = @import("std"); |
| 20 | const builtin = @import("builtin"); | ||
| 21 | const crypto = std.crypto; | 20 | const crypto = std.crypto; |
| 22 | const mem = std.mem; | 21 | const mem = std.mem; |
| 23 | const assert = std.debug.assert; | 22 | const assert = std.debug.assert; |
| ... | @@ -514,8 +513,6 @@ const htest = @import("test.zig"); | ... | @@ -514,8 +513,6 @@ const htest = @import("test.zig"); |
| 514 | const testing = std.testing; | 513 | const testing = std.testing; |
| 515 | 514 | ||
| 516 | test "Aegis128L test vector 1" { | 515 | test "Aegis128L test vector 1" { |
| 517 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 518 | |||
| 519 | const key: [Aegis128L.key_length]u8 = [_]u8{ 0x10, 0x01 } ++ [_]u8{0x00} ** 14; | 516 | const key: [Aegis128L.key_length]u8 = [_]u8{ 0x10, 0x01 } ++ [_]u8{0x00} ** 14; |
| 520 | const nonce: [Aegis128L.nonce_length]u8 = [_]u8{ 0x10, 0x00, 0x02 } ++ [_]u8{0x00} ** 13; | 517 | const nonce: [Aegis128L.nonce_length]u8 = [_]u8{ 0x10, 0x00, 0x02 } ++ [_]u8{0x00} ** 13; |
| 521 | const ad = [8]u8{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; | 518 | const ad = [8]u8{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; |
| ... | @@ -539,8 +536,6 @@ test "Aegis128L test vector 1" { | ... | @@ -539,8 +536,6 @@ test "Aegis128L test vector 1" { |
| 539 | } | 536 | } |
| 540 | 537 | ||
| 541 | test "Aegis128L test vector 2" { | 538 | test "Aegis128L test vector 2" { |
| 542 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 543 | |||
| 544 | const key: [Aegis128L.key_length]u8 = [_]u8{0x00} ** 16; | 539 | const key: [Aegis128L.key_length]u8 = [_]u8{0x00} ** 16; |
| 545 | const nonce: [Aegis128L.nonce_length]u8 = [_]u8{0x00} ** 16; | 540 | const nonce: [Aegis128L.nonce_length]u8 = [_]u8{0x00} ** 16; |
| 546 | const ad = [_]u8{}; | 541 | const ad = [_]u8{}; |
| ... | @@ -558,8 +553,6 @@ test "Aegis128L test vector 2" { | ... | @@ -558,8 +553,6 @@ test "Aegis128L test vector 2" { |
| 558 | } | 553 | } |
| 559 | 554 | ||
| 560 | test "Aegis128L test vector 3" { | 555 | test "Aegis128L test vector 3" { |
| 561 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 562 | |||
| 563 | const key: [Aegis128L.key_length]u8 = [_]u8{0x00} ** 16; | 556 | const key: [Aegis128L.key_length]u8 = [_]u8{0x00} ** 16; |
| 564 | const nonce: [Aegis128L.nonce_length]u8 = [_]u8{0x00} ** 16; | 557 | const nonce: [Aegis128L.nonce_length]u8 = [_]u8{0x00} ** 16; |
| 565 | const ad = [_]u8{}; | 558 | const ad = [_]u8{}; |
| ... | @@ -576,8 +569,6 @@ test "Aegis128L test vector 3" { | ... | @@ -576,8 +569,6 @@ test "Aegis128L test vector 3" { |
| 576 | } | 569 | } |
| 577 | 570 | ||
| 578 | test "Aegis256 test vector 1" { | 571 | test "Aegis256 test vector 1" { |
| 579 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 580 | |||
| 581 | const key: [Aegis256.key_length]u8 = [_]u8{ 0x10, 0x01 } ++ [_]u8{0x00} ** 30; | 572 | const key: [Aegis256.key_length]u8 = [_]u8{ 0x10, 0x01 } ++ [_]u8{0x00} ** 30; |
| 582 | const nonce: [Aegis256.nonce_length]u8 = [_]u8{ 0x10, 0x00, 0x02 } ++ [_]u8{0x00} ** 29; | 573 | const nonce: [Aegis256.nonce_length]u8 = [_]u8{ 0x10, 0x00, 0x02 } ++ [_]u8{0x00} ** 29; |
| 583 | const ad = [8]u8{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; | 574 | const ad = [8]u8{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; |
| ... | @@ -601,8 +592,6 @@ test "Aegis256 test vector 1" { | ... | @@ -601,8 +592,6 @@ test "Aegis256 test vector 1" { |
| 601 | } | 592 | } |
| 602 | 593 | ||
| 603 | test "Aegis256 test vector 2" { | 594 | test "Aegis256 test vector 2" { |
| 604 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 605 | |||
| 606 | const key: [Aegis256.key_length]u8 = [_]u8{0x00} ** 32; | 595 | const key: [Aegis256.key_length]u8 = [_]u8{0x00} ** 32; |
| 607 | const nonce: [Aegis256.nonce_length]u8 = [_]u8{0x00} ** 32; | 596 | const nonce: [Aegis256.nonce_length]u8 = [_]u8{0x00} ** 32; |
| 608 | const ad = [_]u8{}; | 597 | const ad = [_]u8{}; |
| ... | @@ -620,8 +609,6 @@ test "Aegis256 test vector 2" { | ... | @@ -620,8 +609,6 @@ test "Aegis256 test vector 2" { |
| 620 | } | 609 | } |
| 621 | 610 | ||
| 622 | test "Aegis256 test vector 3" { | 611 | test "Aegis256 test vector 3" { |
| 623 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 624 | |||
| 625 | const key: [Aegis256.key_length]u8 = [_]u8{0x00} ** 32; | 612 | const key: [Aegis256.key_length]u8 = [_]u8{0x00} ** 32; |
| 626 | const nonce: [Aegis256.nonce_length]u8 = [_]u8{0x00} ** 32; | 613 | const nonce: [Aegis256.nonce_length]u8 = [_]u8{0x00} ** 32; |
| 627 | const ad = [_]u8{}; | 614 | const ad = [_]u8{}; |
| ... | @@ -638,8 +625,6 @@ test "Aegis256 test vector 3" { | ... | @@ -638,8 +625,6 @@ test "Aegis256 test vector 3" { |
| 638 | } | 625 | } |
| 639 | 626 | ||
| 640 | test "Aegis MAC" { | 627 | test "Aegis MAC" { |
| 641 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 642 | |||
| 643 | const key = [_]u8{0x00} ** Aegis128LMac.key_length; | 628 | const key = [_]u8{0x00} ** Aegis128LMac.key_length; |
| 644 | var msg: [64]u8 = undefined; | 629 | var msg: [64]u8 = undefined; |
| 645 | for (&msg, 0..) |*m, i| { | 630 | for (&msg, 0..) |*m, i| { |
lib/std/crypto/aes.zig+1-9| ... | @@ -6,7 +6,7 @@ const has_aesni = std.Target.x86.featureSetHas(builtin.cpu.features, .aes); | ... | @@ -6,7 +6,7 @@ const has_aesni = std.Target.x86.featureSetHas(builtin.cpu.features, .aes); |
| 6 | const has_avx = std.Target.x86.featureSetHas(builtin.cpu.features, .avx); | 6 | const has_avx = std.Target.x86.featureSetHas(builtin.cpu.features, .avx); |
| 7 | const has_armaes = std.Target.aarch64.featureSetHas(builtin.cpu.features, .aes); | 7 | const has_armaes = std.Target.aarch64.featureSetHas(builtin.cpu.features, .aes); |
| 8 | // C backend doesn't currently support passing vectors to inline asm. | 8 | // C backend doesn't currently support passing vectors to inline asm. |
| 9 | const impl = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and has_aesni and has_avx) impl: { | 9 | const impl = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and builtin.zig_backend != .stage2_x86_64 and has_aesni and has_avx) impl: { |
| 10 | break :impl @import("aes/aesni.zig"); | 10 | break :impl @import("aes/aesni.zig"); |
| 11 | } else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes) | 11 | } else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes) |
| 12 | impl: { | 12 | impl: { |
| ... | @@ -55,8 +55,6 @@ test "ctr" { | ... | @@ -55,8 +55,6 @@ test "ctr" { |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | test "encrypt" { | 57 | test "encrypt" { |
| 58 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 59 | |||
| 60 | // Appendix B | 58 | // Appendix B |
| 61 | { | 59 | { |
| 62 | const key = [_]u8{ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; | 60 | const key = [_]u8{ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; |
| ... | @@ -86,8 +84,6 @@ test "encrypt" { | ... | @@ -86,8 +84,6 @@ test "encrypt" { |
| 86 | } | 84 | } |
| 87 | 85 | ||
| 88 | test "decrypt" { | 86 | test "decrypt" { |
| 89 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 90 | |||
| 91 | // Appendix B | 87 | // Appendix B |
| 92 | { | 88 | { |
| 93 | const key = [_]u8{ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; | 89 | const key = [_]u8{ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; |
| ... | @@ -117,8 +113,6 @@ test "decrypt" { | ... | @@ -117,8 +113,6 @@ test "decrypt" { |
| 117 | } | 113 | } |
| 118 | 114 | ||
| 119 | test "expand 128-bit key" { | 115 | test "expand 128-bit key" { |
| 120 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 121 | |||
| 122 | const key = [_]u8{ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; | 116 | const key = [_]u8{ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; |
| 123 | const exp_enc = [_]*const [32:0]u8{ | 117 | const exp_enc = [_]*const [32:0]u8{ |
| 124 | "2b7e151628aed2a6abf7158809cf4f3c", "a0fafe1788542cb123a339392a6c7605", "f2c295f27a96b9435935807a7359f67f", "3d80477d4716fe3e1e237e446d7a883b", "ef44a541a8525b7fb671253bdb0bad00", "d4d1c6f87c839d87caf2b8bc11f915bc", "6d88a37a110b3efddbf98641ca0093fd", "4e54f70e5f5fc9f384a64fb24ea6dc4f", "ead27321b58dbad2312bf5607f8d292f", "ac7766f319fadc2128d12941575c006e", "d014f9a8c9ee2589e13f0cc8b6630ca6", | 118 | "2b7e151628aed2a6abf7158809cf4f3c", "a0fafe1788542cb123a339392a6c7605", "f2c295f27a96b9435935807a7359f67f", "3d80477d4716fe3e1e237e446d7a883b", "ef44a541a8525b7fb671253bdb0bad00", "d4d1c6f87c839d87caf2b8bc11f915bc", "6d88a37a110b3efddbf98641ca0093fd", "4e54f70e5f5fc9f384a64fb24ea6dc4f", "ead27321b58dbad2312bf5607f8d292f", "ac7766f319fadc2128d12941575c006e", "d014f9a8c9ee2589e13f0cc8b6630ca6", |
| ... | @@ -141,8 +135,6 @@ test "expand 128-bit key" { | ... | @@ -141,8 +135,6 @@ test "expand 128-bit key" { |
| 141 | } | 135 | } |
| 142 | 136 | ||
| 143 | test "expand 256-bit key" { | 137 | test "expand 256-bit key" { |
| 144 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 145 | |||
| 146 | const key = [_]u8{ | 138 | const key = [_]u8{ |
| 147 | 0x60, 0x3d, 0xeb, 0x10, | 139 | 0x60, 0x3d, 0xeb, 0x10, |
| 148 | 0x15, 0xca, 0x71, 0xbe, | 140 | 0x15, 0xca, 0x71, 0xbe, |
lib/std/crypto/aes_ocb.zig+8-16| ... | @@ -261,10 +261,8 @@ inline fn xorWith(x: *Block, y: Block) void { | ... | @@ -261,10 +261,8 @@ inline fn xorWith(x: *Block, y: Block) void { |
| 261 | const hexToBytes = std.fmt.hexToBytes; | 261 | const hexToBytes = std.fmt.hexToBytes; |
| 262 | 262 | ||
| 263 | test "AesOcb test vector 1" { | 263 | test "AesOcb test vector 1" { |
| 264 | switch (builtin.zig_backend) { | 264 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 265 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | 265 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 266 | else => {}, | ||
| 267 | } | ||
| 268 | 266 | ||
| 269 | var k: [Aes128Ocb.key_length]u8 = undefined; | 267 | var k: [Aes128Ocb.key_length]u8 = undefined; |
| 270 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; | 268 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; |
| ... | @@ -283,10 +281,8 @@ test "AesOcb test vector 1" { | ... | @@ -283,10 +281,8 @@ test "AesOcb test vector 1" { |
| 283 | } | 281 | } |
| 284 | 282 | ||
| 285 | test "AesOcb test vector 2" { | 283 | test "AesOcb test vector 2" { |
| 286 | switch (builtin.zig_backend) { | 284 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 287 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | 285 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 288 | else => {}, | ||
| 289 | } | ||
| 290 | 286 | ||
| 291 | var k: [Aes128Ocb.key_length]u8 = undefined; | 287 | var k: [Aes128Ocb.key_length]u8 = undefined; |
| 292 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; | 288 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; |
| ... | @@ -307,10 +303,8 @@ test "AesOcb test vector 2" { | ... | @@ -307,10 +303,8 @@ test "AesOcb test vector 2" { |
| 307 | } | 303 | } |
| 308 | 304 | ||
| 309 | test "AesOcb test vector 3" { | 305 | test "AesOcb test vector 3" { |
| 310 | switch (builtin.zig_backend) { | 306 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 311 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | 307 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 312 | else => {}, | ||
| 313 | } | ||
| 314 | 308 | ||
| 315 | var k: [Aes128Ocb.key_length]u8 = undefined; | 309 | var k: [Aes128Ocb.key_length]u8 = undefined; |
| 316 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; | 310 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; |
| ... | @@ -334,10 +328,8 @@ test "AesOcb test vector 3" { | ... | @@ -334,10 +328,8 @@ test "AesOcb test vector 3" { |
| 334 | } | 328 | } |
| 335 | 329 | ||
| 336 | test "AesOcb test vector 4" { | 330 | test "AesOcb test vector 4" { |
| 337 | switch (builtin.zig_backend) { | 331 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 338 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | 332 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 339 | else => {}, | ||
| 340 | } | ||
| 341 | 333 | ||
| 342 | var k: [Aes128Ocb.key_length]u8 = undefined; | 334 | var k: [Aes128Ocb.key_length]u8 = undefined; |
| 343 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; | 335 | var nonce: [Aes128Ocb.nonce_length]u8 = undefined; |
lib/std/crypto/ghash_polyval.zig-2| ... | @@ -476,8 +476,6 @@ test "ghash2" { | ... | @@ -476,8 +476,6 @@ test "ghash2" { |
| 476 | } | 476 | } |
| 477 | 477 | ||
| 478 | test "polyval" { | 478 | test "polyval" { |
| 479 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 480 | |||
| 481 | const key = [_]u8{0x42} ** 16; | 479 | const key = [_]u8{0x42} ** 16; |
| 482 | const m = [_]u8{0x69} ** 256; | 480 | const m = [_]u8{0x69} ** 256; |
| 483 | 481 |
lib/std/crypto/kyber_d00.zig-2| ... | @@ -1667,8 +1667,6 @@ test "Test happy flow" { | ... | @@ -1667,8 +1667,6 @@ test "Test happy flow" { |
| 1667 | const sha2 = crypto.hash.sha2; | 1667 | const sha2 = crypto.hash.sha2; |
| 1668 | 1668 | ||
| 1669 | test "NIST KAT test" { | 1669 | test "NIST KAT test" { |
| 1670 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1671 | |||
| 1672 | inline for (.{ | 1670 | inline for (.{ |
| 1673 | .{ Kyber512, "e9c2bd37133fcb40772f81559f14b1f58dccd1c816701be9ba6214d43baf4547" }, | 1671 | .{ Kyber512, "e9c2bd37133fcb40772f81559f14b1f58dccd1c816701be9ba6214d43baf4547" }, |
| 1674 | .{ Kyber1024, "89248f2f33f7f4f7051729111f3049c409a933ec904aedadf035f30fa5646cd5" }, | 1672 | .{ Kyber1024, "89248f2f33f7f4f7051729111f3049c409a933ec904aedadf035f30fa5646cd5" }, |
lib/std/fs.zig+6-6| ... | @@ -3244,15 +3244,15 @@ fn copy_file(fd_in: os.fd_t, fd_out: os.fd_t, maybe_size: ?u64) CopyFileRawError | ... | @@ -3244,15 +3244,15 @@ fn copy_file(fd_in: os.fd_t, fd_out: os.fd_t, maybe_size: ?u64) CopyFileRawError |
| 3244 | } | 3244 | } |
| 3245 | 3245 | ||
| 3246 | test { | 3246 | test { |
| 3247 | if (builtin.zig_backend != .stage2_x86_64) { | 3247 | if (builtin.os.tag != .wasi) { |
| 3248 | if (builtin.os.tag != .wasi) { | 3248 | _ = &makeDirAbsolute; |
| 3249 | _ = &makeDirAbsolute; | 3249 | _ = &makeDirAbsoluteZ; |
| 3250 | _ = &makeDirAbsoluteZ; | 3250 | _ = &copyFileAbsolute; |
| 3251 | _ = &copyFileAbsolute; | 3251 | if (builtin.zig_backend != .stage2_x86_64) { |
| 3252 | _ = &updateFileAbsolute; | 3252 | _ = &updateFileAbsolute; |
| 3253 | } | 3253 | } |
| 3254 | _ = &Dir.copyFile; | ||
| 3255 | } | 3254 | } |
| 3255 | _ = &Dir.copyFile; | ||
| 3256 | _ = @import("fs/test.zig"); | 3256 | _ = @import("fs/test.zig"); |
| 3257 | _ = @import("fs/path.zig"); | 3257 | _ = @import("fs/path.zig"); |
| 3258 | _ = @import("fs/file.zig"); | 3258 | _ = @import("fs/file.zig"); |
lib/std/fs/test.zig-98| ... | @@ -124,8 +124,6 @@ fn testWithAllSupportedPathTypes(test_func: anytype) !void { | ... | @@ -124,8 +124,6 @@ fn testWithAllSupportedPathTypes(test_func: anytype) !void { |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | test "Dir.readLink" { | 126 | test "Dir.readLink" { |
| 127 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 128 | |||
| 129 | try testWithAllSupportedPathTypes(struct { | 127 | try testWithAllSupportedPathTypes(struct { |
| 130 | fn impl(ctx: *TestContext) !void { | 128 | fn impl(ctx: *TestContext) !void { |
| 131 | // Create some targets | 129 | // Create some targets |
| ... | @@ -163,8 +161,6 @@ fn testReadLink(dir: Dir, target_path: []const u8, symlink_path: []const u8) !vo | ... | @@ -163,8 +161,6 @@ fn testReadLink(dir: Dir, target_path: []const u8, symlink_path: []const u8) !vo |
| 163 | } | 161 | } |
| 164 | 162 | ||
| 165 | test "relative symlink to parent directory" { | 163 | test "relative symlink to parent directory" { |
| 166 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 167 | |||
| 168 | var tmp = tmpDir(.{}); | 164 | var tmp = tmpDir(.{}); |
| 169 | defer tmp.cleanup(); | 165 | defer tmp.cleanup(); |
| 170 | 166 | ||
| ... | @@ -182,8 +178,6 @@ test "relative symlink to parent directory" { | ... | @@ -182,8 +178,6 @@ test "relative symlink to parent directory" { |
| 182 | } | 178 | } |
| 183 | 179 | ||
| 184 | test "openDir" { | 180 | test "openDir" { |
| 185 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 186 | |||
| 187 | try testWithAllSupportedPathTypes(struct { | 181 | try testWithAllSupportedPathTypes(struct { |
| 188 | fn impl(ctx: *TestContext) !void { | 182 | fn impl(ctx: *TestContext) !void { |
| 189 | const allocator = ctx.arena.allocator(); | 183 | const allocator = ctx.arena.allocator(); |
| ... | @@ -202,8 +196,6 @@ test "openDir" { | ... | @@ -202,8 +196,6 @@ test "openDir" { |
| 202 | test "accessAbsolute" { | 196 | test "accessAbsolute" { |
| 203 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 197 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 204 | 198 | ||
| 205 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 206 | |||
| 207 | var tmp = tmpDir(.{}); | 199 | var tmp = tmpDir(.{}); |
| 208 | defer tmp.cleanup(); | 200 | defer tmp.cleanup(); |
| 209 | 201 | ||
| ... | @@ -222,8 +214,6 @@ test "accessAbsolute" { | ... | @@ -222,8 +214,6 @@ test "accessAbsolute" { |
| 222 | test "openDirAbsolute" { | 214 | test "openDirAbsolute" { |
| 223 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 215 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 224 | 216 | ||
| 225 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 226 | |||
| 227 | var tmp = tmpDir(.{}); | 217 | var tmp = tmpDir(.{}); |
| 228 | defer tmp.cleanup(); | 218 | defer tmp.cleanup(); |
| 229 | 219 | ||
| ... | @@ -262,8 +252,6 @@ test "openDir non-cwd parent .." { | ... | @@ -262,8 +252,6 @@ test "openDir non-cwd parent .." { |
| 262 | else => {}, | 252 | else => {}, |
| 263 | } | 253 | } |
| 264 | 254 | ||
| 265 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 266 | |||
| 267 | var tmp = tmpDir(.{}); | 255 | var tmp = tmpDir(.{}); |
| 268 | defer tmp.cleanup(); | 256 | defer tmp.cleanup(); |
| 269 | 257 | ||
| ... | @@ -285,8 +273,6 @@ test "openDir non-cwd parent .." { | ... | @@ -285,8 +273,6 @@ test "openDir non-cwd parent .." { |
| 285 | test "readLinkAbsolute" { | 273 | test "readLinkAbsolute" { |
| 286 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 274 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 287 | 275 | ||
| 288 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 289 | |||
| 290 | var tmp = tmpDir(.{}); | 276 | var tmp = tmpDir(.{}); |
| 291 | defer tmp.cleanup(); | 277 | defer tmp.cleanup(); |
| 292 | 278 | ||
| ... | @@ -337,8 +323,6 @@ fn testReadLinkAbsolute(target_path: []const u8, symlink_path: []const u8) !void | ... | @@ -337,8 +323,6 @@ fn testReadLinkAbsolute(target_path: []const u8, symlink_path: []const u8) !void |
| 337 | } | 323 | } |
| 338 | 324 | ||
| 339 | test "Dir.Iterator" { | 325 | test "Dir.Iterator" { |
| 340 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 341 | |||
| 342 | var tmp_dir = tmpIterableDir(.{}); | 326 | var tmp_dir = tmpIterableDir(.{}); |
| 343 | defer tmp_dir.cleanup(); | 327 | defer tmp_dir.cleanup(); |
| 344 | 328 | ||
| ... | @@ -369,8 +353,6 @@ test "Dir.Iterator" { | ... | @@ -369,8 +353,6 @@ test "Dir.Iterator" { |
| 369 | } | 353 | } |
| 370 | 354 | ||
| 371 | test "Dir.Iterator many entries" { | 355 | test "Dir.Iterator many entries" { |
| 372 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 373 | |||
| 374 | var tmp_dir = tmpIterableDir(.{}); | 356 | var tmp_dir = tmpIterableDir(.{}); |
| 375 | defer tmp_dir.cleanup(); | 357 | defer tmp_dir.cleanup(); |
| 376 | 358 | ||
| ... | @@ -406,8 +388,6 @@ test "Dir.Iterator many entries" { | ... | @@ -406,8 +388,6 @@ test "Dir.Iterator many entries" { |
| 406 | } | 388 | } |
| 407 | 389 | ||
| 408 | test "Dir.Iterator twice" { | 390 | test "Dir.Iterator twice" { |
| 409 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 410 | |||
| 411 | var tmp_dir = tmpIterableDir(.{}); | 391 | var tmp_dir = tmpIterableDir(.{}); |
| 412 | defer tmp_dir.cleanup(); | 392 | defer tmp_dir.cleanup(); |
| 413 | 393 | ||
| ... | @@ -441,8 +421,6 @@ test "Dir.Iterator twice" { | ... | @@ -441,8 +421,6 @@ test "Dir.Iterator twice" { |
| 441 | } | 421 | } |
| 442 | 422 | ||
| 443 | test "Dir.Iterator reset" { | 423 | test "Dir.Iterator reset" { |
| 444 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 445 | |||
| 446 | var tmp_dir = tmpIterableDir(.{}); | 424 | var tmp_dir = tmpIterableDir(.{}); |
| 447 | defer tmp_dir.cleanup(); | 425 | defer tmp_dir.cleanup(); |
| 448 | 426 | ||
| ... | @@ -479,8 +457,6 @@ test "Dir.Iterator reset" { | ... | @@ -479,8 +457,6 @@ test "Dir.Iterator reset" { |
| 479 | } | 457 | } |
| 480 | 458 | ||
| 481 | test "Dir.Iterator but dir is deleted during iteration" { | 459 | test "Dir.Iterator but dir is deleted during iteration" { |
| 482 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 483 | |||
| 484 | var tmp = std.testing.tmpDir(.{}); | 460 | var tmp = std.testing.tmpDir(.{}); |
| 485 | defer tmp.cleanup(); | 461 | defer tmp.cleanup(); |
| 486 | 462 | ||
| ... | @@ -523,8 +499,6 @@ fn contains(entries: *const std.ArrayList(IterableDir.Entry), el: IterableDir.En | ... | @@ -523,8 +499,6 @@ fn contains(entries: *const std.ArrayList(IterableDir.Entry), el: IterableDir.En |
| 523 | test "Dir.realpath smoke test" { | 499 | test "Dir.realpath smoke test" { |
| 524 | if (!comptime std.os.isGetFdPathSupportedOnTarget(builtin.os)) return error.SkipZigTest; | 500 | if (!comptime std.os.isGetFdPathSupportedOnTarget(builtin.os)) return error.SkipZigTest; |
| 525 | 501 | ||
| 526 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 527 | |||
| 528 | try testWithAllSupportedPathTypes(struct { | 502 | try testWithAllSupportedPathTypes(struct { |
| 529 | fn impl(ctx: *TestContext) !void { | 503 | fn impl(ctx: *TestContext) !void { |
| 530 | const allocator = ctx.arena.allocator(); | 504 | const allocator = ctx.arena.allocator(); |
| ... | @@ -575,8 +549,6 @@ test "Dir.realpath smoke test" { | ... | @@ -575,8 +549,6 @@ test "Dir.realpath smoke test" { |
| 575 | } | 549 | } |
| 576 | 550 | ||
| 577 | test "readAllAlloc" { | 551 | test "readAllAlloc" { |
| 578 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 579 | |||
| 580 | var tmp_dir = tmpDir(.{}); | 552 | var tmp_dir = tmpDir(.{}); |
| 581 | defer tmp_dir.cleanup(); | 553 | defer tmp_dir.cleanup(); |
| 582 | 554 | ||
| ... | @@ -613,8 +585,6 @@ test "Dir.statFile" { | ... | @@ -613,8 +585,6 @@ test "Dir.statFile" { |
| 613 | // TODO: Re-enable once https://github.com/ziglang/zig/issues/17034 is solved | 585 | // TODO: Re-enable once https://github.com/ziglang/zig/issues/17034 is solved |
| 614 | if (builtin.os.tag == .linux and builtin.link_libc and builtin.abi == .gnu) return error.SkipZigTest; | 586 | if (builtin.os.tag == .linux and builtin.link_libc and builtin.abi == .gnu) return error.SkipZigTest; |
| 615 | 587 | ||
| 616 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 617 | |||
| 618 | try testWithAllSupportedPathTypes(struct { | 588 | try testWithAllSupportedPathTypes(struct { |
| 619 | fn impl(ctx: *TestContext) !void { | 589 | fn impl(ctx: *TestContext) !void { |
| 620 | const test_file_name = try ctx.transformPath("test_file"); | 590 | const test_file_name = try ctx.transformPath("test_file"); |
| ... | @@ -630,8 +600,6 @@ test "Dir.statFile" { | ... | @@ -630,8 +600,6 @@ test "Dir.statFile" { |
| 630 | } | 600 | } |
| 631 | 601 | ||
| 632 | test "directory operations on files" { | 602 | test "directory operations on files" { |
| 633 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 634 | |||
| 635 | try testWithAllSupportedPathTypes(struct { | 603 | try testWithAllSupportedPathTypes(struct { |
| 636 | fn impl(ctx: *TestContext) !void { | 604 | fn impl(ctx: *TestContext) !void { |
| 637 | const test_file_name = try ctx.transformPath("test_file"); | 605 | const test_file_name = try ctx.transformPath("test_file"); |
| ... | @@ -661,8 +629,6 @@ test "file operations on directories" { | ... | @@ -661,8 +629,6 @@ test "file operations on directories" { |
| 661 | // TODO: fix this test on FreeBSD. https://github.com/ziglang/zig/issues/1759 | 629 | // TODO: fix this test on FreeBSD. https://github.com/ziglang/zig/issues/1759 |
| 662 | if (builtin.os.tag == .freebsd) return error.SkipZigTest; | 630 | if (builtin.os.tag == .freebsd) return error.SkipZigTest; |
| 663 | 631 | ||
| 664 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 665 | |||
| 666 | try testWithAllSupportedPathTypes(struct { | 632 | try testWithAllSupportedPathTypes(struct { |
| 667 | fn impl(ctx: *TestContext) !void { | 633 | fn impl(ctx: *TestContext) !void { |
| 668 | const test_dir_name = try ctx.transformPath("test_dir"); | 634 | const test_dir_name = try ctx.transformPath("test_dir"); |
| ... | @@ -698,8 +664,6 @@ test "file operations on directories" { | ... | @@ -698,8 +664,6 @@ test "file operations on directories" { |
| 698 | } | 664 | } |
| 699 | 665 | ||
| 700 | test "makeOpenPath parent dirs do not exist" { | 666 | test "makeOpenPath parent dirs do not exist" { |
| 701 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 702 | |||
| 703 | var tmp_dir = tmpDir(.{}); | 667 | var tmp_dir = tmpDir(.{}); |
| 704 | defer tmp_dir.cleanup(); | 668 | defer tmp_dir.cleanup(); |
| 705 | 669 | ||
| ... | @@ -712,8 +676,6 @@ test "makeOpenPath parent dirs do not exist" { | ... | @@ -712,8 +676,6 @@ test "makeOpenPath parent dirs do not exist" { |
| 712 | } | 676 | } |
| 713 | 677 | ||
| 714 | test "deleteDir" { | 678 | test "deleteDir" { |
| 715 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 716 | |||
| 717 | try testWithAllSupportedPathTypes(struct { | 679 | try testWithAllSupportedPathTypes(struct { |
| 718 | fn impl(ctx: *TestContext) !void { | 680 | fn impl(ctx: *TestContext) !void { |
| 719 | const test_dir_path = try ctx.transformPath("test_dir"); | 681 | const test_dir_path = try ctx.transformPath("test_dir"); |
| ... | @@ -735,8 +697,6 @@ test "deleteDir" { | ... | @@ -735,8 +697,6 @@ test "deleteDir" { |
| 735 | } | 697 | } |
| 736 | 698 | ||
| 737 | test "Dir.rename files" { | 699 | test "Dir.rename files" { |
| 738 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 739 | |||
| 740 | try testWithAllSupportedPathTypes(struct { | 700 | try testWithAllSupportedPathTypes(struct { |
| 741 | fn impl(ctx: *TestContext) !void { | 701 | fn impl(ctx: *TestContext) !void { |
| 742 | // Rename on Windows can hit intermittent AccessDenied errors | 702 | // Rename on Windows can hit intermittent AccessDenied errors |
| ... | @@ -779,8 +739,6 @@ test "Dir.rename files" { | ... | @@ -779,8 +739,6 @@ test "Dir.rename files" { |
| 779 | } | 739 | } |
| 780 | 740 | ||
| 781 | test "Dir.rename directories" { | 741 | test "Dir.rename directories" { |
| 782 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 783 | |||
| 784 | try testWithAllSupportedPathTypes(struct { | 742 | try testWithAllSupportedPathTypes(struct { |
| 785 | fn impl(ctx: *TestContext) !void { | 743 | fn impl(ctx: *TestContext) !void { |
| 786 | // Rename on Windows can hit intermittent AccessDenied errors | 744 | // Rename on Windows can hit intermittent AccessDenied errors |
| ... | @@ -822,8 +780,6 @@ test "Dir.rename directory onto empty dir" { | ... | @@ -822,8 +780,6 @@ test "Dir.rename directory onto empty dir" { |
| 822 | // TODO: Fix on Windows, see https://github.com/ziglang/zig/issues/6364 | 780 | // TODO: Fix on Windows, see https://github.com/ziglang/zig/issues/6364 |
| 823 | if (builtin.os.tag == .windows) return error.SkipZigTest; | 781 | if (builtin.os.tag == .windows) return error.SkipZigTest; |
| 824 | 782 | ||
| 825 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 826 | |||
| 827 | try testWithAllSupportedPathTypes(struct { | 783 | try testWithAllSupportedPathTypes(struct { |
| 828 | fn impl(ctx: *TestContext) !void { | 784 | fn impl(ctx: *TestContext) !void { |
| 829 | const test_dir_path = try ctx.transformPath("test_dir"); | 785 | const test_dir_path = try ctx.transformPath("test_dir"); |
| ... | @@ -845,8 +801,6 @@ test "Dir.rename directory onto non-empty dir" { | ... | @@ -845,8 +801,6 @@ test "Dir.rename directory onto non-empty dir" { |
| 845 | // TODO: Fix on Windows, see https://github.com/ziglang/zig/issues/6364 | 801 | // TODO: Fix on Windows, see https://github.com/ziglang/zig/issues/6364 |
| 846 | if (builtin.os.tag == .windows) return error.SkipZigTest; | 802 | if (builtin.os.tag == .windows) return error.SkipZigTest; |
| 847 | 803 | ||
| 848 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 849 | |||
| 850 | try testWithAllSupportedPathTypes(struct { | 804 | try testWithAllSupportedPathTypes(struct { |
| 851 | fn impl(ctx: *TestContext) !void { | 805 | fn impl(ctx: *TestContext) !void { |
| 852 | const test_dir_path = try ctx.transformPath("test_dir"); | 806 | const test_dir_path = try ctx.transformPath("test_dir"); |
| ... | @@ -873,8 +827,6 @@ test "Dir.rename file <-> dir" { | ... | @@ -873,8 +827,6 @@ test "Dir.rename file <-> dir" { |
| 873 | // TODO: Fix on Windows, see https://github.com/ziglang/zig/issues/6364 | 827 | // TODO: Fix on Windows, see https://github.com/ziglang/zig/issues/6364 |
| 874 | if (builtin.os.tag == .windows) return error.SkipZigTest; | 828 | if (builtin.os.tag == .windows) return error.SkipZigTest; |
| 875 | 829 | ||
| 876 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 877 | |||
| 878 | try testWithAllSupportedPathTypes(struct { | 830 | try testWithAllSupportedPathTypes(struct { |
| 879 | fn impl(ctx: *TestContext) !void { | 831 | fn impl(ctx: *TestContext) !void { |
| 880 | const test_file_path = try ctx.transformPath("test_file"); | 832 | const test_file_path = try ctx.transformPath("test_file"); |
| ... | @@ -890,8 +842,6 @@ test "Dir.rename file <-> dir" { | ... | @@ -890,8 +842,6 @@ test "Dir.rename file <-> dir" { |
| 890 | } | 842 | } |
| 891 | 843 | ||
| 892 | test "rename" { | 844 | test "rename" { |
| 893 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 894 | |||
| 895 | var tmp_dir1 = tmpDir(.{}); | 845 | var tmp_dir1 = tmpDir(.{}); |
| 896 | defer tmp_dir1.cleanup(); | 846 | defer tmp_dir1.cleanup(); |
| 897 | 847 | ||
| ... | @@ -914,8 +864,6 @@ test "rename" { | ... | @@ -914,8 +864,6 @@ test "rename" { |
| 914 | test "renameAbsolute" { | 864 | test "renameAbsolute" { |
| 915 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 865 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 916 | 866 | ||
| 917 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 918 | |||
| 919 | var tmp_dir = tmpDir(.{}); | 867 | var tmp_dir = tmpDir(.{}); |
| 920 | defer tmp_dir.cleanup(); | 868 | defer tmp_dir.cleanup(); |
| 921 | 869 | ||
| ... | @@ -974,8 +922,6 @@ test "openSelfExe" { | ... | @@ -974,8 +922,6 @@ test "openSelfExe" { |
| 974 | } | 922 | } |
| 975 | 923 | ||
| 976 | test "makePath, put some files in it, deleteTree" { | 924 | test "makePath, put some files in it, deleteTree" { |
| 977 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 978 | |||
| 979 | try testWithAllSupportedPathTypes(struct { | 925 | try testWithAllSupportedPathTypes(struct { |
| 980 | fn impl(ctx: *TestContext) !void { | 926 | fn impl(ctx: *TestContext) !void { |
| 981 | const allocator = ctx.arena.allocator(); | 927 | const allocator = ctx.arena.allocator(); |
| ... | @@ -992,8 +938,6 @@ test "makePath, put some files in it, deleteTree" { | ... | @@ -992,8 +938,6 @@ test "makePath, put some files in it, deleteTree" { |
| 992 | } | 938 | } |
| 993 | 939 | ||
| 994 | test "makePath, put some files in it, deleteTreeMinStackSize" { | 940 | test "makePath, put some files in it, deleteTreeMinStackSize" { |
| 995 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 996 | |||
| 997 | try testWithAllSupportedPathTypes(struct { | 941 | try testWithAllSupportedPathTypes(struct { |
| 998 | fn impl(ctx: *TestContext) !void { | 942 | fn impl(ctx: *TestContext) !void { |
| 999 | const allocator = ctx.arena.allocator(); | 943 | const allocator = ctx.arena.allocator(); |
| ... | @@ -1012,8 +956,6 @@ test "makePath, put some files in it, deleteTreeMinStackSize" { | ... | @@ -1012,8 +956,6 @@ test "makePath, put some files in it, deleteTreeMinStackSize" { |
| 1012 | test "makePath in a directory that no longer exists" { | 956 | test "makePath in a directory that no longer exists" { |
| 1013 | if (builtin.os.tag == .windows) return error.SkipZigTest; // Windows returns FileBusy if attempting to remove an open dir | 957 | if (builtin.os.tag == .windows) return error.SkipZigTest; // Windows returns FileBusy if attempting to remove an open dir |
| 1014 | 958 | ||
| 1015 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1016 | |||
| 1017 | var tmp = tmpDir(.{}); | 959 | var tmp = tmpDir(.{}); |
| 1018 | defer tmp.cleanup(); | 960 | defer tmp.cleanup(); |
| 1019 | try tmp.parent_dir.deleteTree(&tmp.sub_path); | 961 | try tmp.parent_dir.deleteTree(&tmp.sub_path); |
| ... | @@ -1045,8 +987,6 @@ fn testFilenameLimits(iterable_dir: IterableDir, maxed_filename: []const u8) !vo | ... | @@ -1045,8 +987,6 @@ fn testFilenameLimits(iterable_dir: IterableDir, maxed_filename: []const u8) !vo |
| 1045 | } | 987 | } |
| 1046 | 988 | ||
| 1047 | test "max file name component lengths" { | 989 | test "max file name component lengths" { |
| 1048 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1049 | |||
| 1050 | var tmp = tmpIterableDir(.{}); | 990 | var tmp = tmpIterableDir(.{}); |
| 1051 | defer tmp.cleanup(); | 991 | defer tmp.cleanup(); |
| 1052 | 992 | ||
| ... | @@ -1068,8 +1008,6 @@ test "max file name component lengths" { | ... | @@ -1068,8 +1008,6 @@ test "max file name component lengths" { |
| 1068 | } | 1008 | } |
| 1069 | 1009 | ||
| 1070 | test "writev, readv" { | 1010 | test "writev, readv" { |
| 1071 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1072 | |||
| 1073 | var tmp = tmpDir(.{}); | 1011 | var tmp = tmpDir(.{}); |
| 1074 | defer tmp.cleanup(); | 1012 | defer tmp.cleanup(); |
| 1075 | 1013 | ||
| ... | @@ -1112,8 +1050,6 @@ test "writev, readv" { | ... | @@ -1112,8 +1050,6 @@ test "writev, readv" { |
| 1112 | } | 1050 | } |
| 1113 | 1051 | ||
| 1114 | test "pwritev, preadv" { | 1052 | test "pwritev, preadv" { |
| 1115 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1116 | |||
| 1117 | var tmp = tmpDir(.{}); | 1053 | var tmp = tmpDir(.{}); |
| 1118 | defer tmp.cleanup(); | 1054 | defer tmp.cleanup(); |
| 1119 | 1055 | ||
| ... | @@ -1155,8 +1091,6 @@ test "pwritev, preadv" { | ... | @@ -1155,8 +1091,6 @@ test "pwritev, preadv" { |
| 1155 | } | 1091 | } |
| 1156 | 1092 | ||
| 1157 | test "access file" { | 1093 | test "access file" { |
| 1158 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1159 | |||
| 1160 | try testWithAllSupportedPathTypes(struct { | 1094 | try testWithAllSupportedPathTypes(struct { |
| 1161 | fn impl(ctx: *TestContext) !void { | 1095 | fn impl(ctx: *TestContext) !void { |
| 1162 | const dir_path = try ctx.transformPath("os_test_tmp"); | 1096 | const dir_path = try ctx.transformPath("os_test_tmp"); |
| ... | @@ -1173,8 +1107,6 @@ test "access file" { | ... | @@ -1173,8 +1107,6 @@ test "access file" { |
| 1173 | } | 1107 | } |
| 1174 | 1108 | ||
| 1175 | test "sendfile" { | 1109 | test "sendfile" { |
| 1176 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1177 | |||
| 1178 | var tmp = tmpDir(.{}); | 1110 | var tmp = tmpDir(.{}); |
| 1179 | defer tmp.cleanup(); | 1111 | defer tmp.cleanup(); |
| 1180 | 1112 | ||
| ... | @@ -1240,8 +1172,6 @@ test "sendfile" { | ... | @@ -1240,8 +1172,6 @@ test "sendfile" { |
| 1240 | } | 1172 | } |
| 1241 | 1173 | ||
| 1242 | test "copyRangeAll" { | 1174 | test "copyRangeAll" { |
| 1243 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1244 | |||
| 1245 | var tmp = tmpDir(.{}); | 1175 | var tmp = tmpDir(.{}); |
| 1246 | defer tmp.cleanup(); | 1176 | defer tmp.cleanup(); |
| 1247 | 1177 | ||
| ... | @@ -1268,8 +1198,6 @@ test "copyRangeAll" { | ... | @@ -1268,8 +1198,6 @@ test "copyRangeAll" { |
| 1268 | } | 1198 | } |
| 1269 | 1199 | ||
| 1270 | test "copyFile" { | 1200 | test "copyFile" { |
| 1271 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1272 | |||
| 1273 | try testWithAllSupportedPathTypes(struct { | 1201 | try testWithAllSupportedPathTypes(struct { |
| 1274 | fn impl(ctx: *TestContext) !void { | 1202 | fn impl(ctx: *TestContext) !void { |
| 1275 | const data = "u6wj+JmdF3qHsFPE BUlH2g4gJCmEz0PP"; | 1203 | const data = "u6wj+JmdF3qHsFPE BUlH2g4gJCmEz0PP"; |
| ... | @@ -1300,8 +1228,6 @@ fn expectFileContents(dir: Dir, file_path: []const u8, data: []const u8) !void { | ... | @@ -1300,8 +1228,6 @@ fn expectFileContents(dir: Dir, file_path: []const u8, data: []const u8) !void { |
| 1300 | } | 1228 | } |
| 1301 | 1229 | ||
| 1302 | test "AtomicFile" { | 1230 | test "AtomicFile" { |
| 1303 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1304 | |||
| 1305 | try testWithAllSupportedPathTypes(struct { | 1231 | try testWithAllSupportedPathTypes(struct { |
| 1306 | fn impl(ctx: *TestContext) !void { | 1232 | fn impl(ctx: *TestContext) !void { |
| 1307 | const allocator = ctx.arena.allocator(); | 1233 | const allocator = ctx.arena.allocator(); |
| ... | @@ -1328,8 +1254,6 @@ test "AtomicFile" { | ... | @@ -1328,8 +1254,6 @@ test "AtomicFile" { |
| 1328 | test "open file with exclusive nonblocking lock twice" { | 1254 | test "open file with exclusive nonblocking lock twice" { |
| 1329 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 1255 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 1330 | 1256 | ||
| 1331 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1332 | |||
| 1333 | try testWithAllSupportedPathTypes(struct { | 1257 | try testWithAllSupportedPathTypes(struct { |
| 1334 | fn impl(ctx: *TestContext) !void { | 1258 | fn impl(ctx: *TestContext) !void { |
| 1335 | const filename = try ctx.transformPath("file_nonblocking_lock_test.txt"); | 1259 | const filename = try ctx.transformPath("file_nonblocking_lock_test.txt"); |
| ... | @@ -1346,8 +1270,6 @@ test "open file with exclusive nonblocking lock twice" { | ... | @@ -1346,8 +1270,6 @@ test "open file with exclusive nonblocking lock twice" { |
| 1346 | test "open file with shared and exclusive nonblocking lock" { | 1270 | test "open file with shared and exclusive nonblocking lock" { |
| 1347 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 1271 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 1348 | 1272 | ||
| 1349 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1350 | |||
| 1351 | try testWithAllSupportedPathTypes(struct { | 1273 | try testWithAllSupportedPathTypes(struct { |
| 1352 | fn impl(ctx: *TestContext) !void { | 1274 | fn impl(ctx: *TestContext) !void { |
| 1353 | const filename = try ctx.transformPath("file_nonblocking_lock_test.txt"); | 1275 | const filename = try ctx.transformPath("file_nonblocking_lock_test.txt"); |
| ... | @@ -1364,8 +1286,6 @@ test "open file with shared and exclusive nonblocking lock" { | ... | @@ -1364,8 +1286,6 @@ test "open file with shared and exclusive nonblocking lock" { |
| 1364 | test "open file with exclusive and shared nonblocking lock" { | 1286 | test "open file with exclusive and shared nonblocking lock" { |
| 1365 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 1287 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 1366 | 1288 | ||
| 1367 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1368 | |||
| 1369 | try testWithAllSupportedPathTypes(struct { | 1289 | try testWithAllSupportedPathTypes(struct { |
| 1370 | fn impl(ctx: *TestContext) !void { | 1290 | fn impl(ctx: *TestContext) !void { |
| 1371 | const filename = try ctx.transformPath("file_nonblocking_lock_test.txt"); | 1291 | const filename = try ctx.transformPath("file_nonblocking_lock_test.txt"); |
| ... | @@ -1380,8 +1300,6 @@ test "open file with exclusive and shared nonblocking lock" { | ... | @@ -1380,8 +1300,6 @@ test "open file with exclusive and shared nonblocking lock" { |
| 1380 | } | 1300 | } |
| 1381 | 1301 | ||
| 1382 | test "open file with exclusive lock twice, make sure second lock waits" { | 1302 | test "open file with exclusive lock twice, make sure second lock waits" { |
| 1383 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1384 | |||
| 1385 | if (builtin.single_threaded) return error.SkipZigTest; | 1303 | if (builtin.single_threaded) return error.SkipZigTest; |
| 1386 | 1304 | ||
| 1387 | if (std.io.is_async) { | 1305 | if (std.io.is_async) { |
| ... | @@ -1432,8 +1350,6 @@ test "open file with exclusive lock twice, make sure second lock waits" { | ... | @@ -1432,8 +1350,6 @@ test "open file with exclusive lock twice, make sure second lock waits" { |
| 1432 | test "open file with exclusive nonblocking lock twice (absolute paths)" { | 1350 | test "open file with exclusive nonblocking lock twice (absolute paths)" { |
| 1433 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 1351 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 1434 | 1352 | ||
| 1435 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1436 | |||
| 1437 | var random_bytes: [12]u8 = undefined; | 1353 | var random_bytes: [12]u8 = undefined; |
| 1438 | std.crypto.random.bytes(&random_bytes); | 1354 | std.crypto.random.bytes(&random_bytes); |
| 1439 | 1355 | ||
| ... | @@ -1468,8 +1384,6 @@ test "open file with exclusive nonblocking lock twice (absolute paths)" { | ... | @@ -1468,8 +1384,6 @@ test "open file with exclusive nonblocking lock twice (absolute paths)" { |
| 1468 | test "walker" { | 1384 | test "walker" { |
| 1469 | if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest; | 1385 | if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest; |
| 1470 | 1386 | ||
| 1471 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1472 | |||
| 1473 | var tmp = tmpIterableDir(.{}); | 1387 | var tmp = tmpIterableDir(.{}); |
| 1474 | defer tmp.cleanup(); | 1388 | defer tmp.cleanup(); |
| 1475 | 1389 | ||
| ... | @@ -1523,8 +1437,6 @@ test "walker" { | ... | @@ -1523,8 +1437,6 @@ test "walker" { |
| 1523 | test "walker without fully iterating" { | 1437 | test "walker without fully iterating" { |
| 1524 | if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest; | 1438 | if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest; |
| 1525 | 1439 | ||
| 1526 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1527 | |||
| 1528 | var tmp = tmpIterableDir(.{}); | 1440 | var tmp = tmpIterableDir(.{}); |
| 1529 | defer tmp.cleanup(); | 1441 | defer tmp.cleanup(); |
| 1530 | 1442 | ||
| ... | @@ -1637,8 +1549,6 @@ test "chmod" { | ... | @@ -1637,8 +1549,6 @@ test "chmod" { |
| 1637 | if (builtin.os.tag == .windows or builtin.os.tag == .wasi) | 1549 | if (builtin.os.tag == .windows or builtin.os.tag == .wasi) |
| 1638 | return error.SkipZigTest; | 1550 | return error.SkipZigTest; |
| 1639 | 1551 | ||
| 1640 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1641 | |||
| 1642 | var tmp = tmpDir(.{}); | 1552 | var tmp = tmpDir(.{}); |
| 1643 | defer tmp.cleanup(); | 1553 | defer tmp.cleanup(); |
| 1644 | 1554 | ||
| ... | @@ -1661,8 +1571,6 @@ test "chown" { | ... | @@ -1661,8 +1571,6 @@ test "chown" { |
| 1661 | if (builtin.os.tag == .windows or builtin.os.tag == .wasi) | 1571 | if (builtin.os.tag == .windows or builtin.os.tag == .wasi) |
| 1662 | return error.SkipZigTest; | 1572 | return error.SkipZigTest; |
| 1663 | 1573 | ||
| 1664 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1665 | |||
| 1666 | var tmp = tmpDir(.{}); | 1574 | var tmp = tmpDir(.{}); |
| 1667 | defer tmp.cleanup(); | 1575 | defer tmp.cleanup(); |
| 1668 | 1576 | ||
| ... | @@ -1678,8 +1586,6 @@ test "chown" { | ... | @@ -1678,8 +1586,6 @@ test "chown" { |
| 1678 | } | 1586 | } |
| 1679 | 1587 | ||
| 1680 | test "File.Metadata" { | 1588 | test "File.Metadata" { |
| 1681 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1682 | |||
| 1683 | var tmp = tmpDir(.{}); | 1589 | var tmp = tmpDir(.{}); |
| 1684 | defer tmp.cleanup(); | 1590 | defer tmp.cleanup(); |
| 1685 | 1591 | ||
| ... | @@ -1763,8 +1669,6 @@ test "delete a read-only file on windows" { | ... | @@ -1763,8 +1669,6 @@ test "delete a read-only file on windows" { |
| 1763 | if (builtin.os.tag != .windows) | 1669 | if (builtin.os.tag != .windows) |
| 1764 | return error.SkipZigTest; | 1670 | return error.SkipZigTest; |
| 1765 | 1671 | ||
| 1766 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1767 | |||
| 1768 | var tmp = testing.tmpDir(.{}); | 1672 | var tmp = testing.tmpDir(.{}); |
| 1769 | defer tmp.cleanup(); | 1673 | defer tmp.cleanup(); |
| 1770 | 1674 | ||
| ... | @@ -1795,8 +1699,6 @@ test "delete a read-only file on windows" { | ... | @@ -1795,8 +1699,6 @@ test "delete a read-only file on windows" { |
| 1795 | test "delete a setAsCwd directory on Windows" { | 1699 | test "delete a setAsCwd directory on Windows" { |
| 1796 | if (builtin.os.tag != .windows) return error.SkipZigTest; | 1700 | if (builtin.os.tag != .windows) return error.SkipZigTest; |
| 1797 | 1701 | ||
| 1798 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1799 | |||
| 1800 | var tmp = tmpDir(.{}); | 1702 | var tmp = tmpDir(.{}); |
| 1801 | // Set tmp dir as current working directory. | 1703 | // Set tmp dir as current working directory. |
| 1802 | try tmp.dir.setAsCwd(); | 1704 | try tmp.dir.setAsCwd(); |
lib/std/hash/xxhash.zig-12| ... | @@ -862,8 +862,6 @@ test "xxhash3 iterative api" { | ... | @@ -862,8 +862,6 @@ test "xxhash3 iterative api" { |
| 862 | } | 862 | } |
| 863 | 863 | ||
| 864 | test "xxhash64" { | 864 | test "xxhash64" { |
| 865 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 866 | |||
| 867 | const H = XxHash64; | 865 | const H = XxHash64; |
| 868 | try testExpect(H, 0, "", 0xef46db3751d8e999); | 866 | try testExpect(H, 0, "", 0xef46db3751d8e999); |
| 869 | try testExpect(H, 0, "a", 0xd24ec4f1a98c6e5b); | 867 | try testExpect(H, 0, "a", 0xd24ec4f1a98c6e5b); |
| ... | @@ -875,8 +873,6 @@ test "xxhash64" { | ... | @@ -875,8 +873,6 @@ test "xxhash64" { |
| 875 | } | 873 | } |
| 876 | 874 | ||
| 877 | test "xxhash64 smhasher" { | 875 | test "xxhash64 smhasher" { |
| 878 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 879 | |||
| 880 | const Test = struct { | 876 | const Test = struct { |
| 881 | fn do() !void { | 877 | fn do() !void { |
| 882 | try expectEqual(verify.smhasher(XxHash64.hash), 0x024B7CF4); | 878 | try expectEqual(verify.smhasher(XxHash64.hash), 0x024B7CF4); |
| ... | @@ -888,8 +884,6 @@ test "xxhash64 smhasher" { | ... | @@ -888,8 +884,6 @@ test "xxhash64 smhasher" { |
| 888 | } | 884 | } |
| 889 | 885 | ||
| 890 | test "xxhash64 iterative api" { | 886 | test "xxhash64 iterative api" { |
| 891 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 892 | |||
| 893 | const Test = struct { | 887 | const Test = struct { |
| 894 | fn do() !void { | 888 | fn do() !void { |
| 895 | try verify.iterativeApi(XxHash64); | 889 | try verify.iterativeApi(XxHash64); |
| ... | @@ -901,8 +895,6 @@ test "xxhash64 iterative api" { | ... | @@ -901,8 +895,6 @@ test "xxhash64 iterative api" { |
| 901 | } | 895 | } |
| 902 | 896 | ||
| 903 | test "xxhash32" { | 897 | test "xxhash32" { |
| 904 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 905 | |||
| 906 | const H = XxHash32; | 898 | const H = XxHash32; |
| 907 | 899 | ||
| 908 | try testExpect(H, 0, "", 0x02cc5d05); | 900 | try testExpect(H, 0, "", 0x02cc5d05); |
| ... | @@ -915,8 +907,6 @@ test "xxhash32" { | ... | @@ -915,8 +907,6 @@ test "xxhash32" { |
| 915 | } | 907 | } |
| 916 | 908 | ||
| 917 | test "xxhash32 smhasher" { | 909 | test "xxhash32 smhasher" { |
| 918 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 919 | |||
| 920 | const Test = struct { | 910 | const Test = struct { |
| 921 | fn do() !void { | 911 | fn do() !void { |
| 922 | try expectEqual(verify.smhasher(XxHash32.hash), 0xBA88B743); | 912 | try expectEqual(verify.smhasher(XxHash32.hash), 0xBA88B743); |
| ... | @@ -928,8 +918,6 @@ test "xxhash32 smhasher" { | ... | @@ -928,8 +918,6 @@ test "xxhash32 smhasher" { |
| 928 | } | 918 | } |
| 929 | 919 | ||
| 930 | test "xxhash32 iterative api" { | 920 | test "xxhash32 iterative api" { |
| 931 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 932 | |||
| 933 | const Test = struct { | 921 | const Test = struct { |
| 934 | fn do() !void { | 922 | fn do() !void { |
| 935 | try verify.iterativeApi(XxHash32); | 923 | try verify.iterativeApi(XxHash32); |
lib/std/hash_map.zig-2| ... | @@ -1873,8 +1873,6 @@ test "std.hash_map multiple removes on same metadata" { | ... | @@ -1873,8 +1873,6 @@ test "std.hash_map multiple removes on same metadata" { |
| 1873 | } | 1873 | } |
| 1874 | 1874 | ||
| 1875 | test "std.hash_map put and remove loop in random order" { | 1875 | test "std.hash_map put and remove loop in random order" { |
| 1876 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1877 | |||
| 1878 | var map = AutoHashMap(u32, u32).init(std.testing.allocator); | 1876 | var map = AutoHashMap(u32, u32).init(std.testing.allocator); |
| 1879 | defer map.deinit(); | 1877 | defer map.deinit(); |
| 1880 | 1878 |
lib/std/heap/general_purpose_allocator.zig-4| ... | @@ -1042,8 +1042,6 @@ const TraceKind = enum { | ... | @@ -1042,8 +1042,6 @@ const TraceKind = enum { |
| 1042 | const test_config = Config{}; | 1042 | const test_config = Config{}; |
| 1043 | 1043 | ||
| 1044 | test "small allocations - free in same order" { | 1044 | test "small allocations - free in same order" { |
| 1045 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1046 | |||
| 1047 | var gpa = GeneralPurposeAllocator(test_config){}; | 1045 | var gpa = GeneralPurposeAllocator(test_config){}; |
| 1048 | defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); | 1046 | defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); |
| 1049 | const allocator = gpa.allocator(); | 1047 | const allocator = gpa.allocator(); |
| ... | @@ -1063,8 +1061,6 @@ test "small allocations - free in same order" { | ... | @@ -1063,8 +1061,6 @@ test "small allocations - free in same order" { |
| 1063 | } | 1061 | } |
| 1064 | 1062 | ||
| 1065 | test "small allocations - free in reverse order" { | 1063 | test "small allocations - free in reverse order" { |
| 1066 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1067 | |||
| 1068 | var gpa = GeneralPurposeAllocator(test_config){}; | 1064 | var gpa = GeneralPurposeAllocator(test_config){}; |
| 1069 | defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); | 1065 | defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); |
| 1070 | const allocator = gpa.allocator(); | 1066 | const allocator = gpa.allocator(); |
lib/std/http/Client.zig-2| ... | @@ -491,8 +491,6 @@ pub const Response = struct { | ... | @@ -491,8 +491,6 @@ pub const Response = struct { |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | test parseInt3 { | 493 | test parseInt3 { |
| 494 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 495 | |||
| 496 | const expectEqual = testing.expectEqual; | 494 | const expectEqual = testing.expectEqual; |
| 497 | try expectEqual(@as(u10, 0), parseInt3("000".*)); | 495 | try expectEqual(@as(u10, 0), parseInt3("000".*)); |
| 498 | try expectEqual(@as(u10, 418), parseInt3("418".*)); | 496 | try expectEqual(@as(u10, 418), parseInt3("418".*)); |
lib/std/io/multi_writer.zig-1| ... | @@ -36,7 +36,6 @@ pub fn multiWriter(streams: anytype) MultiWriter(@TypeOf(streams)) { | ... | @@ -36,7 +36,6 @@ pub fn multiWriter(streams: anytype) MultiWriter(@TypeOf(streams)) { |
| 36 | const testing = std.testing; | 36 | const testing = std.testing; |
| 37 | 37 | ||
| 38 | test "MultiWriter" { | 38 | test "MultiWriter" { |
| 39 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 40 | var tmp = testing.tmpDir(.{}); | 39 | var tmp = testing.tmpDir(.{}); |
| 41 | defer tmp.cleanup(); | 40 | defer tmp.cleanup(); |
| 42 | var f = try tmp.dir.createFile("t.txt", .{}); | 41 | var f = try tmp.dir.createFile("t.txt", .{}); |
lib/std/io/test.zig-6| ... | @@ -15,8 +15,6 @@ const native_endian = builtin.target.cpu.arch.endian(); | ... | @@ -15,8 +15,6 @@ const native_endian = builtin.target.cpu.arch.endian(); |
| 15 | const tmpDir = std.testing.tmpDir; | 15 | const tmpDir = std.testing.tmpDir; |
| 16 | 16 | ||
| 17 | test "write a file, read it, then delete it" { | 17 | test "write a file, read it, then delete it" { |
| 18 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 19 | |||
| 20 | var tmp = tmpDir(.{}); | 18 | var tmp = tmpDir(.{}); |
| 21 | defer tmp.cleanup(); | 19 | defer tmp.cleanup(); |
| 22 | 20 | ||
| ... | @@ -110,8 +108,6 @@ test "BitStreams with File Stream" { | ... | @@ -110,8 +108,6 @@ test "BitStreams with File Stream" { |
| 110 | } | 108 | } |
| 111 | 109 | ||
| 112 | test "File seek ops" { | 110 | test "File seek ops" { |
| 113 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 114 | |||
| 115 | var tmp = tmpDir(.{}); | 111 | var tmp = tmpDir(.{}); |
| 116 | defer tmp.cleanup(); | 112 | defer tmp.cleanup(); |
| 117 | 113 | ||
| ... | @@ -139,8 +135,6 @@ test "File seek ops" { | ... | @@ -139,8 +135,6 @@ test "File seek ops" { |
| 139 | } | 135 | } |
| 140 | 136 | ||
| 141 | test "setEndPos" { | 137 | test "setEndPos" { |
| 142 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 143 | |||
| 144 | var tmp = tmpDir(.{}); | 138 | var tmp = tmpDir(.{}); |
| 145 | defer tmp.cleanup(); | 139 | defer tmp.cleanup(); |
| 146 | 140 |
lib/std/math/big/int_test.zig-2| ... | @@ -71,8 +71,6 @@ test "big.int set negative minimum" { | ... | @@ -71,8 +71,6 @@ test "big.int set negative minimum" { |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | test "big.int set double-width maximum then zero" { | 73 | test "big.int set double-width maximum then zero" { |
| 74 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 75 | |||
| 76 | var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb)); | 74 | var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb)); |
| 77 | defer a.deinit(); | 75 | defer a.deinit(); |
| 78 | try a.set(@as(DoubleLimb, 0)); | 76 | try a.set(@as(DoubleLimb, 0)); |
lib/std/math/ilogb.zig-6| ... | @@ -125,8 +125,6 @@ test "80" { | ... | @@ -125,8 +125,6 @@ test "80" { |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | test "128" { | 127 | test "128" { |
| 128 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 129 | |||
| 130 | try expect(ilogbX(f128, 0.0) == fp_ilogb0); | 128 | try expect(ilogbX(f128, 0.0) == fp_ilogb0); |
| 131 | try expect(ilogbX(f128, 0.5) == -1); | 129 | try expect(ilogbX(f128, 0.5) == -1); |
| 132 | try expect(ilogbX(f128, 0.8923) == -1); | 130 | try expect(ilogbX(f128, 0.8923) == -1); |
| ... | @@ -162,8 +160,6 @@ test "64 special" { | ... | @@ -162,8 +160,6 @@ test "64 special" { |
| 162 | } | 160 | } |
| 163 | 161 | ||
| 164 | test "80 special" { | 162 | test "80 special" { |
| 165 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 166 | |||
| 167 | try expect(ilogbX(f80, math.inf(f80)) == maxInt(i32)); | 163 | try expect(ilogbX(f80, math.inf(f80)) == maxInt(i32)); |
| 168 | try expect(ilogbX(f80, -math.inf(f80)) == maxInt(i32)); | 164 | try expect(ilogbX(f80, -math.inf(f80)) == maxInt(i32)); |
| 169 | try expect(ilogbX(f80, 0.0) == minInt(i32)); | 165 | try expect(ilogbX(f80, 0.0) == minInt(i32)); |
| ... | @@ -171,8 +167,6 @@ test "80 special" { | ... | @@ -171,8 +167,6 @@ test "80 special" { |
| 171 | } | 167 | } |
| 172 | 168 | ||
| 173 | test "128 special" { | 169 | test "128 special" { |
| 174 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 175 | |||
| 176 | try expect(ilogbX(f128, math.inf(f128)) == maxInt(i32)); | 170 | try expect(ilogbX(f128, math.inf(f128)) == maxInt(i32)); |
| 177 | try expect(ilogbX(f128, -math.inf(f128)) == maxInt(i32)); | 171 | try expect(ilogbX(f128, -math.inf(f128)) == maxInt(i32)); |
| 178 | try expect(ilogbX(f128, 0.0) == minInt(i32)); | 172 | try expect(ilogbX(f128, 0.0) == minInt(i32)); |
lib/std/math/scalbn.zig-2| ... | @@ -7,8 +7,6 @@ const expect = std.testing.expect; | ... | @@ -7,8 +7,6 @@ const expect = std.testing.expect; |
| 7 | pub const scalbn = @import("ldexp.zig").ldexp; | 7 | pub const scalbn = @import("ldexp.zig").ldexp; |
| 8 | 8 | ||
| 9 | test "math.scalbn" { | 9 | test "math.scalbn" { |
| 10 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 11 | |||
| 12 | // Verify we are using base 2. | 10 | // Verify we are using base 2. |
| 13 | try expect(scalbn(@as(f16, 1.5), 4) == 24.0); | 11 | try expect(scalbn(@as(f16, 1.5), 4) == 24.0); |
| 14 | try expect(scalbn(@as(f32, 1.5), 4) == 24.0); | 12 | try expect(scalbn(@as(f32, 1.5), 4) == 24.0); |
lib/std/mem.zig+2-4| ... | @@ -2060,10 +2060,7 @@ pub fn writeVarPackedInt(bytes: []u8, bit_offset: usize, bit_count: usize, value | ... | @@ -2060,10 +2060,7 @@ pub fn writeVarPackedInt(bytes: []u8, bit_offset: usize, bit_count: usize, value |
| 2060 | } | 2060 | } |
| 2061 | 2061 | ||
| 2062 | test "writeIntBig and writeIntLittle" { | 2062 | test "writeIntBig and writeIntLittle" { |
| 2063 | switch (builtin.zig_backend) { | 2063 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 2064 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | ||
| 2065 | else => {}, | ||
| 2066 | } | ||
| 2067 | 2064 | ||
| 2068 | var buf0: [0]u8 = undefined; | 2065 | var buf0: [0]u8 = undefined; |
| 2069 | var buf1: [1]u8 = undefined; | 2066 | var buf1: [1]u8 = undefined; |
| ... | @@ -4664,6 +4661,7 @@ test "read/write(Var)PackedInt" { | ... | @@ -4664,6 +4661,7 @@ test "read/write(Var)PackedInt" { |
| 4664 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | 4661 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, |
| 4665 | else => {}, | 4662 | else => {}, |
| 4666 | } | 4663 | } |
| 4664 | |||
| 4667 | switch (builtin.cpu.arch) { | 4665 | switch (builtin.cpu.arch) { |
| 4668 | // This test generates too much code to execute on WASI. | 4666 | // This test generates too much code to execute on WASI. |
| 4669 | // LLVM backend fails with "too many locals: locals exceed maximum" | 4667 | // LLVM backend fails with "too many locals: locals exceed maximum" |
lib/std/net/test.zig-2| ... | @@ -294,8 +294,6 @@ test "listen on a unix socket, send bytes, receive bytes" { | ... | @@ -294,8 +294,6 @@ test "listen on a unix socket, send bytes, receive bytes" { |
| 294 | if (builtin.single_threaded) return error.SkipZigTest; | 294 | if (builtin.single_threaded) return error.SkipZigTest; |
| 295 | if (!net.has_unix_sockets) return error.SkipZigTest; | 295 | if (!net.has_unix_sockets) return error.SkipZigTest; |
| 296 | 296 | ||
| 297 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 298 | |||
| 299 | if (builtin.os.tag == .windows) { | 297 | if (builtin.os.tag == .windows) { |
| 300 | _ = try std.os.windows.WSAStartup(2, 2); | 298 | _ = try std.os.windows.WSAStartup(2, 2); |
| 301 | } | 299 | } |
lib/std/os/linux/io_uring.zig-26| ... | @@ -1741,8 +1741,6 @@ test "readv" { | ... | @@ -1741,8 +1741,6 @@ test "readv" { |
| 1741 | test "writev/fsync/readv" { | 1741 | test "writev/fsync/readv" { |
| 1742 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 1742 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 1743 | 1743 | ||
| 1744 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1745 | |||
| 1746 | var ring = IO_Uring.init(4, 0) catch |err| switch (err) { | 1744 | var ring = IO_Uring.init(4, 0) catch |err| switch (err) { |
| 1747 | error.SystemOutdated => return error.SkipZigTest, | 1745 | error.SystemOutdated => return error.SkipZigTest, |
| 1748 | error.PermissionDenied => return error.SkipZigTest, | 1746 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -1813,8 +1811,6 @@ test "writev/fsync/readv" { | ... | @@ -1813,8 +1811,6 @@ test "writev/fsync/readv" { |
| 1813 | test "write/read" { | 1811 | test "write/read" { |
| 1814 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 1812 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 1815 | 1813 | ||
| 1816 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1817 | |||
| 1818 | var ring = IO_Uring.init(2, 0) catch |err| switch (err) { | 1814 | var ring = IO_Uring.init(2, 0) catch |err| switch (err) { |
| 1819 | error.SystemOutdated => return error.SkipZigTest, | 1815 | error.SystemOutdated => return error.SkipZigTest, |
| 1820 | error.PermissionDenied => return error.SkipZigTest, | 1816 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -1862,8 +1858,6 @@ test "write/read" { | ... | @@ -1862,8 +1858,6 @@ test "write/read" { |
| 1862 | test "splice/read" { | 1858 | test "splice/read" { |
| 1863 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 1859 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 1864 | 1860 | ||
| 1865 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1866 | |||
| 1867 | var ring = IO_Uring.init(4, 0) catch |err| switch (err) { | 1861 | var ring = IO_Uring.init(4, 0) catch |err| switch (err) { |
| 1868 | error.SystemOutdated => return error.SkipZigTest, | 1862 | error.SystemOutdated => return error.SkipZigTest, |
| 1869 | error.PermissionDenied => return error.SkipZigTest, | 1863 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -1935,8 +1929,6 @@ test "splice/read" { | ... | @@ -1935,8 +1929,6 @@ test "splice/read" { |
| 1935 | test "write_fixed/read_fixed" { | 1929 | test "write_fixed/read_fixed" { |
| 1936 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 1930 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 1937 | 1931 | ||
| 1938 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1939 | |||
| 1940 | var ring = IO_Uring.init(2, 0) catch |err| switch (err) { | 1932 | var ring = IO_Uring.init(2, 0) catch |err| switch (err) { |
| 1941 | error.SystemOutdated => return error.SkipZigTest, | 1933 | error.SystemOutdated => return error.SkipZigTest, |
| 1942 | error.PermissionDenied => return error.SkipZigTest, | 1934 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2002,8 +1994,6 @@ test "write_fixed/read_fixed" { | ... | @@ -2002,8 +1994,6 @@ test "write_fixed/read_fixed" { |
| 2002 | test "openat" { | 1994 | test "openat" { |
| 2003 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 1995 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2004 | 1996 | ||
| 2005 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2006 | |||
| 2007 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 1997 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2008 | error.SystemOutdated => return error.SkipZigTest, | 1998 | error.SystemOutdated => return error.SkipZigTest, |
| 2009 | error.PermissionDenied => return error.SkipZigTest, | 1999 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2055,8 +2045,6 @@ test "openat" { | ... | @@ -2055,8 +2045,6 @@ test "openat" { |
| 2055 | test "close" { | 2045 | test "close" { |
| 2056 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2046 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2057 | 2047 | ||
| 2058 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2059 | |||
| 2060 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2048 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2061 | error.SystemOutdated => return error.SkipZigTest, | 2049 | error.SystemOutdated => return error.SkipZigTest, |
| 2062 | error.PermissionDenied => return error.SkipZigTest, | 2050 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2392,8 +2380,6 @@ test "accept/connect/recv/link_timeout" { | ... | @@ -2392,8 +2380,6 @@ test "accept/connect/recv/link_timeout" { |
| 2392 | test "fallocate" { | 2380 | test "fallocate" { |
| 2393 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2381 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2394 | 2382 | ||
| 2395 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2396 | |||
| 2397 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2383 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2398 | error.SystemOutdated => return error.SkipZigTest, | 2384 | error.SystemOutdated => return error.SkipZigTest, |
| 2399 | error.PermissionDenied => return error.SkipZigTest, | 2385 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2440,8 +2426,6 @@ test "fallocate" { | ... | @@ -2440,8 +2426,6 @@ test "fallocate" { |
| 2440 | test "statx" { | 2426 | test "statx" { |
| 2441 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2427 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2442 | 2428 | ||
| 2443 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2444 | |||
| 2445 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2429 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2446 | error.SystemOutdated => return error.SkipZigTest, | 2430 | error.SystemOutdated => return error.SkipZigTest, |
| 2447 | error.PermissionDenied => return error.SkipZigTest, | 2431 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2698,8 +2682,6 @@ test "shutdown" { | ... | @@ -2698,8 +2682,6 @@ test "shutdown" { |
| 2698 | test "renameat" { | 2682 | test "renameat" { |
| 2699 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2683 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2700 | 2684 | ||
| 2701 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2702 | |||
| 2703 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2685 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2704 | error.SystemOutdated => return error.SkipZigTest, | 2686 | error.SystemOutdated => return error.SkipZigTest, |
| 2705 | error.PermissionDenied => return error.SkipZigTest, | 2687 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2769,8 +2751,6 @@ test "renameat" { | ... | @@ -2769,8 +2751,6 @@ test "renameat" { |
| 2769 | test "unlinkat" { | 2751 | test "unlinkat" { |
| 2770 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2752 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2771 | 2753 | ||
| 2772 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2773 | |||
| 2774 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2754 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2775 | error.SystemOutdated => return error.SkipZigTest, | 2755 | error.SystemOutdated => return error.SkipZigTest, |
| 2776 | error.PermissionDenied => return error.SkipZigTest, | 2756 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2823,8 +2803,6 @@ test "unlinkat" { | ... | @@ -2823,8 +2803,6 @@ test "unlinkat" { |
| 2823 | test "mkdirat" { | 2803 | test "mkdirat" { |
| 2824 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2804 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2825 | 2805 | ||
| 2826 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2827 | |||
| 2828 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2806 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2829 | error.SystemOutdated => return error.SkipZigTest, | 2807 | error.SystemOutdated => return error.SkipZigTest, |
| 2830 | error.PermissionDenied => return error.SkipZigTest, | 2808 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2869,8 +2847,6 @@ test "mkdirat" { | ... | @@ -2869,8 +2847,6 @@ test "mkdirat" { |
| 2869 | test "symlinkat" { | 2847 | test "symlinkat" { |
| 2870 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2848 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2871 | 2849 | ||
| 2872 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2873 | |||
| 2874 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2850 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2875 | error.SystemOutdated => return error.SkipZigTest, | 2851 | error.SystemOutdated => return error.SkipZigTest, |
| 2876 | error.PermissionDenied => return error.SkipZigTest, | 2852 | error.PermissionDenied => return error.SkipZigTest, |
| ... | @@ -2919,8 +2895,6 @@ test "symlinkat" { | ... | @@ -2919,8 +2895,6 @@ test "symlinkat" { |
| 2919 | test "linkat" { | 2895 | test "linkat" { |
| 2920 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 2896 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2921 | 2897 | ||
| 2922 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2923 | |||
| 2924 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { | 2898 | var ring = IO_Uring.init(1, 0) catch |err| switch (err) { |
| 2925 | error.SystemOutdated => return error.SkipZigTest, | 2899 | error.SystemOutdated => return error.SkipZigTest, |
| 2926 | error.PermissionDenied => return error.SkipZigTest, | 2900 | error.PermissionDenied => return error.SkipZigTest, |
lib/std/os/linux/test.zig-6| ... | @@ -8,8 +8,6 @@ const expectEqual = std.testing.expectEqual; | ... | @@ -8,8 +8,6 @@ const expectEqual = std.testing.expectEqual; |
| 8 | const fs = std.fs; | 8 | const fs = std.fs; |
| 9 | 9 | ||
| 10 | test "fallocate" { | 10 | test "fallocate" { |
| 11 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 12 | |||
| 13 | var tmp = std.testing.tmpDir(.{}); | 11 | var tmp = std.testing.tmpDir(.{}); |
| 14 | defer tmp.cleanup(); | 12 | defer tmp.cleanup(); |
| 15 | 13 | ||
| ... | @@ -71,8 +69,6 @@ test "timer" { | ... | @@ -71,8 +69,6 @@ test "timer" { |
| 71 | } | 69 | } |
| 72 | 70 | ||
| 73 | test "statx" { | 71 | test "statx" { |
| 74 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 75 | |||
| 76 | var tmp = std.testing.tmpDir(.{}); | 72 | var tmp = std.testing.tmpDir(.{}); |
| 77 | defer tmp.cleanup(); | 73 | defer tmp.cleanup(); |
| 78 | 74 | ||
| ... | @@ -111,8 +107,6 @@ test "user and group ids" { | ... | @@ -111,8 +107,6 @@ test "user and group ids" { |
| 111 | } | 107 | } |
| 112 | 108 | ||
| 113 | test "fadvise" { | 109 | test "fadvise" { |
| 114 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 115 | |||
| 116 | var tmp = std.testing.tmpDir(.{}); | 110 | var tmp = std.testing.tmpDir(.{}); |
| 117 | defer tmp.cleanup(); | 111 | defer tmp.cleanup(); |
| 118 | 112 |
lib/std/os/test.zig-42| ... | @@ -88,8 +88,6 @@ test "chdir smoke test" { | ... | @@ -88,8 +88,6 @@ test "chdir smoke test" { |
| 88 | test "open smoke test" { | 88 | test "open smoke test" { |
| 89 | if (native_os == .wasi) return error.SkipZigTest; | 89 | if (native_os == .wasi) return error.SkipZigTest; |
| 90 | 90 | ||
| 91 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 92 | |||
| 93 | // TODO verify file attributes using `fstat` | 91 | // TODO verify file attributes using `fstat` |
| 94 | 92 | ||
| 95 | var tmp = tmpDir(.{}); | 93 | var tmp = tmpDir(.{}); |
| ... | @@ -144,8 +142,6 @@ test "open smoke test" { | ... | @@ -144,8 +142,6 @@ test "open smoke test" { |
| 144 | test "openat smoke test" { | 142 | test "openat smoke test" { |
| 145 | if (native_os == .wasi and builtin.link_libc) return error.SkipZigTest; | 143 | if (native_os == .wasi and builtin.link_libc) return error.SkipZigTest; |
| 146 | 144 | ||
| 147 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 148 | |||
| 149 | // TODO verify file attributes using `fstatat` | 145 | // TODO verify file attributes using `fstatat` |
| 150 | 146 | ||
| 151 | var tmp = tmpDir(.{}); | 147 | var tmp = tmpDir(.{}); |
| ... | @@ -280,8 +276,6 @@ test "link with relative paths" { | ... | @@ -280,8 +276,6 @@ test "link with relative paths" { |
| 280 | test "linkat with different directories" { | 276 | test "linkat with different directories" { |
| 281 | if (native_os == .wasi and builtin.link_libc) return error.SkipZigTest; | 277 | if (native_os == .wasi and builtin.link_libc) return error.SkipZigTest; |
| 282 | 278 | ||
| 283 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 284 | |||
| 285 | switch (native_os) { | 279 | switch (native_os) { |
| 286 | .wasi, .linux, .solaris, .illumos => {}, | 280 | .wasi, .linux, .solaris, .illumos => {}, |
| 287 | else => return error.SkipZigTest, | 281 | else => return error.SkipZigTest, |
| ... | @@ -327,8 +321,6 @@ test "fstatat" { | ... | @@ -327,8 +321,6 @@ test "fstatat" { |
| 327 | // enable when `fstat` and `fstatat` are implemented on Windows | 321 | // enable when `fstat` and `fstatat` are implemented on Windows |
| 328 | if (native_os == .windows) return error.SkipZigTest; | 322 | if (native_os == .windows) return error.SkipZigTest; |
| 329 | 323 | ||
| 330 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 331 | |||
| 332 | var tmp = tmpDir(.{}); | 324 | var tmp = tmpDir(.{}); |
| 333 | defer tmp.cleanup(); | 325 | defer tmp.cleanup(); |
| 334 | 326 | ||
| ... | @@ -348,8 +340,6 @@ test "fstatat" { | ... | @@ -348,8 +340,6 @@ test "fstatat" { |
| 348 | } | 340 | } |
| 349 | 341 | ||
| 350 | test "readlinkat" { | 342 | test "readlinkat" { |
| 351 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 352 | |||
| 353 | var tmp = tmpDir(.{}); | 343 | var tmp = tmpDir(.{}); |
| 354 | defer tmp.cleanup(); | 344 | defer tmp.cleanup(); |
| 355 | 345 | ||
| ... | @@ -583,8 +573,6 @@ test "mmap" { | ... | @@ -583,8 +573,6 @@ test "mmap" { |
| 583 | if (native_os == .windows or native_os == .wasi) | 573 | if (native_os == .windows or native_os == .wasi) |
| 584 | return error.SkipZigTest; | 574 | return error.SkipZigTest; |
| 585 | 575 | ||
| 586 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 587 | |||
| 588 | var tmp = tmpDir(.{}); | 576 | var tmp = tmpDir(.{}); |
| 589 | defer tmp.cleanup(); | 577 | defer tmp.cleanup(); |
| 590 | 578 | ||
| ... | @@ -695,8 +683,6 @@ test "fcntl" { | ... | @@ -695,8 +683,6 @@ test "fcntl" { |
| 695 | if (native_os == .windows or native_os == .wasi) | 683 | if (native_os == .windows or native_os == .wasi) |
| 696 | return error.SkipZigTest; | 684 | return error.SkipZigTest; |
| 697 | 685 | ||
| 698 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 699 | |||
| 700 | var tmp = tmpDir(.{}); | 686 | var tmp = tmpDir(.{}); |
| 701 | defer tmp.cleanup(); | 687 | defer tmp.cleanup(); |
| 702 | 688 | ||
| ... | @@ -737,8 +723,6 @@ test "sync" { | ... | @@ -737,8 +723,6 @@ test "sync" { |
| 737 | if (native_os != .linux) | 723 | if (native_os != .linux) |
| 738 | return error.SkipZigTest; | 724 | return error.SkipZigTest; |
| 739 | 725 | ||
| 740 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 741 | |||
| 742 | var tmp = tmpDir(.{}); | 726 | var tmp = tmpDir(.{}); |
| 743 | defer tmp.cleanup(); | 727 | defer tmp.cleanup(); |
| 744 | 728 | ||
| ... | @@ -759,8 +743,6 @@ test "fsync" { | ... | @@ -759,8 +743,6 @@ test "fsync" { |
| 759 | else => return error.SkipZigTest, | 743 | else => return error.SkipZigTest, |
| 760 | } | 744 | } |
| 761 | 745 | ||
| 762 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 763 | |||
| 764 | var tmp = tmpDir(.{}); | 746 | var tmp = tmpDir(.{}); |
| 765 | defer tmp.cleanup(); | 747 | defer tmp.cleanup(); |
| 766 | 748 | ||
| ... | @@ -780,8 +762,6 @@ test "getrlimit and setrlimit" { | ... | @@ -780,8 +762,6 @@ test "getrlimit and setrlimit" { |
| 780 | return error.SkipZigTest; | 762 | return error.SkipZigTest; |
| 781 | } | 763 | } |
| 782 | 764 | ||
| 783 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 784 | |||
| 785 | inline for (std.meta.fields(os.rlimit_resource)) |field| { | 765 | inline for (std.meta.fields(os.rlimit_resource)) |field| { |
| 786 | const resource = @as(os.rlimit_resource, @enumFromInt(field.value)); | 766 | const resource = @as(os.rlimit_resource, @enumFromInt(field.value)); |
| 787 | const limit = try os.getrlimit(resource); | 767 | const limit = try os.getrlimit(resource); |
| ... | @@ -903,8 +883,6 @@ test "dup & dup2" { | ... | @@ -903,8 +883,6 @@ test "dup & dup2" { |
| 903 | else => return error.SkipZigTest, | 883 | else => return error.SkipZigTest, |
| 904 | } | 884 | } |
| 905 | 885 | ||
| 906 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 907 | |||
| 908 | var tmp = tmpDir(.{}); | 886 | var tmp = tmpDir(.{}); |
| 909 | defer tmp.cleanup(); | 887 | defer tmp.cleanup(); |
| 910 | 888 | ||
| ... | @@ -934,8 +912,6 @@ test "dup & dup2" { | ... | @@ -934,8 +912,6 @@ test "dup & dup2" { |
| 934 | test "writev longer than IOV_MAX" { | 912 | test "writev longer than IOV_MAX" { |
| 935 | if (native_os == .windows or native_os == .wasi) return error.SkipZigTest; | 913 | if (native_os == .windows or native_os == .wasi) return error.SkipZigTest; |
| 936 | 914 | ||
| 937 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 938 | |||
| 939 | var tmp = tmpDir(.{}); | 915 | var tmp = tmpDir(.{}); |
| 940 | defer tmp.cleanup(); | 916 | defer tmp.cleanup(); |
| 941 | 917 | ||
| ... | @@ -953,8 +929,6 @@ test "POSIX file locking with fcntl" { | ... | @@ -953,8 +929,6 @@ test "POSIX file locking with fcntl" { |
| 953 | return error.SkipZigTest; | 929 | return error.SkipZigTest; |
| 954 | } | 930 | } |
| 955 | 931 | ||
| 956 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 957 | |||
| 958 | if (true) { | 932 | if (true) { |
| 959 | // https://github.com/ziglang/zig/issues/11074 | 933 | // https://github.com/ziglang/zig/issues/11074 |
| 960 | return error.SkipZigTest; | 934 | return error.SkipZigTest; |
| ... | @@ -1017,8 +991,6 @@ test "POSIX file locking with fcntl" { | ... | @@ -1017,8 +991,6 @@ test "POSIX file locking with fcntl" { |
| 1017 | test "rename smoke test" { | 991 | test "rename smoke test" { |
| 1018 | if (native_os == .wasi) return error.SkipZigTest; | 992 | if (native_os == .wasi) return error.SkipZigTest; |
| 1019 | 993 | ||
| 1020 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1021 | |||
| 1022 | var tmp = tmpDir(.{}); | 994 | var tmp = tmpDir(.{}); |
| 1023 | defer tmp.cleanup(); | 995 | defer tmp.cleanup(); |
| 1024 | 996 | ||
| ... | @@ -1075,8 +1047,6 @@ test "rename smoke test" { | ... | @@ -1075,8 +1047,6 @@ test "rename smoke test" { |
| 1075 | test "access smoke test" { | 1047 | test "access smoke test" { |
| 1076 | if (native_os == .wasi) return error.SkipZigTest; | 1048 | if (native_os == .wasi) return error.SkipZigTest; |
| 1077 | 1049 | ||
| 1078 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1079 | |||
| 1080 | var tmp = tmpDir(.{}); | 1050 | var tmp = tmpDir(.{}); |
| 1081 | defer tmp.cleanup(); | 1051 | defer tmp.cleanup(); |
| 1082 | 1052 | ||
| ... | @@ -1141,8 +1111,6 @@ test "timerfd" { | ... | @@ -1141,8 +1111,6 @@ test "timerfd" { |
| 1141 | } | 1111 | } |
| 1142 | 1112 | ||
| 1143 | test "isatty" { | 1113 | test "isatty" { |
| 1144 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1145 | |||
| 1146 | var tmp = tmpDir(.{}); | 1114 | var tmp = tmpDir(.{}); |
| 1147 | defer tmp.cleanup(); | 1115 | defer tmp.cleanup(); |
| 1148 | 1116 | ||
| ... | @@ -1155,8 +1123,6 @@ test "isatty" { | ... | @@ -1155,8 +1123,6 @@ test "isatty" { |
| 1155 | test "read with empty buffer" { | 1123 | test "read with empty buffer" { |
| 1156 | if (native_os == .wasi) return error.SkipZigTest; | 1124 | if (native_os == .wasi) return error.SkipZigTest; |
| 1157 | 1125 | ||
| 1158 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1159 | |||
| 1160 | var tmp = tmpDir(.{}); | 1126 | var tmp = tmpDir(.{}); |
| 1161 | defer tmp.cleanup(); | 1127 | defer tmp.cleanup(); |
| 1162 | 1128 | ||
| ... | @@ -1182,8 +1148,6 @@ test "read with empty buffer" { | ... | @@ -1182,8 +1148,6 @@ test "read with empty buffer" { |
| 1182 | test "pread with empty buffer" { | 1148 | test "pread with empty buffer" { |
| 1183 | if (native_os == .wasi) return error.SkipZigTest; | 1149 | if (native_os == .wasi) return error.SkipZigTest; |
| 1184 | 1150 | ||
| 1185 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1186 | |||
| 1187 | var tmp = tmpDir(.{}); | 1151 | var tmp = tmpDir(.{}); |
| 1188 | defer tmp.cleanup(); | 1152 | defer tmp.cleanup(); |
| 1189 | 1153 | ||
| ... | @@ -1209,8 +1173,6 @@ test "pread with empty buffer" { | ... | @@ -1209,8 +1173,6 @@ test "pread with empty buffer" { |
| 1209 | test "write with empty buffer" { | 1173 | test "write with empty buffer" { |
| 1210 | if (native_os == .wasi) return error.SkipZigTest; | 1174 | if (native_os == .wasi) return error.SkipZigTest; |
| 1211 | 1175 | ||
| 1212 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1213 | |||
| 1214 | var tmp = tmpDir(.{}); | 1176 | var tmp = tmpDir(.{}); |
| 1215 | defer tmp.cleanup(); | 1177 | defer tmp.cleanup(); |
| 1216 | 1178 | ||
| ... | @@ -1236,8 +1198,6 @@ test "write with empty buffer" { | ... | @@ -1236,8 +1198,6 @@ test "write with empty buffer" { |
| 1236 | test "pwrite with empty buffer" { | 1198 | test "pwrite with empty buffer" { |
| 1237 | if (native_os == .wasi) return error.SkipZigTest; | 1199 | if (native_os == .wasi) return error.SkipZigTest; |
| 1238 | 1200 | ||
| 1239 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1240 | |||
| 1241 | var tmp = tmpDir(.{}); | 1201 | var tmp = tmpDir(.{}); |
| 1242 | defer tmp.cleanup(); | 1202 | defer tmp.cleanup(); |
| 1243 | 1203 | ||
| ... | @@ -1263,8 +1223,6 @@ test "pwrite with empty buffer" { | ... | @@ -1263,8 +1223,6 @@ test "pwrite with empty buffer" { |
| 1263 | test "fchmodat smoke test" { | 1223 | test "fchmodat smoke test" { |
| 1264 | if (!std.fs.has_executable_bit) return error.SkipZigTest; | 1224 | if (!std.fs.has_executable_bit) return error.SkipZigTest; |
| 1265 | 1225 | ||
| 1266 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 1267 | |||
| 1268 | var tmp = tmpDir(.{}); | 1226 | var tmp = tmpDir(.{}); |
| 1269 | defer tmp.cleanup(); | 1227 | defer tmp.cleanup(); |
| 1270 | 1228 |
lib/std/os/windows.zig-2| ... | @@ -2491,8 +2491,6 @@ pub fn ntToWin32Namespace(path: []const u16) !PathSpace { | ... | @@ -2491,8 +2491,6 @@ pub fn ntToWin32Namespace(path: []const u16) !PathSpace { |
| 2491 | } | 2491 | } |
| 2492 | 2492 | ||
| 2493 | test "ntToWin32Namespace" { | 2493 | test "ntToWin32Namespace" { |
| 2494 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 2495 | |||
| 2496 | const L = std.unicode.utf8ToUtf16LeStringLiteral; | 2494 | const L = std.unicode.utf8ToUtf16LeStringLiteral; |
| 2497 | 2495 | ||
| 2498 | try testNtToWin32Namespace(L("UNC"), L("\\??\\UNC")); | 2496 | try testNtToWin32Namespace(L("UNC"), L("\\??\\UNC")); |
lib/std/priority_dequeue.zig-2| ... | @@ -705,8 +705,6 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 1" { | ... | @@ -705,8 +705,6 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 1" { |
| 705 | } | 705 | } |
| 706 | 706 | ||
| 707 | test "std.PriorityDequeue: fromOwnedSlice" { | 707 | test "std.PriorityDequeue: fromOwnedSlice" { |
| 708 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 709 | |||
| 710 | const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; | 708 | const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; |
| 711 | const queue_items = try testing.allocator.dupe(u32, items[0..]); | 709 | const queue_items = try testing.allocator.dupe(u32, items[0..]); |
| 712 | var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {}); | 710 | var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {}); |
lib/std/priority_queue.zig-2| ... | @@ -385,8 +385,6 @@ test "std.PriorityQueue: fromOwnedSlice trivial case 1" { | ... | @@ -385,8 +385,6 @@ test "std.PriorityQueue: fromOwnedSlice trivial case 1" { |
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | test "std.PriorityQueue: fromOwnedSlice" { | 387 | test "std.PriorityQueue: fromOwnedSlice" { |
| 388 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 389 | |||
| 390 | const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; | 388 | const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; |
| 391 | const heap_items = try testing.allocator.dupe(u32, items[0..]); | 389 | const heap_items = try testing.allocator.dupe(u32, items[0..]); |
| 392 | var queue = PQlt.fromOwnedSlice(testing.allocator, heap_items[0..], {}); | 390 | var queue = PQlt.fromOwnedSlice(testing.allocator, heap_items[0..], {}); |
lib/std/time.zig-2| ... | @@ -321,8 +321,6 @@ pub const Timer = struct { | ... | @@ -321,8 +321,6 @@ pub const Timer = struct { |
| 321 | }; | 321 | }; |
| 322 | 322 | ||
| 323 | test "Timer + Instant" { | 323 | test "Timer + Instant" { |
| 324 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 325 | |||
| 326 | const margin = ns_per_ms * 150; | 324 | const margin = ns_per_ms * 150; |
| 327 | 325 | ||
| 328 | var timer = try Timer.start(); | 326 | var timer = try Timer.start(); |
src/arch/x86_64/CodeGen.zig+339-187| ... | @@ -1460,7 +1460,10 @@ fn asmRegisterRegisterRegisterImmediate( | ... | @@ -1460,7 +1460,10 @@ fn asmRegisterRegisterRegisterImmediate( |
| 1460 | .r1 = reg1, | 1460 | .r1 = reg1, |
| 1461 | .r2 = reg2, | 1461 | .r2 = reg2, |
| 1462 | .r3 = reg3, | 1462 | .r3 = reg3, |
| 1463 | .i = @as(u8, @intCast(imm.unsigned)), | 1463 | .i = switch (imm) { |
| 1464 | .signed => |s| @bitCast(@as(i8, @intCast(s))), | ||
| 1465 | .unsigned => |u| @intCast(u), | ||
| 1466 | }, | ||
| 1464 | } }, | 1467 | } }, |
| 1465 | }); | 1468 | }); |
| 1466 | } | 1469 | } |
| ... | @@ -2084,7 +2087,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -2084,7 +2087,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 2084 | .get_union_tag => try self.airGetUnionTag(inst), | 2087 | .get_union_tag => try self.airGetUnionTag(inst), |
| 2085 | .clz => try self.airClz(inst), | 2088 | .clz => try self.airClz(inst), |
| 2086 | .ctz => try self.airCtz(inst), | 2089 | .ctz => try self.airCtz(inst), |
| 2087 | .popcount => try self.airPopcount(inst), | 2090 | .popcount => try self.airPopCount(inst), |
| 2088 | .byte_swap => try self.airByteSwap(inst), | 2091 | .byte_swap => try self.airByteSwap(inst), |
| 2089 | .bit_reverse => try self.airBitReverse(inst), | 2092 | .bit_reverse => try self.airBitReverse(inst), |
| 2090 | .tag_name => try self.airTagName(inst), | 2093 | .tag_name => try self.airTagName(inst), |
| ... | @@ -3019,11 +3022,8 @@ fn airTrunc(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -3019,11 +3022,8 @@ fn airTrunc(self: *Self, inst: Air.Inst.Index) !void { |
| 3019 | else if (dst_abi_size <= 8) | 3022 | else if (dst_abi_size <= 8) |
| 3020 | try self.copyToRegisterWithInstTracking(inst, dst_ty, src_mcv) | 3023 | try self.copyToRegisterWithInstTracking(inst, dst_ty, src_mcv) |
| 3021 | else if (dst_abi_size <= 16) dst: { | 3024 | else if (dst_abi_size <= 16) dst: { |
| 3022 | const dst_regs = try self.register_manager.allocRegs( | 3025 | const dst_regs = |
| 3023 | 2, | 3026 | try self.register_manager.allocRegs(2, .{ inst, inst }, abi.RegisterClass.gp); |
| 3024 | .{ inst, inst }, | ||
| 3025 | abi.RegisterClass.gp, | ||
| 3026 | ); | ||
| 3027 | const dst_mcv: MCValue = .{ .register_pair = dst_regs }; | 3027 | const dst_mcv: MCValue = .{ .register_pair = dst_regs }; |
| 3028 | const dst_locks = self.register_manager.lockRegsAssumeUnused(2, dst_regs); | 3028 | const dst_locks = self.register_manager.lockRegsAssumeUnused(2, dst_regs); |
| 3029 | defer for (dst_locks) |lock| self.register_manager.unlockReg(lock); | 3029 | defer for (dst_locks) |lock| self.register_manager.unlockReg(lock); |
| ... | @@ -4671,6 +4671,19 @@ fn airClz(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -4671,6 +4671,19 @@ fn airClz(self: *Self, inst: Air.Inst.Index) !void { |
| 4671 | if (src_ty.zigTypeTag(mod) == .Vector) return self.fail("TODO implement airClz for {}", .{ | 4671 | if (src_ty.zigTypeTag(mod) == .Vector) return self.fail("TODO implement airClz for {}", .{ |
| 4672 | src_ty.fmt(mod), | 4672 | src_ty.fmt(mod), |
| 4673 | }); | 4673 | }); |
| 4674 | const src_bits: u32 = @intCast(src_ty.bitSize(mod)); | ||
| 4675 | |||
| 4676 | const has_lzcnt = self.hasFeature(.lzcnt); | ||
| 4677 | if (src_bits > 64 and !has_lzcnt) { | ||
| 4678 | var callee_buf: ["__clz?i2".len]u8 = undefined; | ||
| 4679 | break :result try self.genCall(.{ .lib = .{ | ||
| 4680 | .return_type = .i32_type, | ||
| 4681 | .param_types = &.{src_ty.toIntern()}, | ||
| 4682 | .callee = std.fmt.bufPrint(&callee_buf, "__clz{c}i2", .{ | ||
| 4683 | intCompilerRtAbiName(src_bits), | ||
| 4684 | }) catch unreachable, | ||
| 4685 | } }, &.{src_ty}, &.{.{ .air_ref = ty_op.operand }}); | ||
| 4686 | } | ||
| 4674 | 4687 | ||
| 4675 | const src_mcv = try self.resolveInst(ty_op.operand); | 4688 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 4676 | const mat_src_mcv = switch (src_mcv) { | 4689 | const mat_src_mcv = switch (src_mcv) { |
| ... | @@ -4688,8 +4701,7 @@ fn airClz(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -4688,8 +4701,7 @@ fn airClz(self: *Self, inst: Air.Inst.Index) !void { |
| 4688 | const dst_lock = self.register_manager.lockRegAssumeUnused(dst_reg); | 4701 | const dst_lock = self.register_manager.lockRegAssumeUnused(dst_reg); |
| 4689 | defer self.register_manager.unlockReg(dst_lock); | 4702 | defer self.register_manager.unlockReg(dst_lock); |
| 4690 | 4703 | ||
| 4691 | const src_bits = src_ty.bitSize(mod); | 4704 | if (has_lzcnt) { |
| 4692 | if (self.hasFeature(.lzcnt)) { | ||
| 4693 | if (src_bits <= 8) { | 4705 | if (src_bits <= 8) { |
| 4694 | const wide_reg = try self.copyToTmpRegister(src_ty, mat_src_mcv); | 4706 | const wide_reg = try self.copyToTmpRegister(src_ty, mat_src_mcv); |
| 4695 | try self.truncateRegister(src_ty, wide_reg); | 4707 | try self.truncateRegister(src_ty, wide_reg); |
| ... | @@ -4712,24 +4724,33 @@ fn airClz(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -4712,24 +4724,33 @@ fn airClz(self: *Self, inst: Air.Inst.Index) !void { |
| 4712 | const tmp_lock = self.register_manager.lockRegAssumeUnused(tmp_reg); | 4724 | const tmp_lock = self.register_manager.lockRegAssumeUnused(tmp_reg); |
| 4713 | defer self.register_manager.unlockReg(tmp_lock); | 4725 | defer self.register_manager.unlockReg(tmp_lock); |
| 4714 | 4726 | ||
| 4715 | try self.genBinOpMir(.{ ._, .lzcnt }, Type.u64, dst_mcv, mat_src_mcv); | 4727 | try self.genBinOpMir( |
| 4728 | .{ ._, .lzcnt }, | ||
| 4729 | Type.u64, | ||
| 4730 | dst_mcv, | ||
| 4731 | if (mat_src_mcv.isMemory()) | ||
| 4732 | mat_src_mcv | ||
| 4733 | else | ||
| 4734 | .{ .register = mat_src_mcv.register_pair[0] }, | ||
| 4735 | ); | ||
| 4716 | try self.genBinOpMir(.{ ._, .add }, dst_ty, dst_mcv, .{ .immediate = 64 }); | 4736 | try self.genBinOpMir(.{ ._, .add }, dst_ty, dst_mcv, .{ .immediate = 64 }); |
| 4717 | try self.genBinOpMir( | 4737 | try self.genBinOpMir( |
| 4718 | .{ ._, .lzcnt }, | 4738 | .{ ._, .lzcnt }, |
| 4719 | Type.u64, | 4739 | Type.u64, |
| 4720 | tmp_mcv, | 4740 | tmp_mcv, |
| 4721 | mat_src_mcv.address().offset(8).deref(), | 4741 | if (mat_src_mcv.isMemory()) |
| 4742 | mat_src_mcv.address().offset(8).deref() | ||
| 4743 | else | ||
| 4744 | .{ .register = mat_src_mcv.register_pair[1] }, | ||
| 4722 | ); | 4745 | ); |
| 4723 | try self.asmCmovccRegisterRegister(.nc, dst_reg.to32(), tmp_reg.to32()); | 4746 | try self.asmCmovccRegisterRegister(.nc, dst_reg.to32(), tmp_reg.to32()); |
| 4724 | 4747 | ||
| 4725 | if (src_bits < 128) { | 4748 | if (src_bits < 128) try self.genBinOpMir( |
| 4726 | try self.genBinOpMir( | 4749 | .{ ._, .sub }, |
| 4727 | .{ ._, .sub }, | 4750 | dst_ty, |
| 4728 | dst_ty, | 4751 | dst_mcv, |
| 4729 | dst_mcv, | 4752 | .{ .immediate = 128 - src_bits }, |
| 4730 | .{ .immediate = 128 - src_bits }, | 4753 | ); |
| 4731 | ); | ||
| 4732 | } | ||
| 4733 | } else return self.fail("TODO airClz of {}", .{src_ty.fmt(mod)}); | 4754 | } else return self.fail("TODO airClz of {}", .{src_ty.fmt(mod)}); |
| 4734 | break :result dst_mcv; | 4755 | break :result dst_mcv; |
| 4735 | } | 4756 | } |
| ... | @@ -4800,7 +4821,22 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -4800,7 +4821,22 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { |
| 4800 | const result = result: { | 4821 | const result = result: { |
| 4801 | const dst_ty = self.typeOfIndex(inst); | 4822 | const dst_ty = self.typeOfIndex(inst); |
| 4802 | const src_ty = self.typeOf(ty_op.operand); | 4823 | const src_ty = self.typeOf(ty_op.operand); |
| 4803 | const src_bits = src_ty.bitSize(mod); | 4824 | if (src_ty.zigTypeTag(mod) == .Vector) return self.fail("TODO implement airClz for {}", .{ |
| 4825 | src_ty.fmt(mod), | ||
| 4826 | }); | ||
| 4827 | const src_bits: u32 = @intCast(src_ty.bitSize(mod)); | ||
| 4828 | |||
| 4829 | const has_bmi = self.hasFeature(.bmi); | ||
| 4830 | if (src_bits > 64 and !has_bmi) { | ||
| 4831 | var callee_buf: ["__ctz?i2".len]u8 = undefined; | ||
| 4832 | break :result try self.genCall(.{ .lib = .{ | ||
| 4833 | .return_type = .i32_type, | ||
| 4834 | .param_types = &.{src_ty.toIntern()}, | ||
| 4835 | .callee = std.fmt.bufPrint(&callee_buf, "__ctz{c}i2", .{ | ||
| 4836 | intCompilerRtAbiName(src_bits), | ||
| 4837 | }) catch unreachable, | ||
| 4838 | } }, &.{src_ty}, &.{.{ .air_ref = ty_op.operand }}); | ||
| 4839 | } | ||
| 4804 | 4840 | ||
| 4805 | const src_mcv = try self.resolveInst(ty_op.operand); | 4841 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 4806 | const mat_src_mcv = switch (src_mcv) { | 4842 | const mat_src_mcv = switch (src_mcv) { |
| ... | @@ -4845,8 +4881,16 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -4845,8 +4881,16 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { |
| 4845 | const tmp_lock = self.register_manager.lockRegAssumeUnused(tmp_reg); | 4881 | const tmp_lock = self.register_manager.lockRegAssumeUnused(tmp_reg); |
| 4846 | defer self.register_manager.unlockReg(tmp_lock); | 4882 | defer self.register_manager.unlockReg(tmp_lock); |
| 4847 | 4883 | ||
| 4884 | const lo_mat_src_mcv: MCValue = if (mat_src_mcv.isMemory()) | ||
| 4885 | mat_src_mcv | ||
| 4886 | else | ||
| 4887 | .{ .register = mat_src_mcv.register_pair[0] }; | ||
| 4888 | const hi_mat_src_mcv: MCValue = if (mat_src_mcv.isMemory()) | ||
| 4889 | mat_src_mcv.address().offset(8).deref() | ||
| 4890 | else | ||
| 4891 | .{ .register = mat_src_mcv.register_pair[1] }; | ||
| 4848 | const masked_mcv = if (src_bits < 128) masked: { | 4892 | const masked_mcv = if (src_bits < 128) masked: { |
| 4849 | try self.genCopy(Type.u64, dst_mcv, mat_src_mcv.address().offset(8).deref()); | 4893 | try self.genCopy(Type.u64, dst_mcv, hi_mat_src_mcv); |
| 4850 | try self.genBinOpMir( | 4894 | try self.genBinOpMir( |
| 4851 | .{ ._, .@"or" }, | 4895 | .{ ._, .@"or" }, |
| 4852 | Type.u64, | 4896 | Type.u64, |
| ... | @@ -4854,10 +4898,10 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -4854,10 +4898,10 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { |
| 4854 | .{ .immediate = @as(u64, math.maxInt(u64)) << @intCast(src_bits - 64) }, | 4898 | .{ .immediate = @as(u64, math.maxInt(u64)) << @intCast(src_bits - 64) }, |
| 4855 | ); | 4899 | ); |
| 4856 | break :masked dst_mcv; | 4900 | break :masked dst_mcv; |
| 4857 | } else mat_src_mcv.address().offset(8).deref(); | 4901 | } else hi_mat_src_mcv; |
| 4858 | try self.genBinOpMir(.{ ._, .tzcnt }, Type.u64, dst_mcv, masked_mcv); | 4902 | try self.genBinOpMir(.{ ._, .tzcnt }, Type.u64, dst_mcv, masked_mcv); |
| 4859 | try self.genBinOpMir(.{ ._, .add }, dst_ty, dst_mcv, .{ .immediate = 64 }); | 4903 | try self.genBinOpMir(.{ ._, .add }, dst_ty, dst_mcv, .{ .immediate = 64 }); |
| 4860 | try self.genBinOpMir(.{ ._, .tzcnt }, Type.u64, tmp_mcv, mat_src_mcv); | 4904 | try self.genBinOpMir(.{ ._, .tzcnt }, Type.u64, tmp_mcv, lo_mat_src_mcv); |
| 4861 | try self.asmCmovccRegisterRegister(.nc, dst_reg.to32(), tmp_reg.to32()); | 4905 | try self.asmCmovccRegisterRegister(.nc, dst_reg.to32(), tmp_reg.to32()); |
| 4862 | } else return self.fail("TODO airCtz of {}", .{src_ty.fmt(mod)}); | 4906 | } else return self.fail("TODO airCtz of {}", .{src_ty.fmt(mod)}); |
| 4863 | break :result dst_mcv; | 4907 | break :result dst_mcv; |
| ... | @@ -4889,155 +4933,216 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -4889,155 +4933,216 @@ fn airCtz(self: *Self, inst: Air.Inst.Index) !void { |
| 4889 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); | 4933 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| 4890 | } | 4934 | } |
| 4891 | 4935 | ||
| 4892 | fn airPopcount(self: *Self, inst: Air.Inst.Index) !void { | 4936 | fn airPopCount(self: *Self, inst: Air.Inst.Index) !void { |
| 4893 | const mod = self.bin_file.options.module.?; | 4937 | const mod = self.bin_file.options.module.?; |
| 4894 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; | 4938 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 4895 | const result: MCValue = result: { | 4939 | const result: MCValue = result: { |
| 4940 | try self.spillEflagsIfOccupied(); | ||
| 4941 | |||
| 4896 | const src_ty = self.typeOf(ty_op.operand); | 4942 | const src_ty = self.typeOf(ty_op.operand); |
| 4897 | const src_abi_size: u32 = @intCast(src_ty.abiSize(mod)); | 4943 | const src_abi_size: u32 = @intCast(src_ty.abiSize(mod)); |
| 4898 | if (src_ty.zigTypeTag(mod) == .Vector or src_abi_size > 8) | 4944 | if (src_ty.zigTypeTag(mod) == .Vector or src_abi_size > 16) |
| 4899 | return self.fail("TODO implement airPopcount for {}", .{src_ty.fmt(mod)}); | 4945 | return self.fail("TODO implement airPopCount for {}", .{src_ty.fmt(mod)}); |
| 4900 | const src_mcv = try self.resolveInst(ty_op.operand); | 4946 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 4901 | 4947 | ||
| 4902 | if (self.hasFeature(.popcnt)) { | 4948 | const mat_src_mcv = switch (src_mcv) { |
| 4903 | const mat_src_mcv = switch (src_mcv) { | 4949 | .immediate => MCValue{ .register = try self.copyToTmpRegister(src_ty, src_mcv) }, |
| 4904 | .immediate => MCValue{ .register = try self.copyToTmpRegister(src_ty, src_mcv) }, | 4950 | else => src_mcv, |
| 4905 | else => src_mcv, | 4951 | }; |
| 4906 | }; | 4952 | const mat_src_lock = switch (mat_src_mcv) { |
| 4907 | const mat_src_lock = switch (mat_src_mcv) { | 4953 | .register => |reg| self.register_manager.lockReg(reg), |
| 4908 | .register => |reg| self.register_manager.lockReg(reg), | 4954 | else => null, |
| 4909 | else => null, | 4955 | }; |
| 4910 | }; | 4956 | defer if (mat_src_lock) |lock| self.register_manager.unlockReg(lock); |
| 4911 | defer if (mat_src_lock) |lock| self.register_manager.unlockReg(lock); | ||
| 4912 | 4957 | ||
| 4913 | const dst_mcv: MCValue = | 4958 | if (src_abi_size <= 8) { |
| 4914 | if (src_mcv.isRegister() and self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) | 4959 | const dst_contains_src = |
| 4915 | src_mcv | 4960 | src_mcv.isRegister() and self.reuseOperand(inst, ty_op.operand, 0, src_mcv); |
| 4961 | const dst_reg = if (dst_contains_src) | ||
| 4962 | src_mcv.getReg().? | ||
| 4916 | else | 4963 | else |
| 4917 | .{ .register = try self.register_manager.allocReg(inst, abi.RegisterClass.gp) }; | 4964 | try self.register_manager.allocReg(inst, abi.RegisterClass.gp); |
| 4965 | const dst_lock = self.register_manager.lockReg(dst_reg); | ||
| 4966 | defer if (dst_lock) |lock| self.register_manager.unlockReg(lock); | ||
| 4918 | 4967 | ||
| 4919 | const popcnt_ty = if (src_abi_size > 1) src_ty else Type.u16; | 4968 | try self.genPopCount(dst_reg, src_ty, mat_src_mcv, dst_contains_src); |
| 4920 | try self.genBinOpMir(.{ ._, .popcnt }, popcnt_ty, dst_mcv, mat_src_mcv); | 4969 | break :result .{ .register = dst_reg }; |
| 4921 | break :result dst_mcv; | ||
| 4922 | } | 4970 | } |
| 4923 | 4971 | ||
| 4924 | const mask = @as(u64, math.maxInt(u64)) >> @intCast(64 - src_abi_size * 8); | 4972 | assert(src_abi_size > 8 and src_abi_size <= 16); |
| 4925 | const imm_0_1 = Immediate.u(mask / 0b1_1); | 4973 | const tmp_regs = try self.register_manager.allocRegs(2, .{ inst, null }, abi.RegisterClass.gp); |
| 4926 | const imm_00_11 = Immediate.u(mask / 0b01_01); | 4974 | const tmp_locks = self.register_manager.lockRegsAssumeUnused(2, tmp_regs); |
| 4927 | const imm_0000_1111 = Immediate.u(mask / 0b0001_0001); | 4975 | defer for (tmp_locks) |lock| self.register_manager.unlockReg(lock); |
| 4928 | const imm_0000_0001 = Immediate.u(mask / 0b1111_1111); | ||
| 4929 | 4976 | ||
| 4930 | const dst_mcv = if (src_mcv.isRegister() and self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) | 4977 | try self.genPopCount(tmp_regs[0], Type.usize, if (mat_src_mcv.isMemory()) |
| 4931 | src_mcv | 4978 | mat_src_mcv |
| 4932 | else | 4979 | else |
| 4933 | try self.copyToRegisterWithInstTracking(inst, src_ty, src_mcv); | 4980 | .{ .register = mat_src_mcv.register_pair[0] }, false); |
| 4934 | const dst_reg = dst_mcv.register; | 4981 | try self.genPopCount(tmp_regs[1], Type.usize, if (mat_src_mcv.isMemory()) |
| 4935 | const dst_lock = self.register_manager.lockRegAssumeUnused(dst_reg); | 4982 | mat_src_mcv.address().offset(8).deref() |
| 4936 | defer self.register_manager.unlockReg(dst_lock); | 4983 | else |
| 4984 | .{ .register = mat_src_mcv.register_pair[1] }, false); | ||
| 4985 | try self.asmRegisterRegister(.{ ._, .add }, tmp_regs[0].to8(), tmp_regs[1].to8()); | ||
| 4986 | break :result .{ .register = tmp_regs[0] }; | ||
| 4987 | }; | ||
| 4988 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); | ||
| 4989 | } | ||
| 4937 | 4990 | ||
| 4938 | const tmp_reg = try self.register_manager.allocReg(null, abi.RegisterClass.gp); | 4991 | fn genPopCount( |
| 4939 | const tmp_lock = self.register_manager.lockRegAssumeUnused(tmp_reg); | 4992 | self: *Self, |
| 4940 | defer self.register_manager.unlockReg(tmp_lock); | 4993 | dst_reg: Register, |
| 4994 | src_ty: Type, | ||
| 4995 | src_mcv: MCValue, | ||
| 4996 | dst_contains_src: bool, | ||
| 4997 | ) !void { | ||
| 4998 | const mod = self.bin_file.options.module.?; | ||
| 4941 | 4999 | ||
| 4942 | { | 5000 | const src_abi_size: u32 = @intCast(src_ty.abiSize(mod)); |
| 4943 | const dst = registerAlias(dst_reg, src_abi_size); | 5001 | if (self.hasFeature(.popcnt)) return self.genBinOpMir( |
| 4944 | const tmp = registerAlias(tmp_reg, src_abi_size); | 5002 | .{ ._, .popcnt }, |
| 4945 | const imm = if (src_abi_size > 4) | 5003 | if (src_abi_size > 1) src_ty else Type.u16, |
| 4946 | try self.register_manager.allocReg(null, abi.RegisterClass.gp) | 5004 | .{ .register = dst_reg }, |
| 4947 | else | 5005 | src_mcv, |
| 4948 | undefined; | 5006 | ); |
| 4949 | 5007 | ||
| 4950 | // dst = operand | 5008 | const mask = @as(u64, math.maxInt(u64)) >> @intCast(64 - src_abi_size * 8); |
| 4951 | try self.asmRegisterRegister(.{ ._, .mov }, tmp, dst); | 5009 | const imm_0_1 = Immediate.u(mask / 0b1_1); |
| 4952 | // tmp = operand | 5010 | const imm_00_11 = Immediate.u(mask / 0b01_01); |
| 4953 | try self.asmRegisterImmediate(.{ ._r, .sh }, tmp, Immediate.u(1)); | 5011 | const imm_0000_1111 = Immediate.u(mask / 0b0001_0001); |
| 4954 | // tmp = operand >> 1 | 5012 | const imm_0000_0001 = Immediate.u(mask / 0b1111_1111); |
| 4955 | if (src_abi_size > 4) { | 5013 | |
| 4956 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0_1); | 5014 | const tmp_reg = try self.register_manager.allocReg(null, abi.RegisterClass.gp); |
| 4957 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); | 5015 | const tmp_lock = self.register_manager.lockRegAssumeUnused(tmp_reg); |
| 4958 | } else try self.asmRegisterImmediate(.{ ._, .@"and" }, tmp, imm_0_1); | 5016 | defer self.register_manager.unlockReg(tmp_lock); |
| 4959 | // tmp = (operand >> 1) & 0x55...55 | 5017 | |
| 4960 | try self.asmRegisterRegister(.{ ._, .sub }, dst, tmp); | 5018 | const dst = registerAlias(dst_reg, src_abi_size); |
| 4961 | // dst = temp1 = operand - ((operand >> 1) & 0x55...55) | 5019 | const tmp = registerAlias(tmp_reg, src_abi_size); |
| 4962 | try self.asmRegisterRegister(.{ ._, .mov }, tmp, dst); | 5020 | const imm = if (src_abi_size > 4) |
| 4963 | // tmp = temp1 | 5021 | try self.register_manager.allocReg(null, abi.RegisterClass.gp) |
| 4964 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u(2)); | 5022 | else |
| 4965 | // dst = temp1 >> 2 | 5023 | undefined; |
| 4966 | if (src_abi_size > 4) { | 5024 | |
| 4967 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_00_11); | 5025 | if (!dst_contains_src) try self.genSetReg(dst, src_ty, src_mcv); |
| 4968 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); | 5026 | // dst = operand |
| 4969 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); | 5027 | try self.asmRegisterRegister(.{ ._, .mov }, tmp, dst); |
| 4970 | } else { | 5028 | // tmp = operand |
| 4971 | try self.asmRegisterImmediate(.{ ._, .@"and" }, tmp, imm_00_11); | 5029 | try self.asmRegisterImmediate(.{ ._r, .sh }, tmp, Immediate.u(1)); |
| 4972 | try self.asmRegisterImmediate(.{ ._, .@"and" }, dst, imm_00_11); | 5030 | // tmp = operand >> 1 |
| 4973 | } | 5031 | if (src_abi_size > 4) { |
| 4974 | // tmp = temp1 & 0x33...33 | 5032 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0_1); |
| 4975 | // dst = (temp1 >> 2) & 0x33...33 | 5033 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); |
| 4976 | try self.asmRegisterRegister(.{ ._, .add }, tmp, dst); | 5034 | } else try self.asmRegisterImmediate(.{ ._, .@"and" }, tmp, imm_0_1); |
| 4977 | // tmp = temp2 = (temp1 & 0x33...33) + ((temp1 >> 2) & 0x33...33) | 5035 | // tmp = (operand >> 1) & 0x55...55 |
| 4978 | try self.asmRegisterRegister(.{ ._, .mov }, dst, tmp); | 5036 | try self.asmRegisterRegister(.{ ._, .sub }, dst, tmp); |
| 4979 | // dst = temp2 | 5037 | // dst = temp1 = operand - ((operand >> 1) & 0x55...55) |
| 4980 | try self.asmRegisterImmediate(.{ ._r, .sh }, tmp, Immediate.u(4)); | 5038 | try self.asmRegisterRegister(.{ ._, .mov }, tmp, dst); |
| 4981 | // tmp = temp2 >> 4 | 5039 | // tmp = temp1 |
| 4982 | try self.asmRegisterRegister(.{ ._, .add }, dst, tmp); | 5040 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u(2)); |
| 4983 | // dst = temp2 + (temp2 >> 4) | 5041 | // dst = temp1 >> 2 |
| 4984 | if (src_abi_size > 4) { | 5042 | if (src_abi_size > 4) { |
| 4985 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0000_1111); | 5043 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_00_11); |
| 4986 | try self.asmRegisterImmediate(.{ ._, .mov }, tmp, imm_0000_0001); | 5044 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); |
| 4987 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); | 5045 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); |
| 4988 | try self.asmRegisterRegister(.{ .i_, .mul }, dst, tmp); | 5046 | } else { |
| 4989 | } else { | 5047 | try self.asmRegisterImmediate(.{ ._, .@"and" }, tmp, imm_00_11); |
| 4990 | try self.asmRegisterImmediate(.{ ._, .@"and" }, dst, imm_0000_1111); | 5048 | try self.asmRegisterImmediate(.{ ._, .@"and" }, dst, imm_00_11); |
| 4991 | if (src_abi_size > 1) { | 5049 | } |
| 4992 | try self.asmRegisterRegisterImmediate(.{ .i_, .mul }, dst, dst, imm_0000_0001); | 5050 | // tmp = temp1 & 0x33...33 |
| 4993 | } | 5051 | // dst = (temp1 >> 2) & 0x33...33 |
| 4994 | } | 5052 | try self.asmRegisterRegister(.{ ._, .add }, tmp, dst); |
| 4995 | // dst = temp3 = (temp2 + (temp2 >> 4)) & 0x0f...0f | 5053 | // tmp = temp2 = (temp1 & 0x33...33) + ((temp1 >> 2) & 0x33...33) |
| 4996 | // dst = temp3 * 0x01...01 | 5054 | try self.asmRegisterRegister(.{ ._, .mov }, dst, tmp); |
| 4997 | if (src_abi_size > 1) { | 5055 | // dst = temp2 |
| 4998 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u((src_abi_size - 1) * 8)); | 5056 | try self.asmRegisterImmediate(.{ ._r, .sh }, tmp, Immediate.u(4)); |
| 4999 | } | 5057 | // tmp = temp2 >> 4 |
| 5000 | // dst = (temp3 * 0x01...01) >> (bits - 8) | 5058 | try self.asmRegisterRegister(.{ ._, .add }, dst, tmp); |
| 5059 | // dst = temp2 + (temp2 >> 4) | ||
| 5060 | if (src_abi_size > 4) { | ||
| 5061 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0000_1111); | ||
| 5062 | try self.asmRegisterImmediate(.{ ._, .mov }, tmp, imm_0000_0001); | ||
| 5063 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); | ||
| 5064 | try self.asmRegisterRegister(.{ .i_, .mul }, dst, tmp); | ||
| 5065 | } else { | ||
| 5066 | try self.asmRegisterImmediate(.{ ._, .@"and" }, dst, imm_0000_1111); | ||
| 5067 | if (src_abi_size > 1) { | ||
| 5068 | try self.asmRegisterRegisterImmediate(.{ .i_, .mul }, dst, dst, imm_0000_0001); | ||
| 5001 | } | 5069 | } |
| 5002 | break :result dst_mcv; | 5070 | } |
| 5003 | }; | 5071 | // dst = temp3 = (temp2 + (temp2 >> 4)) & 0x0f...0f |
| 5004 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); | 5072 | // dst = temp3 * 0x01...01 |
| 5073 | if (src_abi_size > 1) { | ||
| 5074 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u((src_abi_size - 1) * 8)); | ||
| 5075 | } | ||
| 5076 | // dst = (temp3 * 0x01...01) >> (bits - 8) | ||
| 5005 | } | 5077 | } |
| 5006 | 5078 | ||
| 5007 | fn byteSwap(self: *Self, inst: Air.Inst.Index, src_ty: Type, src_mcv: MCValue, mem_ok: bool) !MCValue { | 5079 | fn genByteSwap( |
| 5080 | self: *Self, | ||
| 5081 | inst: Air.Inst.Index, | ||
| 5082 | src_ty: Type, | ||
| 5083 | src_mcv: MCValue, | ||
| 5084 | mem_ok: bool, | ||
| 5085 | ) !MCValue { | ||
| 5008 | const mod = self.bin_file.options.module.?; | 5086 | const mod = self.bin_file.options.module.?; |
| 5009 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; | 5087 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 5010 | 5088 | ||
| 5011 | if (src_ty.zigTypeTag(mod) == .Vector) return self.fail( | 5089 | if (src_ty.zigTypeTag(mod) == .Vector) return self.fail( |
| 5012 | "TODO implement byteSwap for {}", | 5090 | "TODO implement genByteSwap for {}", |
| 5013 | .{src_ty.fmt(mod)}, | 5091 | .{src_ty.fmt(mod)}, |
| 5014 | ); | 5092 | ); |
| 5015 | const src_bits = self.regBitSize(src_ty); | 5093 | const abi_size: u32 = @intCast(src_ty.abiSize(mod)); |
| 5016 | const src_lock = switch (src_mcv) { | 5094 | const src_lock = switch (src_mcv) { |
| 5017 | .register => |reg| self.register_manager.lockRegAssumeUnused(reg), | 5095 | .register => |reg| self.register_manager.lockRegAssumeUnused(reg), |
| 5018 | else => null, | 5096 | else => null, |
| 5019 | }; | 5097 | }; |
| 5020 | defer if (src_lock) |lock| self.register_manager.unlockReg(lock); | 5098 | defer if (src_lock) |lock| self.register_manager.unlockReg(lock); |
| 5021 | 5099 | ||
| 5022 | switch (src_bits) { | 5100 | switch (abi_size) { |
| 5023 | else => return self.fail("TODO implement byteSwap for {}", .{ | 5101 | else => return self.fail("TODO implement genByteSwap for {}", .{ |
| 5024 | src_ty.fmt(mod), | 5102 | src_ty.fmt(mod), |
| 5025 | }), | 5103 | }), |
| 5026 | 8 => return if ((mem_ok or src_mcv.isRegister()) and | 5104 | 1 => return if ((mem_ok or src_mcv.isRegister()) and |
| 5027 | self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) | 5105 | self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) |
| 5028 | src_mcv | 5106 | src_mcv |
| 5029 | else | 5107 | else |
| 5030 | try self.copyToRegisterWithInstTracking(inst, src_ty, src_mcv), | 5108 | try self.copyToRegisterWithInstTracking(inst, src_ty, src_mcv), |
| 5031 | 16 => if ((mem_ok or src_mcv.isRegister()) and | 5109 | 2 => if ((mem_ok or src_mcv.isRegister()) and |
| 5032 | self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) | 5110 | self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) |
| 5033 | { | 5111 | { |
| 5034 | try self.genBinOpMir(.{ ._l, .ro }, src_ty, src_mcv, .{ .immediate = 8 }); | 5112 | try self.genBinOpMir(.{ ._l, .ro }, src_ty, src_mcv, .{ .immediate = 8 }); |
| 5035 | return src_mcv; | 5113 | return src_mcv; |
| 5036 | }, | 5114 | }, |
| 5037 | 32, 64 => if (src_mcv.isRegister() and self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) { | 5115 | 3...8 => if (src_mcv.isRegister() and self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) { |
| 5038 | try self.genUnOpMir(.{ ._, .bswap }, src_ty, src_mcv); | 5116 | try self.genUnOpMir(.{ ._, .bswap }, src_ty, src_mcv); |
| 5039 | return src_mcv; | 5117 | return src_mcv; |
| 5040 | }, | 5118 | }, |
| 5119 | 9...16 => { | ||
| 5120 | switch (src_mcv) { | ||
| 5121 | .register_pair => |src_regs| if (self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) { | ||
| 5122 | for (src_regs) |src_reg| try self.asmRegister(.{ ._, .bswap }, src_reg.to64()); | ||
| 5123 | return .{ .register_pair = .{ src_regs[1], src_regs[0] } }; | ||
| 5124 | }, | ||
| 5125 | else => {}, | ||
| 5126 | } | ||
| 5127 | |||
| 5128 | const dst_regs = | ||
| 5129 | try self.register_manager.allocRegs(2, .{ inst, inst }, abi.RegisterClass.gp); | ||
| 5130 | const dst_locks = self.register_manager.lockRegsAssumeUnused(2, dst_regs); | ||
| 5131 | defer for (dst_locks) |lock| self.register_manager.unlockReg(lock); | ||
| 5132 | |||
| 5133 | if (src_mcv.isMemory()) { | ||
| 5134 | try self.asmRegisterMemory( | ||
| 5135 | .{ ._, .movbe }, | ||
| 5136 | dst_regs[0], | ||
| 5137 | src_mcv.address().offset(8).deref().mem(.qword), | ||
| 5138 | ); | ||
| 5139 | try self.asmRegisterMemory(.{ ._, .movbe }, dst_regs[1], src_mcv.mem(.qword)); | ||
| 5140 | } else for (dst_regs, src_mcv.register_pair) |dst_reg, src_reg| { | ||
| 5141 | try self.asmRegisterRegister(.{ ._, .mov }, dst_reg.to64(), src_reg.to64()); | ||
| 5142 | try self.asmRegister(.{ ._, .bswap }, dst_reg.to64()); | ||
| 5143 | } | ||
| 5144 | return .{ .register_pair = dst_regs }; | ||
| 5145 | }, | ||
| 5041 | } | 5146 | } |
| 5042 | 5147 | ||
| 5043 | if (src_mcv.isRegister()) { | 5148 | if (src_mcv.isRegister()) { |
| ... | @@ -5050,10 +5155,10 @@ fn byteSwap(self: *Self, inst: Air.Inst.Index, src_ty: Type, src_mcv: MCValue, m | ... | @@ -5050,10 +5155,10 @@ fn byteSwap(self: *Self, inst: Air.Inst.Index, src_ty: Type, src_mcv: MCValue, m |
| 5050 | defer self.register_manager.unlockReg(dst_lock); | 5155 | defer self.register_manager.unlockReg(dst_lock); |
| 5051 | 5156 | ||
| 5052 | try self.genSetReg(dst_mcv.register, src_ty, src_mcv); | 5157 | try self.genSetReg(dst_mcv.register, src_ty, src_mcv); |
| 5053 | switch (src_bits) { | 5158 | switch (abi_size) { |
| 5054 | else => unreachable, | 5159 | else => unreachable, |
| 5055 | 16 => try self.genBinOpMir(.{ ._l, .ro }, src_ty, dst_mcv, .{ .immediate = 8 }), | 5160 | 2 => try self.genBinOpMir(.{ ._l, .ro }, src_ty, dst_mcv, .{ .immediate = 8 }), |
| 5056 | 32, 64 => try self.genUnOpMir(.{ ._, .bswap }, src_ty, dst_mcv), | 5161 | 3...8 => try self.genUnOpMir(.{ ._, .bswap }, src_ty, dst_mcv), |
| 5057 | } | 5162 | } |
| 5058 | } else try self.genBinOpMir(.{ ._, .movbe }, src_ty, dst_mcv, src_mcv); | 5163 | } else try self.genBinOpMir(.{ ._, .movbe }, src_ty, dst_mcv, src_mcv); |
| 5059 | return dst_mcv; | 5164 | return dst_mcv; |
| ... | @@ -5073,18 +5178,19 @@ fn airByteSwap(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5073,18 +5178,19 @@ fn airByteSwap(self: *Self, inst: Air.Inst.Index) !void { |
| 5073 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; | 5178 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 5074 | 5179 | ||
| 5075 | const src_ty = self.typeOf(ty_op.operand); | 5180 | const src_ty = self.typeOf(ty_op.operand); |
| 5181 | const abi_size: u32 = @intCast(src_ty.abiSize(mod)); | ||
| 5182 | const bit_size: u32 = @intCast(src_ty.bitSize(mod)); | ||
| 5076 | const src_mcv = try self.resolveInst(ty_op.operand); | 5183 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 5077 | 5184 | ||
| 5078 | const dst_mcv = try self.byteSwap(inst, src_ty, src_mcv, true); | 5185 | const dst_mcv = try self.genByteSwap(inst, src_ty, src_mcv, true); |
| 5079 | switch (self.regExtraBits(src_ty)) { | 5186 | |
| 5080 | 0 => {}, | 5187 | const extra_bits = abi_size * 8 - bit_size; |
| 5081 | else => |extra| try self.genBinOpMir( | 5188 | const signedness: std.builtin.Signedness = |
| 5082 | if (src_ty.isSignedInt(mod)) .{ ._r, .sa } else .{ ._r, .sh }, | 5189 | if (src_ty.isAbiInt(mod)) src_ty.intInfo(mod).signedness else .unsigned; |
| 5083 | src_ty, | 5190 | if (extra_bits > 0) try self.genShiftBinOpMir(switch (signedness) { |
| 5084 | dst_mcv, | 5191 | .signed => .{ ._r, .sa }, |
| 5085 | .{ .immediate = extra }, | 5192 | .unsigned => .{ ._r, .sh }, |
| 5086 | ), | 5193 | }, src_ty, dst_mcv, .{ .immediate = extra_bits }); |
| 5087 | } | ||
| 5088 | 5194 | ||
| 5089 | return self.finishAir(inst, dst_mcv, .{ ty_op.operand, .none, .none }); | 5195 | return self.finishAir(inst, dst_mcv, .{ ty_op.operand, .none, .none }); |
| 5090 | } | 5196 | } |
| ... | @@ -5094,37 +5200,43 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5094,37 +5200,43 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { |
| 5094 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; | 5200 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 5095 | 5201 | ||
| 5096 | const src_ty = self.typeOf(ty_op.operand); | 5202 | const src_ty = self.typeOf(ty_op.operand); |
| 5097 | const src_abi_size: u32 = @intCast(src_ty.abiSize(mod)); | 5203 | const abi_size: u32 = @intCast(src_ty.abiSize(mod)); |
| 5204 | const bit_size: u32 = @intCast(src_ty.bitSize(mod)); | ||
| 5098 | const src_mcv = try self.resolveInst(ty_op.operand); | 5205 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 5099 | 5206 | ||
| 5100 | const dst_mcv = try self.byteSwap(inst, src_ty, src_mcv, false); | 5207 | const dst_mcv = try self.genByteSwap(inst, src_ty, src_mcv, false); |
| 5101 | const dst_reg = dst_mcv.register; | 5208 | const dst_locks: [2]?RegisterLock = switch (dst_mcv) { |
| 5102 | const dst_lock = self.register_manager.lockRegAssumeUnused(dst_reg); | 5209 | .register => |dst_reg| .{ self.register_manager.lockReg(dst_reg), null }, |
| 5103 | defer self.register_manager.unlockReg(dst_lock); | 5210 | .register_pair => |dst_regs| self.register_manager.lockRegs(2, dst_regs), |
| 5211 | else => unreachable, | ||
| 5212 | }; | ||
| 5213 | defer for (dst_locks) |dst_lock| if (dst_lock) |lock| self.register_manager.unlockReg(lock); | ||
| 5104 | 5214 | ||
| 5105 | const tmp_reg = try self.register_manager.allocReg(null, abi.RegisterClass.gp); | 5215 | const tmp_reg = try self.register_manager.allocReg(null, abi.RegisterClass.gp); |
| 5106 | const tmp_lock = self.register_manager.lockReg(tmp_reg); | 5216 | const tmp_lock = self.register_manager.lockReg(tmp_reg); |
| 5107 | defer if (tmp_lock) |lock| self.register_manager.unlockReg(lock); | 5217 | defer if (tmp_lock) |lock| self.register_manager.unlockReg(lock); |
| 5108 | 5218 | ||
| 5109 | { | 5219 | const limb_abi_size: u32 = @min(abi_size, 8); |
| 5110 | const dst = registerAlias(dst_reg, src_abi_size); | 5220 | const tmp = registerAlias(tmp_reg, limb_abi_size); |
| 5111 | const tmp = registerAlias(tmp_reg, src_abi_size); | 5221 | const imm = if (limb_abi_size > 4) |
| 5112 | const imm = if (src_abi_size > 4) | 5222 | try self.register_manager.allocReg(null, abi.RegisterClass.gp) |
| 5113 | try self.register_manager.allocReg(null, abi.RegisterClass.gp) | 5223 | else |
| 5114 | else | 5224 | undefined; |
| 5115 | undefined; | ||
| 5116 | 5225 | ||
| 5117 | const mask = @as(u64, math.maxInt(u64)) >> @intCast(64 - src_abi_size * 8); | 5226 | const mask = @as(u64, math.maxInt(u64)) >> @intCast(64 - limb_abi_size * 8); |
| 5118 | const imm_0000_1111 = Immediate.u(mask / 0b0001_0001); | 5227 | const imm_0000_1111 = Immediate.u(mask / 0b0001_0001); |
| 5119 | const imm_00_11 = Immediate.u(mask / 0b01_01); | 5228 | const imm_00_11 = Immediate.u(mask / 0b01_01); |
| 5120 | const imm_0_1 = Immediate.u(mask / 0b1_1); | 5229 | const imm_0_1 = Immediate.u(mask / 0b1_1); |
| 5230 | |||
| 5231 | for (dst_mcv.getRegs()) |dst_reg| { | ||
| 5232 | const dst = registerAlias(dst_reg, limb_abi_size); | ||
| 5121 | 5233 | ||
| 5122 | // dst = temp1 = bswap(operand) | 5234 | // dst = temp1 = bswap(operand) |
| 5123 | try self.asmRegisterRegister(.{ ._, .mov }, tmp, dst); | 5235 | try self.asmRegisterRegister(.{ ._, .mov }, tmp, dst); |
| 5124 | // tmp = temp1 | 5236 | // tmp = temp1 |
| 5125 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u(4)); | 5237 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u(4)); |
| 5126 | // dst = temp1 >> 4 | 5238 | // dst = temp1 >> 4 |
| 5127 | if (src_abi_size > 4) { | 5239 | if (limb_abi_size > 4) { |
| 5128 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0000_1111); | 5240 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0000_1111); |
| 5129 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); | 5241 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); |
| 5130 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); | 5242 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); |
| ... | @@ -5142,7 +5254,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5142,7 +5254,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { |
| 5142 | // tmp = temp2 | 5254 | // tmp = temp2 |
| 5143 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u(2)); | 5255 | try self.asmRegisterImmediate(.{ ._r, .sh }, dst, Immediate.u(2)); |
| 5144 | // dst = temp2 >> 2 | 5256 | // dst = temp2 >> 2 |
| 5145 | if (src_abi_size > 4) { | 5257 | if (limb_abi_size > 4) { |
| 5146 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_00_11); | 5258 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_00_11); |
| 5147 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); | 5259 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); |
| 5148 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); | 5260 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); |
| ... | @@ -5154,7 +5266,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5154,7 +5266,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { |
| 5154 | // dst = (temp2 >> 2) & 0x33...33 | 5266 | // dst = (temp2 >> 2) & 0x33...33 |
| 5155 | try self.asmRegisterMemory( | 5267 | try self.asmRegisterMemory( |
| 5156 | .{ ._, .lea }, | 5268 | .{ ._, .lea }, |
| 5157 | if (src_abi_size > 4) tmp.to64() else tmp.to32(), | 5269 | if (limb_abi_size > 4) tmp.to64() else tmp.to32(), |
| 5158 | Memory.sib(.qword, .{ | 5270 | Memory.sib(.qword, .{ |
| 5159 | .base = .{ .reg = dst.to64() }, | 5271 | .base = .{ .reg = dst.to64() }, |
| 5160 | .scale_index = .{ .index = tmp.to64(), .scale = 1 << 2 }, | 5272 | .scale_index = .{ .index = tmp.to64(), .scale = 1 << 2 }, |
| ... | @@ -5165,7 +5277,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5165,7 +5277,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { |
| 5165 | // dst = temp3 | 5277 | // dst = temp3 |
| 5166 | try self.asmRegisterImmediate(.{ ._r, .sh }, tmp, Immediate.u(1)); | 5278 | try self.asmRegisterImmediate(.{ ._r, .sh }, tmp, Immediate.u(1)); |
| 5167 | // tmp = temp3 >> 1 | 5279 | // tmp = temp3 >> 1 |
| 5168 | if (src_abi_size > 4) { | 5280 | if (limb_abi_size > 4) { |
| 5169 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0_1); | 5281 | try self.asmRegisterImmediate(.{ ._, .mov }, imm, imm_0_1); |
| 5170 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); | 5282 | try self.asmRegisterRegister(.{ ._, .@"and" }, dst, imm); |
| 5171 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); | 5283 | try self.asmRegisterRegister(.{ ._, .@"and" }, tmp, imm); |
| ... | @@ -5177,7 +5289,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5177,7 +5289,7 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { |
| 5177 | // tmp = (temp3 >> 1) & 0x55...55 | 5289 | // tmp = (temp3 >> 1) & 0x55...55 |
| 5178 | try self.asmRegisterMemory( | 5290 | try self.asmRegisterMemory( |
| 5179 | .{ ._, .lea }, | 5291 | .{ ._, .lea }, |
| 5180 | if (src_abi_size > 4) dst.to64() else dst.to32(), | 5292 | if (limb_abi_size > 4) dst.to64() else dst.to32(), |
| 5181 | Memory.sib(.qword, .{ | 5293 | Memory.sib(.qword, .{ |
| 5182 | .base = .{ .reg = tmp.to64() }, | 5294 | .base = .{ .reg = tmp.to64() }, |
| 5183 | .scale_index = .{ .index = dst.to64(), .scale = 1 << 1 }, | 5295 | .scale_index = .{ .index = dst.to64(), .scale = 1 << 1 }, |
| ... | @@ -5186,15 +5298,13 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5186,15 +5298,13 @@ fn airBitReverse(self: *Self, inst: Air.Inst.Index) !void { |
| 5186 | // dst = ((temp3 >> 1) & 0x55...55) + ((temp3 & 0x55...55) << 1) | 5298 | // dst = ((temp3 >> 1) & 0x55...55) + ((temp3 & 0x55...55) << 1) |
| 5187 | } | 5299 | } |
| 5188 | 5300 | ||
| 5189 | switch (self.regExtraBits(src_ty)) { | 5301 | const extra_bits = abi_size * 8 - bit_size; |
| 5190 | 0 => {}, | 5302 | const signedness: std.builtin.Signedness = |
| 5191 | else => |extra| try self.genBinOpMir( | 5303 | if (src_ty.isAbiInt(mod)) src_ty.intInfo(mod).signedness else .unsigned; |
| 5192 | if (src_ty.isSignedInt(mod)) .{ ._r, .sa } else .{ ._r, .sh }, | 5304 | if (extra_bits > 0) try self.genShiftBinOpMir(switch (signedness) { |
| 5193 | src_ty, | 5305 | .signed => .{ ._r, .sa }, |
| 5194 | dst_mcv, | 5306 | .unsigned => .{ ._r, .sh }, |
| 5195 | .{ .immediate = extra }, | 5307 | }, src_ty, dst_mcv, .{ .immediate = extra_bits }); |
| 5196 | ), | ||
| 5197 | } | ||
| 5198 | 5308 | ||
| 5199 | return self.finishAir(inst, dst_mcv, .{ ty_op.operand, .none, .none }); | 5309 | return self.finishAir(inst, dst_mcv, .{ ty_op.operand, .none, .none }); |
| 5200 | } | 5310 | } |
| ... | @@ -10861,29 +10971,41 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -10861,29 +10971,41 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { |
| 10861 | }, | 10971 | }, |
| 10862 | else => return self.fail("invalid constraint: '{s}'", .{constraint}), | 10972 | else => return self.fail("invalid constraint: '{s}'", .{constraint}), |
| 10863 | }; | 10973 | }; |
| 10974 | const is_early_clobber = constraint[1] == '&'; | ||
| 10975 | const rest = constraint[@as(usize, 1) + @intFromBool(is_early_clobber) ..]; | ||
| 10864 | const arg_mcv: MCValue = arg_mcv: { | 10976 | const arg_mcv: MCValue = arg_mcv: { |
| 10865 | const arg_maybe_reg: ?Register = if (mem.eql(u8, constraint[1..], "r")) | 10977 | const arg_maybe_reg: ?Register = if (mem.eql(u8, rest, "r") or |
| 10866 | self.register_manager.tryAllocReg(maybe_inst, self.regClassForType(ty)) orelse | 10978 | mem.eql(u8, rest, "f") or mem.eql(u8, rest, "x")) |
| 10867 | return self.fail("ran out of registers lowering inline asm", .{}) | 10979 | registerAlias( |
| 10868 | else if (mem.eql(u8, constraint[1..], "m")) | 10980 | self.register_manager.tryAllocReg(maybe_inst, switch (rest[0]) { |
| 10981 | 'r' => abi.RegisterClass.gp, | ||
| 10982 | 'f' => abi.RegisterClass.x87, | ||
| 10983 | 'x' => abi.RegisterClass.sse, | ||
| 10984 | else => unreachable, | ||
| 10985 | }) orelse return self.fail("ran out of registers lowering inline asm", .{}), | ||
| 10986 | @intCast(ty.abiSize(mod)), | ||
| 10987 | ) | ||
| 10988 | else if (mem.eql(u8, rest, "m")) | ||
| 10869 | if (output != .none) null else return self.fail( | 10989 | if (output != .none) null else return self.fail( |
| 10870 | "memory constraint unsupported for asm result: '{s}'", | 10990 | "memory constraint unsupported for asm result: '{s}'", |
| 10871 | .{constraint}, | 10991 | .{constraint}, |
| 10872 | ) | 10992 | ) |
| 10873 | else if (mem.eql(u8, constraint[1..], "g") or | 10993 | else if (mem.eql(u8, rest, "g") or |
| 10874 | mem.eql(u8, constraint[1..], "rm") or mem.eql(u8, constraint[1..], "mr") or | 10994 | mem.eql(u8, rest, "rm") or mem.eql(u8, rest, "mr") or |
| 10875 | mem.eql(u8, constraint[1..], "r,m") or mem.eql(u8, constraint[1..], "m,r")) | 10995 | mem.eql(u8, rest, "r,m") or mem.eql(u8, rest, "m,r")) |
| 10876 | self.register_manager.tryAllocReg(maybe_inst, self.regClassForType(ty)) orelse | 10996 | self.register_manager.tryAllocReg(maybe_inst, abi.RegisterClass.gp) orelse |
| 10877 | if (output != .none) | 10997 | if (output != .none) |
| 10878 | null | 10998 | null |
| 10879 | else | 10999 | else |
| 10880 | return self.fail("ran out of registers lowering inline asm", .{}) | 11000 | return self.fail("ran out of registers lowering inline asm", .{}) |
| 10881 | else if (mem.startsWith(u8, constraint[1..], "{") and mem.endsWith(u8, constraint[1..], "}")) | 11001 | else if (mem.startsWith(u8, rest, "{") and mem.endsWith(u8, rest, "}")) |
| 10882 | parseRegName(constraint[1 + "{".len .. constraint.len - "}".len]) orelse | 11002 | parseRegName(rest["{".len .. rest.len - "}".len]) orelse |
| 10883 | return self.fail("invalid register constraint: '{s}'", .{constraint}) | 11003 | return self.fail("invalid register constraint: '{s}'", .{constraint}) |
| 10884 | else if (constraint.len == 2 and std.ascii.isDigit(constraint[1])) { | 11004 | else if (rest.len == 1 and std.ascii.isDigit(rest[0])) { |
| 10885 | const index = std.fmt.charToDigit(constraint[0], 10) catch unreachable; | 11005 | const index = std.fmt.charToDigit(rest[0], 10) catch unreachable; |
| 10886 | if (index >= args.items.len) return self.fail("constraint out of bounds: '{s}'", .{constraint}); | 11006 | if (index >= args.items.len) return self.fail("constraint out of bounds: '{s}'", .{ |
| 11007 | constraint, | ||
| 11008 | }); | ||
| 10887 | break :arg_mcv args.items[index]; | 11009 | break :arg_mcv args.items[index]; |
| 10888 | } else return self.fail("invalid constraint: '{s}'", .{constraint}); | 11010 | } else return self.fail("invalid constraint: '{s}'", .{constraint}); |
| 10889 | break :arg_mcv if (arg_maybe_reg) |reg| .{ .register = reg } else arg: { | 11011 | break :arg_mcv if (arg_maybe_reg) |reg| .{ .register = reg } else arg: { |
| ... | @@ -10917,10 +11039,29 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -10917,10 +11039,29 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { |
| 10917 | 11039 | ||
| 10918 | const ty = self.typeOf(input); | 11040 | const ty = self.typeOf(input); |
| 10919 | const input_mcv = try self.resolveInst(input); | 11041 | const input_mcv = try self.resolveInst(input); |
| 10920 | const arg_mcv: MCValue = if (mem.eql(u8, constraint, "r")) switch (input_mcv) { | 11042 | const arg_mcv: MCValue = if (mem.eql(u8, constraint, "r") or |
| 10921 | .register => input_mcv, | 11043 | mem.eql(u8, constraint, "f") or mem.eql(u8, constraint, "x")) |
| 10922 | else => .{ .register = try self.copyToTmpRegister(ty, input_mcv) }, | 11044 | arg: { |
| 10923 | } else if (mem.eql(u8, constraint, "m")) arg: { | 11045 | const rc = switch (constraint[0]) { |
| 11046 | 'r' => abi.RegisterClass.gp, | ||
| 11047 | 'f' => abi.RegisterClass.x87, | ||
| 11048 | 'x' => abi.RegisterClass.sse, | ||
| 11049 | else => unreachable, | ||
| 11050 | }; | ||
| 11051 | if (input_mcv.isRegister() and | ||
| 11052 | rc.isSet(RegisterManager.indexOfRegIntoTracked(input_mcv.getReg().?).?)) | ||
| 11053 | break :arg input_mcv; | ||
| 11054 | const reg = try self.register_manager.allocReg(null, rc); | ||
| 11055 | try self.genSetReg(reg, ty, input_mcv); | ||
| 11056 | break :arg .{ .register = registerAlias(reg, @intCast(ty.abiSize(mod))) }; | ||
| 11057 | } else if (mem.eql(u8, constraint, "i") or mem.eql(u8, constraint, "n")) | ||
| 11058 | switch (input_mcv) { | ||
| 11059 | .immediate => |imm| .{ .immediate = imm }, | ||
| 11060 | else => return self.fail("immediate operand requires comptime value: '{s}'", .{ | ||
| 11061 | constraint, | ||
| 11062 | }), | ||
| 11063 | } | ||
| 11064 | else if (mem.eql(u8, constraint, "m")) arg: { | ||
| 10924 | switch (input_mcv) { | 11065 | switch (input_mcv) { |
| 10925 | .memory => |addr| if (math.cast(i32, @as(i64, @bitCast(addr)))) |_| | 11066 | .memory => |addr| if (math.cast(i32, @as(i64, @bitCast(addr)))) |_| |
| 10926 | break :arg input_mcv, | 11067 | break :arg input_mcv, |
| ... | @@ -11144,6 +11285,10 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -11144,6 +11285,10 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { |
| 11144 | arg_map.get(op_str["%[".len .. colon orelse op_str.len - "]".len]) orelse | 11285 | arg_map.get(op_str["%[".len .. colon orelse op_str.len - "]".len]) orelse |
| 11145 | return self.fail("no matching constraint: '{s}'", .{op_str}) | 11286 | return self.fail("no matching constraint: '{s}'", .{op_str}) |
| 11146 | ]) { | 11287 | ]) { |
| 11288 | .immediate => |imm| if (mem.eql(u8, modifier, "") or mem.eql(u8, modifier, "c")) | ||
| 11289 | .{ .imm = Immediate.u(imm) } | ||
| 11290 | else | ||
| 11291 | return self.fail("invalid modifier: '{s}'", .{modifier}), | ||
| 11147 | .register => |reg| if (mem.eql(u8, modifier, "")) | 11292 | .register => |reg| if (mem.eql(u8, modifier, "")) |
| 11148 | .{ .reg = reg } | 11293 | .{ .reg = reg } |
| 11149 | else | 11294 | else |
| ... | @@ -11272,6 +11417,13 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -11272,6 +11417,13 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { |
| 11272 | .none => self.asmRegisterImmediate(mnem_fixed_tag, reg1, imm0), | 11417 | .none => self.asmRegisterImmediate(mnem_fixed_tag, reg1, imm0), |
| 11273 | .reg => |reg2| switch (ops[3]) { | 11418 | .reg => |reg2| switch (ops[3]) { |
| 11274 | .none => self.asmRegisterRegisterImmediate(mnem_fixed_tag, reg2, reg1, imm0), | 11419 | .none => self.asmRegisterRegisterImmediate(mnem_fixed_tag, reg2, reg1, imm0), |
| 11420 | .reg => |reg3| self.asmRegisterRegisterRegisterImmediate( | ||
| 11421 | mnem_fixed_tag, | ||
| 11422 | reg3, | ||
| 11423 | reg2, | ||
| 11424 | reg1, | ||
| 11425 | imm0, | ||
| 11426 | ), | ||
| 11275 | else => error.InvalidInstruction, | 11427 | else => error.InvalidInstruction, |
| 11276 | }, | 11428 | }, |
| 11277 | .mem => |mem2| switch (ops[3]) { | 11429 | .mem => |mem2| switch (ops[3]) { |
src/arch/x86_64/Encoding.zig+26-7| ... | @@ -269,6 +269,9 @@ pub const Mnemonic = enum { | ... | @@ -269,6 +269,9 @@ pub const Mnemonic = enum { |
| 269 | pcmpeqb, pcmpeqd, pcmpeqw, | 269 | pcmpeqb, pcmpeqd, pcmpeqw, |
| 270 | pcmpgtb, pcmpgtd, pcmpgtw, | 270 | pcmpgtb, pcmpgtd, pcmpgtw, |
| 271 | pmulhw, pmullw, | 271 | pmulhw, pmullw, |
| 272 | pslld, psllq, psllw, | ||
| 273 | psrad, psraw, | ||
| 274 | psrld, psrlq, psrlw, | ||
| 272 | psubb, psubd, psubq, psubsb, psubsw, psubusb, psubusw, psubw, | 275 | psubb, psubd, psubq, psubsb, psubsw, psubusb, psubusw, psubw, |
| 273 | // SSE | 276 | // SSE |
| 274 | addps, addss, | 277 | addps, addss, |
| ... | @@ -309,8 +312,8 @@ pub const Mnemonic = enum { | ... | @@ -309,8 +312,8 @@ pub const Mnemonic = enum { |
| 309 | movupd, | 312 | movupd, |
| 310 | mulpd, mulsd, | 313 | mulpd, mulsd, |
| 311 | orpd, | 314 | orpd, |
| 312 | pshufhw, pshuflw, | 315 | pshufd, pshufhw, pshuflw, |
| 313 | psrld, psrlq, psrlw, | 316 | pslldq, psrldq, |
| 314 | punpckhbw, punpckhdq, punpckhqdq, punpckhwd, | 317 | punpckhbw, punpckhdq, punpckhqdq, punpckhwd, |
| 315 | punpcklbw, punpckldq, punpcklqdq, punpcklwd, | 318 | punpcklbw, punpckldq, punpcklqdq, punpcklwd, |
| 316 | shufpd, | 319 | shufpd, |
| ... | @@ -321,7 +324,7 @@ pub const Mnemonic = enum { | ... | @@ -321,7 +324,7 @@ pub const Mnemonic = enum { |
| 321 | // SSE3 | 324 | // SSE3 |
| 322 | movddup, movshdup, movsldup, | 325 | movddup, movshdup, movsldup, |
| 323 | // SSSE3 | 326 | // SSSE3 |
| 324 | pabsb, pabsd, pabsw, | 327 | pabsb, pabsd, pabsw, palignr, |
| 325 | // SSE4.1 | 328 | // SSE4.1 |
| 326 | blendpd, blendps, blendvpd, blendvps, | 329 | blendpd, blendps, blendvpd, blendvps, |
| 327 | extractps, | 330 | extractps, |
| ... | @@ -335,8 +338,15 @@ pub const Mnemonic = enum { | ... | @@ -335,8 +338,15 @@ pub const Mnemonic = enum { |
| 335 | roundpd, roundps, roundsd, roundss, | 338 | roundpd, roundps, roundsd, roundss, |
| 336 | // SSE4.2 | 339 | // SSE4.2 |
| 337 | pcmpgtq, | 340 | pcmpgtq, |
| 341 | // PCLMUL | ||
| 342 | pclmulqdq, | ||
| 343 | // AES | ||
| 344 | aesdec, aesdeclast, aesenc, aesenclast, aesimc, aeskeygenassist, | ||
| 345 | // SHA | ||
| 346 | sha256msg1, sha256msg2, sha256rnds2, | ||
| 338 | // AVX | 347 | // AVX |
| 339 | vaddpd, vaddps, vaddsd, vaddss, | 348 | vaddpd, vaddps, vaddsd, vaddss, |
| 349 | vaesdec, vaesdeclast, vaesenc, vaesenclast, vaesimc, vaeskeygenassist, | ||
| 340 | vandnpd, vandnps, vandpd, vandps, | 350 | vandnpd, vandnps, vandpd, vandps, |
| 341 | vblendpd, vblendps, vblendvpd, vblendvps, | 351 | vblendpd, vblendps, vblendvpd, vblendvps, |
| 342 | vbroadcastf128, vbroadcastsd, vbroadcastss, | 352 | vbroadcastf128, vbroadcastsd, vbroadcastss, |
| ... | @@ -366,7 +376,7 @@ pub const Mnemonic = enum { | ... | @@ -366,7 +376,7 @@ pub const Mnemonic = enum { |
| 366 | vpabsb, vpabsd, vpabsw, | 376 | vpabsb, vpabsd, vpabsw, |
| 367 | vpackssdw, vpacksswb, vpackusdw, vpackuswb, | 377 | vpackssdw, vpacksswb, vpackusdw, vpackuswb, |
| 368 | vpaddb, vpaddd, vpaddq, vpaddsb, vpaddsw, vpaddusb, vpaddusw, vpaddw, | 378 | vpaddb, vpaddd, vpaddq, vpaddsb, vpaddsw, vpaddusb, vpaddusw, vpaddw, |
| 369 | vpand, vpandn, | 379 | vpalignr, vpand, vpandn, vpclmulqdq, |
| 370 | vpcmpeqb, vpcmpeqd, vpcmpeqq, vpcmpeqw, | 380 | vpcmpeqb, vpcmpeqd, vpcmpeqq, vpcmpeqw, |
| 371 | vpcmpgtb, vpcmpgtd, vpcmpgtq, vpcmpgtw, | 381 | vpcmpgtb, vpcmpgtd, vpcmpgtq, vpcmpgtw, |
| 372 | vpextrb, vpextrd, vpextrq, vpextrw, | 382 | vpextrb, vpextrd, vpextrq, vpextrw, |
| ... | @@ -376,8 +386,10 @@ pub const Mnemonic = enum { | ... | @@ -376,8 +386,10 @@ pub const Mnemonic = enum { |
| 376 | vpmovmskb, | 386 | vpmovmskb, |
| 377 | vpmulhw, vpmulld, vpmullw, | 387 | vpmulhw, vpmulld, vpmullw, |
| 378 | vpor, | 388 | vpor, |
| 379 | vpshufhw, vpshuflw, | 389 | vpshufd, vpshufhw, vpshuflw, |
| 380 | vpsrld, vpsrlq, vpsrlw, | 390 | vpslld, vpslldq, vpsllq, vpsllw, |
| 391 | vpsrad, vpsraq, vpsraw, | ||
| 392 | vpsrld, vpsrldq, vpsrlq, vpsrlw, | ||
| 381 | vpsubb, vpsubd, vpsubq, vpsubsb, vpsubsw, vpsubusb, vpsubusw, vpsubw, | 393 | vpsubb, vpsubd, vpsubq, vpsubsb, vpsubsw, vpsubusb, vpsubusw, vpsubw, |
| 382 | vpunpckhbw, vpunpckhdq, vpunpckhqdq, vpunpckhwd, | 394 | vpunpckhbw, vpunpckhdq, vpunpckhqdq, vpunpckhwd, |
| 383 | vpunpcklbw, vpunpckldq, vpunpcklqdq, vpunpcklwd, | 395 | vpunpcklbw, vpunpckldq, vpunpcklqdq, vpunpcklwd, |
| ... | @@ -753,6 +765,8 @@ pub const Mode = enum { | ... | @@ -753,6 +765,8 @@ pub const Mode = enum { |
| 753 | 765 | ||
| 754 | pub const Feature = enum { | 766 | pub const Feature = enum { |
| 755 | none, | 767 | none, |
| 768 | aes, | ||
| 769 | @"aes avx", | ||
| 756 | avx, | 770 | avx, |
| 757 | avx2, | 771 | avx2, |
| 758 | bmi, | 772 | bmi, |
| ... | @@ -760,6 +774,8 @@ pub const Feature = enum { | ... | @@ -760,6 +774,8 @@ pub const Feature = enum { |
| 760 | fma, | 774 | fma, |
| 761 | lzcnt, | 775 | lzcnt, |
| 762 | movbe, | 776 | movbe, |
| 777 | pclmul, | ||
| 778 | @"pclmul avx", | ||
| 763 | popcnt, | 779 | popcnt, |
| 764 | sse, | 780 | sse, |
| 765 | sse2, | 781 | sse2, |
| ... | @@ -767,6 +783,9 @@ pub const Feature = enum { | ... | @@ -767,6 +783,9 @@ pub const Feature = enum { |
| 767 | sse4_1, | 783 | sse4_1, |
| 768 | sse4_2, | 784 | sse4_2, |
| 769 | ssse3, | 785 | ssse3, |
| 786 | sha, | ||
| 787 | vaes, | ||
| 788 | vpclmulqdq, | ||
| 770 | x87, | 789 | x87, |
| 771 | }; | 790 | }; |
| 772 | 791 | ||
| ... | @@ -784,7 +803,7 @@ fn estimateInstructionLength(prefix: Prefix, encoding: Encoding, ops: []const Op | ... | @@ -784,7 +803,7 @@ fn estimateInstructionLength(prefix: Prefix, encoding: Encoding, ops: []const Op |
| 784 | } | 803 | } |
| 785 | 804 | ||
| 786 | const mnemonic_to_encodings_map = init: { | 805 | const mnemonic_to_encodings_map = init: { |
| 787 | @setEvalBranchQuota(50_000); | 806 | @setEvalBranchQuota(60_000); |
| 788 | const encodings = @import("encodings.zig"); | 807 | const encodings = @import("encodings.zig"); |
| 789 | var entries = encodings.table; | 808 | var entries = encodings.table; |
| 790 | std.mem.sort(encodings.Entry, &entries, {}, struct { | 809 | std.mem.sort(encodings.Entry, &entries, {}, struct { |
src/arch/x86_64/Mir.zig+34-4| ... | @@ -494,6 +494,12 @@ pub const Inst = struct { | ... | @@ -494,6 +494,12 @@ pub const Inst = struct { |
| 494 | mull, | 494 | mull, |
| 495 | /// Multiply packed signed integers and store high result | 495 | /// Multiply packed signed integers and store high result |
| 496 | mulh, | 496 | mulh, |
| 497 | /// Shift packed data left logical | ||
| 498 | sll, | ||
| 499 | /// Shift packed data right arithmetic | ||
| 500 | sra, | ||
| 501 | /// Shift packed data right logical | ||
| 502 | srl, | ||
| 497 | /// Subtract packed signed integers with signed saturation | 503 | /// Subtract packed signed integers with signed saturation |
| 498 | subs, | 504 | subs, |
| 499 | /// Subtract packed unsigned integers with unsigned saturation | 505 | /// Subtract packed unsigned integers with unsigned saturation |
| ... | @@ -592,15 +598,13 @@ pub const Inst = struct { | ... | @@ -592,15 +598,13 @@ pub const Inst = struct { |
| 592 | movdqu, | 598 | movdqu, |
| 593 | /// Packed interleave shuffle of quadruplets of single-precision floating-point values | 599 | /// Packed interleave shuffle of quadruplets of single-precision floating-point values |
| 594 | /// Packed interleave shuffle of pairs of double-precision floating-point values | 600 | /// Packed interleave shuffle of pairs of double-precision floating-point values |
| 601 | /// Shuffle packed doublewords | ||
| 602 | /// Shuffle packed words | ||
| 595 | shuf, | 603 | shuf, |
| 596 | /// Shuffle packed high words | 604 | /// Shuffle packed high words |
| 597 | shufh, | 605 | shufh, |
| 598 | /// Shuffle packed low words | 606 | /// Shuffle packed low words |
| 599 | shufl, | 607 | shufl, |
| 600 | /// Shift packed data right logical | ||
| 601 | /// Shift packed data right logical | ||
| 602 | /// Shift packed data right logical | ||
| 603 | srl, | ||
| 604 | /// Unpack high data | 608 | /// Unpack high data |
| 605 | unpckhbw, | 609 | unpckhbw, |
| 606 | /// Unpack high data | 610 | /// Unpack high data |
| ... | @@ -625,6 +629,9 @@ pub const Inst = struct { | ... | @@ -625,6 +629,9 @@ pub const Inst = struct { |
| 625 | /// Replicate single floating-point values | 629 | /// Replicate single floating-point values |
| 626 | movsldup, | 630 | movsldup, |
| 627 | 631 | ||
| 632 | /// Packed align right | ||
| 633 | alignr, | ||
| 634 | |||
| 628 | /// Pack with unsigned saturation | 635 | /// Pack with unsigned saturation |
| 629 | ackusd, | 636 | ackusd, |
| 630 | /// Blend packed single-precision floating-point values | 637 | /// Blend packed single-precision floating-point values |
| ... | @@ -648,6 +655,29 @@ pub const Inst = struct { | ... | @@ -648,6 +655,29 @@ pub const Inst = struct { |
| 648 | /// Round scalar double-precision floating-point value | 655 | /// Round scalar double-precision floating-point value |
| 649 | round, | 656 | round, |
| 650 | 657 | ||
| 658 | /// Carry-less multiplication quadword | ||
| 659 | clmulq, | ||
| 660 | |||
| 661 | /// Perform one round of an AES decryption flow | ||
| 662 | aesdec, | ||
| 663 | /// Perform last round of an AES decryption flow | ||
| 664 | aesdeclast, | ||
| 665 | /// Perform one round of an AES encryption flow | ||
| 666 | aesenc, | ||
| 667 | /// Perform last round of an AES encryption flow | ||
| 668 | aesenclast, | ||
| 669 | /// Perform the AES InvMixColumn transformation | ||
| 670 | aesimc, | ||
| 671 | /// AES round key generation assist | ||
| 672 | aeskeygenassist, | ||
| 673 | |||
| 674 | /// Perform an intermediate calculation for the next four SHA256 message dwords | ||
| 675 | sha256msg1, | ||
| 676 | /// Perform a final calculation for the next four SHA256 message dwords | ||
| 677 | sha256msg2, | ||
| 678 | /// Perform two rounds of SHA256 operation | ||
| 679 | sha256rnds2, | ||
| 680 | |||
| 651 | /// Load with broadcast floating-point data | 681 | /// Load with broadcast floating-point data |
| 652 | broadcast, | 682 | broadcast, |
| 653 | 683 |
src/arch/x86_64/encodings.zig+120| ... | @@ -1075,10 +1075,26 @@ pub const table = [_]Entry{ | ... | @@ -1075,10 +1075,26 @@ pub const table = [_]Entry{ |
| 1075 | 1075 | ||
| 1076 | .{ .por, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xeb }, 0, .none, .sse2 }, | 1076 | .{ .por, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xeb }, 0, .none, .sse2 }, |
| 1077 | 1077 | ||
| 1078 | .{ .pshufd, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x70 }, 0, .none, .sse2 }, | ||
| 1079 | |||
| 1078 | .{ .pshufhw, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0xf3, 0x0f, 0x70 }, 0, .none, .sse2 }, | 1080 | .{ .pshufhw, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0xf3, 0x0f, 0x70 }, 0, .none, .sse2 }, |
| 1079 | 1081 | ||
| 1080 | .{ .pshuflw, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0xf2, 0x0f, 0x70 }, 0, .none, .sse2 }, | 1082 | .{ .pshuflw, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0xf2, 0x0f, 0x70 }, 0, .none, .sse2 }, |
| 1081 | 1083 | ||
| 1084 | .{ .psllw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf1 }, 0, .none, .sse2 }, | ||
| 1085 | .{ .psllw, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 6, .none, .sse2 }, | ||
| 1086 | .{ .pslld, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf2 }, 0, .none, .sse2 }, | ||
| 1087 | .{ .pslld, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x72 }, 6, .none, .sse2 }, | ||
| 1088 | .{ .psllq, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf3 }, 0, .none, .sse2 }, | ||
| 1089 | .{ .psllq, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 6, .none, .sse2 }, | ||
| 1090 | |||
| 1091 | .{ .pslldq, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 7, .none, .sse2 }, | ||
| 1092 | |||
| 1093 | .{ .psraw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xe1 }, 0, .none, .sse2 }, | ||
| 1094 | .{ .psraw, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 4, .none, .sse2 }, | ||
| 1095 | .{ .psrad, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xe2 }, 0, .none, .sse2 }, | ||
| 1096 | .{ .psrad, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x72 }, 4, .none, .sse2 }, | ||
| 1097 | |||
| 1082 | .{ .psrlw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd1 }, 0, .none, .sse2 }, | 1098 | .{ .psrlw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd1 }, 0, .none, .sse2 }, |
| 1083 | .{ .psrlw, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 2, .none, .sse2 }, | 1099 | .{ .psrlw, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 2, .none, .sse2 }, |
| 1084 | .{ .psrld, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd2 }, 0, .none, .sse2 }, | 1100 | .{ .psrld, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd2 }, 0, .none, .sse2 }, |
| ... | @@ -1086,6 +1102,8 @@ pub const table = [_]Entry{ | ... | @@ -1086,6 +1102,8 @@ pub const table = [_]Entry{ |
| 1086 | .{ .psrlq, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd3 }, 0, .none, .sse2 }, | 1102 | .{ .psrlq, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd3 }, 0, .none, .sse2 }, |
| 1087 | .{ .psrlq, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 2, .none, .sse2 }, | 1103 | .{ .psrlq, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 2, .none, .sse2 }, |
| 1088 | 1104 | ||
| 1105 | .{ .psrldq, .mi, &.{ .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 3, .none, .sse2 }, | ||
| 1106 | |||
| 1089 | .{ .psubb, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf8 }, 0, .none, .sse2 }, | 1107 | .{ .psubb, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf8 }, 0, .none, .sse2 }, |
| 1090 | .{ .psubw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf9 }, 0, .none, .sse2 }, | 1108 | .{ .psubw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf9 }, 0, .none, .sse2 }, |
| 1091 | .{ .psubd, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xfa }, 0, .none, .sse2 }, | 1109 | .{ .psubd, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xfa }, 0, .none, .sse2 }, |
| ... | @@ -1139,13 +1157,17 @@ pub const table = [_]Entry{ | ... | @@ -1139,13 +1157,17 @@ pub const table = [_]Entry{ |
| 1139 | .{ .pabsw, .rm, &.{ .mm, .mm_m64 }, &.{ 0x0f, 0x38, 0x1d }, 0, .none, .ssse3 }, | 1157 | .{ .pabsw, .rm, &.{ .mm, .mm_m64 }, &.{ 0x0f, 0x38, 0x1d }, 0, .none, .ssse3 }, |
| 1140 | .{ .pabsw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0x1d }, 0, .none, .ssse3 }, | 1158 | .{ .pabsw, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0x1d }, 0, .none, .ssse3 }, |
| 1141 | 1159 | ||
| 1160 | .{ .palignr, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x0f }, 0, .none, .ssse3 }, | ||
| 1161 | |||
| 1142 | // SSE4.1 | 1162 | // SSE4.1 |
| 1143 | .{ .blendpd, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x0d }, 0, .none, .sse4_1 }, | 1163 | .{ .blendpd, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x0d }, 0, .none, .sse4_1 }, |
| 1144 | 1164 | ||
| 1145 | .{ .blendps, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x0c }, 0, .none, .sse4_1 }, | 1165 | .{ .blendps, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x0c }, 0, .none, .sse4_1 }, |
| 1146 | 1166 | ||
| 1167 | .{ .blendvpd, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0x15 }, 0, .none, .sse4_1 }, | ||
| 1147 | .{ .blendvpd, .rm0, &.{ .xmm, .xmm_m128, .xmm0 }, &.{ 0x66, 0x0f, 0x38, 0x15 }, 0, .none, .sse4_1 }, | 1168 | .{ .blendvpd, .rm0, &.{ .xmm, .xmm_m128, .xmm0 }, &.{ 0x66, 0x0f, 0x38, 0x15 }, 0, .none, .sse4_1 }, |
| 1148 | 1169 | ||
| 1170 | .{ .blendvps, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0x14 }, 0, .none, .sse4_1 }, | ||
| 1149 | .{ .blendvps, .rm0, &.{ .xmm, .xmm_m128, .xmm0 }, &.{ 0x66, 0x0f, 0x38, 0x14 }, 0, .none, .sse4_1 }, | 1171 | .{ .blendvps, .rm0, &.{ .xmm, .xmm_m128, .xmm0 }, &.{ 0x66, 0x0f, 0x38, 0x14 }, 0, .none, .sse4_1 }, |
| 1150 | 1172 | ||
| 1151 | .{ .extractps, .mri, &.{ .rm32, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x17 }, 0, .none, .sse4_1 }, | 1173 | .{ .extractps, .mri, &.{ .rm32, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x17 }, 0, .none, .sse4_1 }, |
| ... | @@ -1193,6 +1215,30 @@ pub const table = [_]Entry{ | ... | @@ -1193,6 +1215,30 @@ pub const table = [_]Entry{ |
| 1193 | // SSE4.2 | 1215 | // SSE4.2 |
| 1194 | .{ .pcmpgtq, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0x37 }, 0, .none, .sse4_2 }, | 1216 | .{ .pcmpgtq, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0x37 }, 0, .none, .sse4_2 }, |
| 1195 | 1217 | ||
| 1218 | // PCLMUL | ||
| 1219 | .{ .pclmulqdq, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x44 }, 0, .none, .pclmul }, | ||
| 1220 | |||
| 1221 | // AES | ||
| 1222 | .{ .aesdec, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xde }, 0, .none, .aes }, | ||
| 1223 | |||
| 1224 | .{ .aesdeclast, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdf }, 0, .none, .aes }, | ||
| 1225 | |||
| 1226 | .{ .aesenc, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdc }, 0, .none, .aes }, | ||
| 1227 | |||
| 1228 | .{ .aesenclast, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdd }, 0, .none, .aes }, | ||
| 1229 | |||
| 1230 | .{ .aesimc, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdb }, 0, .none, .aes }, | ||
| 1231 | |||
| 1232 | .{ .aeskeygenassist, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0xdf }, 0, .none, .aes }, | ||
| 1233 | |||
| 1234 | // SHA | ||
| 1235 | .{ .sha256msg1, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x0f, 0x38, 0xcc }, 0, .none, .sha }, | ||
| 1236 | |||
| 1237 | .{ .sha256msg2, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x0f, 0x38, 0xcd }, 0, .none, .sha }, | ||
| 1238 | |||
| 1239 | .{ .sha256rnds2, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x0f, 0x38, 0xcb }, 0, .none, .sha }, | ||
| 1240 | .{ .sha256rnds2, .rm0, &.{ .xmm, .xmm_m128, .xmm0 }, &.{ 0x0f, 0x38, 0xcb }, 0, .none, .sha }, | ||
| 1241 | |||
| 1196 | // AVX | 1242 | // AVX |
| 1197 | .{ .vaddpd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x58 }, 0, .vex_128_wig, .avx }, | 1243 | .{ .vaddpd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x58 }, 0, .vex_128_wig, .avx }, |
| 1198 | .{ .vaddpd, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x58 }, 0, .vex_256_wig, .avx }, | 1244 | .{ .vaddpd, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x58 }, 0, .vex_256_wig, .avx }, |
| ... | @@ -1204,6 +1250,18 @@ pub const table = [_]Entry{ | ... | @@ -1204,6 +1250,18 @@ pub const table = [_]Entry{ |
| 1204 | 1250 | ||
| 1205 | .{ .vaddss, .rvm, &.{ .xmm, .xmm, .xmm_m32 }, &.{ 0xf3, 0x0f, 0x58 }, 0, .vex_lig_wig, .avx }, | 1251 | .{ .vaddss, .rvm, &.{ .xmm, .xmm, .xmm_m32 }, &.{ 0xf3, 0x0f, 0x58 }, 0, .vex_lig_wig, .avx }, |
| 1206 | 1252 | ||
| 1253 | .{ .vaesdec, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xde }, 0, .vex_128_wig, .@"aes avx" }, | ||
| 1254 | |||
| 1255 | .{ .vaesdeclast, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdf }, 0, .vex_128_wig, .@"aes avx" }, | ||
| 1256 | |||
| 1257 | .{ .vaesenc, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdc }, 0, .vex_128_wig, .@"aes avx" }, | ||
| 1258 | |||
| 1259 | .{ .vaesenclast, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdd }, 0, .vex_128_wig, .@"aes avx" }, | ||
| 1260 | |||
| 1261 | .{ .vaesimc, .rm, &.{ .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x38, 0xdb }, 0, .vex_128_wig, .@"aes avx" }, | ||
| 1262 | |||
| 1263 | .{ .vaeskeygenassist, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0xdf }, 0, .vex_128_wig, .@"aes avx" }, | ||
| 1264 | |||
| 1207 | .{ .vandnpd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x55 }, 0, .vex_128_wig, .avx }, | 1265 | .{ .vandnpd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x55 }, 0, .vex_128_wig, .avx }, |
| 1208 | .{ .vandnpd, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x55 }, 0, .vex_256_wig, .avx }, | 1266 | .{ .vandnpd, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x55 }, 0, .vex_256_wig, .avx }, |
| 1209 | 1267 | ||
| ... | @@ -1436,10 +1494,14 @@ pub const table = [_]Entry{ | ... | @@ -1436,10 +1494,14 @@ pub const table = [_]Entry{ |
| 1436 | .{ .vpaddusb, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdc }, 0, .vex_128_wig, .avx }, | 1494 | .{ .vpaddusb, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdc }, 0, .vex_128_wig, .avx }, |
| 1437 | .{ .vpaddusw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdd }, 0, .vex_128_wig, .avx }, | 1495 | .{ .vpaddusw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdd }, 0, .vex_128_wig, .avx }, |
| 1438 | 1496 | ||
| 1497 | .{ .vpalignr, .rvmi, &.{ .xmm, .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x0f }, 0, .vex_128_wig, .avx }, | ||
| 1498 | |||
| 1439 | .{ .vpand, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdb }, 0, .vex_128_wig, .avx }, | 1499 | .{ .vpand, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdb }, 0, .vex_128_wig, .avx }, |
| 1440 | 1500 | ||
| 1441 | .{ .vpandn, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdf }, 0, .vex_128_wig, .avx }, | 1501 | .{ .vpandn, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xdf }, 0, .vex_128_wig, .avx }, |
| 1442 | 1502 | ||
| 1503 | .{ .vpclmulqdq, .rvmi, &.{ .xmm, .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x44 }, 0, .vex_128_wig, .@"pclmul avx" }, | ||
| 1504 | |||
| 1443 | .{ .vpcmpeqb, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x74 }, 0, .vex_128_wig, .avx }, | 1505 | .{ .vpcmpeqb, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x74 }, 0, .vex_128_wig, .avx }, |
| 1444 | .{ .vpcmpeqw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x75 }, 0, .vex_128_wig, .avx }, | 1506 | .{ .vpcmpeqw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x75 }, 0, .vex_128_wig, .avx }, |
| 1445 | .{ .vpcmpeqd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x76 }, 0, .vex_128_wig, .avx }, | 1507 | .{ .vpcmpeqd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0x76 }, 0, .vex_128_wig, .avx }, |
| ... | @@ -1494,6 +1556,26 @@ pub const table = [_]Entry{ | ... | @@ -1494,6 +1556,26 @@ pub const table = [_]Entry{ |
| 1494 | 1556 | ||
| 1495 | .{ .vpor, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xeb }, 0, .vex_128_wig, .avx }, | 1557 | .{ .vpor, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xeb }, 0, .vex_128_wig, .avx }, |
| 1496 | 1558 | ||
| 1559 | .{ .vpshufd, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0x66, 0x0f, 0x70 }, 0, .vex_128_wig, .avx }, | ||
| 1560 | |||
| 1561 | .{ .vpshufhw, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0xf3, 0x0f, 0x70 }, 0, .vex_128_wig, .avx }, | ||
| 1562 | |||
| 1563 | .{ .vpshuflw, .rmi, &.{ .xmm, .xmm_m128, .imm8 }, &.{ 0xf2, 0x0f, 0x70 }, 0, .vex_128_wig, .avx }, | ||
| 1564 | |||
| 1565 | .{ .vpsllw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf1 }, 0, .vex_128_wig, .avx }, | ||
| 1566 | .{ .vpsllw, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 6, .vex_128_wig, .avx }, | ||
| 1567 | .{ .vpslld, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf2 }, 0, .vex_128_wig, .avx }, | ||
| 1568 | .{ .vpslld, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x72 }, 6, .vex_128_wig, .avx }, | ||
| 1569 | .{ .vpsllq, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf3 }, 0, .vex_128_wig, .avx }, | ||
| 1570 | .{ .vpsllq, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 6, .vex_128_wig, .avx }, | ||
| 1571 | |||
| 1572 | .{ .vpslldq, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 7, .vex_128_wig, .avx }, | ||
| 1573 | |||
| 1574 | .{ .vpsraw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xe1 }, 0, .vex_128_wig, .avx }, | ||
| 1575 | .{ .vpsraw, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 4, .vex_128_wig, .avx }, | ||
| 1576 | .{ .vpsrad, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xe2 }, 0, .vex_128_wig, .avx }, | ||
| 1577 | .{ .vpsrad, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x72 }, 4, .vex_128_wig, .avx }, | ||
| 1578 | |||
| 1497 | .{ .vpsrlw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd1 }, 0, .vex_128_wig, .avx }, | 1579 | .{ .vpsrlw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd1 }, 0, .vex_128_wig, .avx }, |
| 1498 | .{ .vpsrlw, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 2, .vex_128_wig, .avx }, | 1580 | .{ .vpsrlw, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 2, .vex_128_wig, .avx }, |
| 1499 | .{ .vpsrld, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd2 }, 0, .vex_128_wig, .avx }, | 1581 | .{ .vpsrld, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd2 }, 0, .vex_128_wig, .avx }, |
| ... | @@ -1501,6 +1583,8 @@ pub const table = [_]Entry{ | ... | @@ -1501,6 +1583,8 @@ pub const table = [_]Entry{ |
| 1501 | .{ .vpsrlq, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd3 }, 0, .vex_128_wig, .avx }, | 1583 | .{ .vpsrlq, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd3 }, 0, .vex_128_wig, .avx }, |
| 1502 | .{ .vpsrlq, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 2, .vex_128_wig, .avx }, | 1584 | .{ .vpsrlq, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 2, .vex_128_wig, .avx }, |
| 1503 | 1585 | ||
| 1586 | .{ .vpsrldq, .vmi, &.{ .xmm, .xmm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 3, .vex_128_wig, .avx }, | ||
| 1587 | |||
| 1504 | .{ .vpsubb, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf8 }, 0, .vex_128_wig, .avx }, | 1588 | .{ .vpsubb, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf8 }, 0, .vex_128_wig, .avx }, |
| 1505 | .{ .vpsubw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf9 }, 0, .vex_128_wig, .avx }, | 1589 | .{ .vpsubw, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf9 }, 0, .vex_128_wig, .avx }, |
| 1506 | .{ .vpsubd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xfa }, 0, .vex_128_wig, .avx }, | 1590 | .{ .vpsubd, .rvm, &.{ .xmm, .xmm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xfa }, 0, .vex_128_wig, .avx }, |
| ... | @@ -1597,6 +1681,18 @@ pub const table = [_]Entry{ | ... | @@ -1597,6 +1681,18 @@ pub const table = [_]Entry{ |
| 1597 | .{ .vfmadd213ss, .rvm, &.{ .xmm, .xmm, .xmm_m32 }, &.{ 0x66, 0x0f, 0x38, 0xa9 }, 0, .vex_lig_w0, .fma }, | 1681 | .{ .vfmadd213ss, .rvm, &.{ .xmm, .xmm, .xmm_m32 }, &.{ 0x66, 0x0f, 0x38, 0xa9 }, 0, .vex_lig_w0, .fma }, |
| 1598 | .{ .vfmadd231ss, .rvm, &.{ .xmm, .xmm, .xmm_m32 }, &.{ 0x66, 0x0f, 0x38, 0xb9 }, 0, .vex_lig_w0, .fma }, | 1682 | .{ .vfmadd231ss, .rvm, &.{ .xmm, .xmm, .xmm_m32 }, &.{ 0x66, 0x0f, 0x38, 0xb9 }, 0, .vex_lig_w0, .fma }, |
| 1599 | 1683 | ||
| 1684 | // VPCLMULQDQ | ||
| 1685 | .{ .vpclmulqdq, .rvmi, &.{ .ymm, .ymm, .ymm_m256, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x44 }, 0, .vex_256_wig, .vpclmulqdq }, | ||
| 1686 | |||
| 1687 | // VAES | ||
| 1688 | .{ .vaesdec, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x38, 0xde }, 0, .vex_256_wig, .vaes }, | ||
| 1689 | |||
| 1690 | .{ .vaesdeclast, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x38, 0xdf }, 0, .vex_256_wig, .vaes }, | ||
| 1691 | |||
| 1692 | .{ .vaesenc, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x38, 0xdc }, 0, .vex_256_wig, .vaes }, | ||
| 1693 | |||
| 1694 | .{ .vaesenclast, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0x38, 0xdd }, 0, .vex_256_wig, .vaes }, | ||
| 1695 | |||
| 1600 | // AVX2 | 1696 | // AVX2 |
| 1601 | .{ .vbroadcastss, .rm, &.{ .xmm, .xmm }, &.{ 0x66, 0x0f, 0x38, 0x18 }, 0, .vex_128_w0, .avx2 }, | 1697 | .{ .vbroadcastss, .rm, &.{ .xmm, .xmm }, &.{ 0x66, 0x0f, 0x38, 0x18 }, 0, .vex_128_w0, .avx2 }, |
| 1602 | .{ .vbroadcastss, .rm, &.{ .ymm, .xmm }, &.{ 0x66, 0x0f, 0x38, 0x18 }, 0, .vex_256_w0, .avx2 }, | 1698 | .{ .vbroadcastss, .rm, &.{ .ymm, .xmm }, &.{ 0x66, 0x0f, 0x38, 0x18 }, 0, .vex_256_w0, .avx2 }, |
| ... | @@ -1624,6 +1720,8 @@ pub const table = [_]Entry{ | ... | @@ -1624,6 +1720,8 @@ pub const table = [_]Entry{ |
| 1624 | .{ .vpaddusb, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdc }, 0, .vex_256_wig, .avx2 }, | 1720 | .{ .vpaddusb, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdc }, 0, .vex_256_wig, .avx2 }, |
| 1625 | .{ .vpaddusw, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdd }, 0, .vex_256_wig, .avx2 }, | 1721 | .{ .vpaddusw, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdd }, 0, .vex_256_wig, .avx2 }, |
| 1626 | 1722 | ||
| 1723 | .{ .vpalignr, .rvmi, &.{ .ymm, .ymm, .ymm_m256, .imm8 }, &.{ 0x66, 0x0f, 0x3a, 0x0f }, 0, .vex_256_wig, .avx2 }, | ||
| 1724 | |||
| 1627 | .{ .vpand, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdb }, 0, .vex_256_wig, .avx2 }, | 1725 | .{ .vpand, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdb }, 0, .vex_256_wig, .avx2 }, |
| 1628 | 1726 | ||
| 1629 | .{ .vpandn, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdf }, 0, .vex_256_wig, .avx2 }, | 1727 | .{ .vpandn, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xdf }, 0, .vex_256_wig, .avx2 }, |
| ... | @@ -1669,6 +1767,26 @@ pub const table = [_]Entry{ | ... | @@ -1669,6 +1767,26 @@ pub const table = [_]Entry{ |
| 1669 | 1767 | ||
| 1670 | .{ .vpor, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xeb }, 0, .vex_256_wig, .avx2 }, | 1768 | .{ .vpor, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xeb }, 0, .vex_256_wig, .avx2 }, |
| 1671 | 1769 | ||
| 1770 | .{ .vpshufd, .rmi, &.{ .ymm, .ymm_m256, .imm8 }, &.{ 0x66, 0x0f, 0x70 }, 0, .vex_256_wig, .avx2 }, | ||
| 1771 | |||
| 1772 | .{ .vpshufhw, .rmi, &.{ .ymm, .ymm_m256, .imm8 }, &.{ 0xf3, 0x0f, 0x70 }, 0, .vex_256_wig, .avx2 }, | ||
| 1773 | |||
| 1774 | .{ .vpshuflw, .rmi, &.{ .ymm, .ymm_m256, .imm8 }, &.{ 0xf2, 0x0f, 0x70 }, 0, .vex_256_wig, .avx2 }, | ||
| 1775 | |||
| 1776 | .{ .vpsllw, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf1 }, 0, .vex_256_wig, .avx2 }, | ||
| 1777 | .{ .vpsllw, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 6, .vex_256_wig, .avx2 }, | ||
| 1778 | .{ .vpslld, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf2 }, 0, .vex_256_wig, .avx2 }, | ||
| 1779 | .{ .vpslld, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x72 }, 6, .vex_256_wig, .avx2 }, | ||
| 1780 | .{ .vpsllq, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xf3 }, 0, .vex_256_wig, .avx2 }, | ||
| 1781 | .{ .vpsllq, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 6, .vex_256_wig, .avx2 }, | ||
| 1782 | |||
| 1783 | .{ .vpslldq, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 7, .vex_256_wig, .avx2 }, | ||
| 1784 | |||
| 1785 | .{ .vpsraw, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xe1 }, 0, .vex_256_wig, .avx2 }, | ||
| 1786 | .{ .vpsraw, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 4, .vex_256_wig, .avx2 }, | ||
| 1787 | .{ .vpsrad, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xe2 }, 0, .vex_256_wig, .avx2 }, | ||
| 1788 | .{ .vpsrad, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x72 }, 4, .vex_256_wig, .avx2 }, | ||
| 1789 | |||
| 1672 | .{ .vpsrlw, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd1 }, 0, .vex_256_wig, .avx2 }, | 1790 | .{ .vpsrlw, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd1 }, 0, .vex_256_wig, .avx2 }, |
| 1673 | .{ .vpsrlw, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 2, .vex_256_wig, .avx2 }, | 1791 | .{ .vpsrlw, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x71 }, 2, .vex_256_wig, .avx2 }, |
| 1674 | .{ .vpsrld, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd2 }, 0, .vex_256_wig, .avx2 }, | 1792 | .{ .vpsrld, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd2 }, 0, .vex_256_wig, .avx2 }, |
| ... | @@ -1676,6 +1794,8 @@ pub const table = [_]Entry{ | ... | @@ -1676,6 +1794,8 @@ pub const table = [_]Entry{ |
| 1676 | .{ .vpsrlq, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd3 }, 0, .vex_256_wig, .avx2 }, | 1794 | .{ .vpsrlq, .rvm, &.{ .ymm, .ymm, .xmm_m128 }, &.{ 0x66, 0x0f, 0xd3 }, 0, .vex_256_wig, .avx2 }, |
| 1677 | .{ .vpsrlq, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 2, .vex_256_wig, .avx2 }, | 1795 | .{ .vpsrlq, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 2, .vex_256_wig, .avx2 }, |
| 1678 | 1796 | ||
| 1797 | .{ .vpsrldq, .vmi, &.{ .ymm, .ymm, .imm8 }, &.{ 0x66, 0x0f, 0x73 }, 3, .vex_128_wig, .avx2 }, | ||
| 1798 | |||
| 1679 | .{ .vpsubb, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xf8 }, 0, .vex_256_wig, .avx2 }, | 1799 | .{ .vpsubb, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xf8 }, 0, .vex_256_wig, .avx2 }, |
| 1680 | .{ .vpsubw, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xf9 }, 0, .vex_256_wig, .avx2 }, | 1800 | .{ .vpsubw, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xf9 }, 0, .vex_256_wig, .avx2 }, |
| 1681 | .{ .vpsubd, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xfa }, 0, .vex_256_wig, .avx2 }, | 1801 | .{ .vpsubd, .rvm, &.{ .ymm, .ymm, .ymm_m256 }, &.{ 0x66, 0x0f, 0xfa }, 0, .vex_256_wig, .avx2 }, |
test/behavior/bitreverse.zig+1-1| ... | @@ -11,11 +11,11 @@ test "@bitReverse large exotic integer" { | ... | @@ -11,11 +11,11 @@ test "@bitReverse large exotic integer" { |
| 11 | 11 | ||
| 12 | test "@bitReverse" { | 12 | test "@bitReverse" { |
| 13 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 13 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 14 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 14 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 15 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 17 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 18 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 17 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 18 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf) return error.SkipZigTest; | ||
| 19 | 19 | ||
| 20 | try comptime testBitReverse(); | 20 | try comptime testBitReverse(); |
| 21 | try testBitReverse(); | 21 | try testBitReverse(); |
test/behavior/byteswap.zig+1-1| ... | @@ -4,11 +4,11 @@ const expect = std.testing.expect; | ... | @@ -4,11 +4,11 @@ const expect = std.testing.expect; |
| 4 | 4 | ||
| 5 | test "@byteSwap integers" { | 5 | test "@byteSwap integers" { |
| 6 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 6 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 7 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 9 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 11 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 10 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 11 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf) return error.SkipZigTest; | ||
| 12 | 12 | ||
| 13 | const ByteSwapIntTest = struct { | 13 | const ByteSwapIntTest = struct { |
| 14 | fn run() !void { | 14 | fn run() !void { |
test/behavior/popcount.zig-1| ... | @@ -14,7 +14,6 @@ test "@popCount integers" { | ... | @@ -14,7 +14,6 @@ test "@popCount integers" { |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | test "@popCount 128bit integer" { | 16 | test "@popCount 128bit integer" { |
| 17 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | ||
| 18 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 17 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 18 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 20 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |