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