| ... | ... | @@ -8,6 +8,7 @@ const expectApproxEqRel = std.testing.expectApproxEqRel; |
| 8 | 8 | const Vector = std.meta.Vector; |
| 9 | 9 | |
| 10 | 10 | test "implicit cast vector to array - bool" { |
| 11 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 11 | 12 | const S = struct { |
| 12 | 13 | fn doTheTest() !void { |
| 13 | 14 | const a: Vector(4, bool) = [_]bool{ true, false, true, false }; |
| ... | ... | @@ -20,6 +21,7 @@ test "implicit cast vector to array - bool" { |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | test "vector wrap operators" { |
| 24 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 23 | 25 | const S = struct { |
| 24 | 26 | fn doTheTest() !void { |
| 25 | 27 | var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 }; |
| ... | ... | @@ -36,6 +38,7 @@ test "vector wrap operators" { |
| 36 | 38 | } |
| 37 | 39 | |
| 38 | 40 | test "vector bin compares with mem.eql" { |
| 41 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 39 | 42 | const S = struct { |
| 40 | 43 | fn doTheTest() !void { |
| 41 | 44 | var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 }; |
| ... | ... | @@ -53,6 +56,7 @@ test "vector bin compares with mem.eql" { |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | 58 | test "vector int operators" { |
| 59 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 56 | 60 | const S = struct { |
| 57 | 61 | fn doTheTest() !void { |
| 58 | 62 | var v: Vector(4, i32) = [4]i32{ 10, 20, 30, 40 }; |
| ... | ... | @@ -68,6 +72,7 @@ test "vector int operators" { |
| 68 | 72 | } |
| 69 | 73 | |
| 70 | 74 | test "vector float operators" { |
| 75 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 71 | 76 | const S = struct { |
| 72 | 77 | fn doTheTest() !void { |
| 73 | 78 | var v: Vector(4, f32) = [4]f32{ 10, 20, 30, 40 }; |
| ... | ... | @@ -83,6 +88,7 @@ test "vector float operators" { |
| 83 | 88 | } |
| 84 | 89 | |
| 85 | 90 | test "vector bit operators" { |
| 91 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 86 | 92 | const S = struct { |
| 87 | 93 | fn doTheTest() !void { |
| 88 | 94 | var v: Vector(4, u8) = [4]u8{ 0b10101010, 0b10101010, 0b10101010, 0b10101010 }; |
| ... | ... | @@ -97,6 +103,7 @@ test "vector bit operators" { |
| 97 | 103 | } |
| 98 | 104 | |
| 99 | 105 | test "implicit cast vector to array" { |
| 106 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 100 | 107 | const S = struct { |
| 101 | 108 | fn doTheTest() !void { |
| 102 | 109 | var a: Vector(4, i32) = [_]i32{ 1, 2, 3, 4 }; |
| ... | ... | @@ -110,6 +117,7 @@ test "implicit cast vector to array" { |
| 110 | 117 | } |
| 111 | 118 | |
| 112 | 119 | test "array to vector" { |
| 120 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 113 | 121 | var foo: f32 = 3.14; |
| 114 | 122 | var arr = [4]f32{ foo, 1.5, 0.0, 0.0 }; |
| 115 | 123 | var vec: Vector(4, f32) = arr; |
| ... | ... | @@ -117,6 +125,7 @@ test "array to vector" { |
| 117 | 125 | } |
| 118 | 126 | |
| 119 | 127 | test "vector casts of sizes not divisible by 8" { |
| 128 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 120 | 129 | const S = struct { |
| 121 | 130 | fn doTheTest() !void { |
| 122 | 131 | { |
| ... | ... | @@ -146,6 +155,7 @@ test "vector casts of sizes not divisible by 8" { |
| 146 | 155 | } |
| 147 | 156 | |
| 148 | 157 | test "vector @splat" { |
| 158 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 149 | 159 | const S = struct { |
| 150 | 160 | fn testForT(comptime N: comptime_int, v: anytype) !void { |
| 151 | 161 | const T = @TypeOf(v); |
| ... | ... | @@ -181,6 +191,7 @@ test "vector @splat" { |
| 181 | 191 | } |
| 182 | 192 | |
| 183 | 193 | test "load vector elements via comptime index" { |
| 194 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 184 | 195 | const S = struct { |
| 185 | 196 | fn doTheTest() !void { |
| 186 | 197 | var v: Vector(4, i32) = [_]i32{ 1, 2, 3, undefined }; |
| ... | ... | @@ -198,6 +209,7 @@ test "load vector elements via comptime index" { |
| 198 | 209 | } |
| 199 | 210 | |
| 200 | 211 | test "store vector elements via comptime index" { |
| 212 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 201 | 213 | const S = struct { |
| 202 | 214 | fn doTheTest() !void { |
| 203 | 215 | var v: Vector(4, i32) = [_]i32{ 1, 5, 3, undefined }; |
| ... | ... | @@ -221,6 +233,7 @@ test "store vector elements via comptime index" { |
| 221 | 233 | } |
| 222 | 234 | |
| 223 | 235 | test "load vector elements via runtime index" { |
| 236 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 224 | 237 | const S = struct { |
| 225 | 238 | fn doTheTest() !void { |
| 226 | 239 | var v: Vector(4, i32) = [_]i32{ 1, 2, 3, undefined }; |
| ... | ... | @@ -238,6 +251,7 @@ test "load vector elements via runtime index" { |
| 238 | 251 | } |
| 239 | 252 | |
| 240 | 253 | test "store vector elements via runtime index" { |
| 254 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 241 | 255 | const S = struct { |
| 242 | 256 | fn doTheTest() !void { |
| 243 | 257 | var v: Vector(4, i32) = [_]i32{ 1, 5, 3, undefined }; |
| ... | ... | @@ -256,6 +270,7 @@ test "store vector elements via runtime index" { |
| 256 | 270 | } |
| 257 | 271 | |
| 258 | 272 | test "initialize vector which is a struct field" { |
| 273 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 259 | 274 | const Vec4Obj = struct { |
| 260 | 275 | data: Vector(4, f32), |
| 261 | 276 | }; |
| ... | ... | @@ -273,6 +288,7 @@ test "initialize vector which is a struct field" { |
| 273 | 288 | } |
| 274 | 289 | |
| 275 | 290 | test "vector comparison operators" { |
| 291 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 276 | 292 | const S = struct { |
| 277 | 293 | fn doTheTest() !void { |
| 278 | 294 | { |
| ... | ... | @@ -307,6 +323,7 @@ test "vector comparison operators" { |
| 307 | 323 | } |
| 308 | 324 | |
| 309 | 325 | test "vector division operators" { |
| 326 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 310 | 327 | const S = struct { |
| 311 | 328 | fn doTheTestDiv(comptime T: type, x: Vector(4, T), y: Vector(4, T)) !void { |
| 312 | 329 | if (!comptime std.meta.trait.isSignedInt(T)) { |
| ... | ... | @@ -389,6 +406,7 @@ test "vector division operators" { |
| 389 | 406 | } |
| 390 | 407 | |
| 391 | 408 | test "vector bitwise not operator" { |
| 409 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 392 | 410 | const S = struct { |
| 393 | 411 | fn doTheTestNot(comptime T: type, x: Vector(4, T)) !void { |
| 394 | 412 | var y = ~x; |
| ... | ... | @@ -414,6 +432,7 @@ test "vector bitwise not operator" { |
| 414 | 432 | } |
| 415 | 433 | |
| 416 | 434 | test "vector shift operators" { |
| 435 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 417 | 436 | const S = struct { |
| 418 | 437 | fn doTheTestShift(x: anytype, y: anytype) !void { |
| 419 | 438 | const N = @typeInfo(@TypeOf(x)).Array.len; |
| ... | ... | @@ -501,6 +520,7 @@ test "vector shift operators" { |
| 501 | 520 | } |
| 502 | 521 | |
| 503 | 522 | test "vector reduce operation" { |
| 523 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 504 | 524 | const S = struct { |
| 505 | 525 | fn doTheTestReduce(comptime op: std.builtin.ReduceOp, x: anytype, expected: anytype) !void { |
| 506 | 526 | const N = @typeInfo(@TypeOf(x)).Array.len; |
| ... | ... | @@ -636,6 +656,7 @@ test "vector reduce operation" { |
| 636 | 656 | } |
| 637 | 657 | |
| 638 | 658 | test "mask parameter of @shuffle is comptime scope" { |
| 659 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 639 | 660 | const __v4hi = std.meta.Vector(4, i16); |
| 640 | 661 | var v4_a = __v4hi{ 0, 0, 0, 0 }; |
| 641 | 662 | var v4_b = __v4hi{ 0, 0, 0, 0 }; |
| ... | ... | @@ -649,6 +670,7 @@ test "mask parameter of @shuffle is comptime scope" { |
| 649 | 670 | } |
| 650 | 671 | |
| 651 | 672 | test "saturating add" { |
| 673 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 652 | 674 | const S = struct { |
| 653 | 675 | fn doTheTest() !void { |
| 654 | 676 | const u8x3 = std.meta.Vector(3, u8); |
| ... | ... | @@ -662,6 +684,7 @@ test "saturating add" { |
| 662 | 684 | } |
| 663 | 685 | |
| 664 | 686 | test "saturating subtraction" { |
| 687 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 665 | 688 | const S = struct { |
| 666 | 689 | fn doTheTest() !void { |
| 667 | 690 | const u8x3 = std.meta.Vector(3, u8); |
| ... | ... | @@ -673,6 +696,7 @@ test "saturating subtraction" { |
| 673 | 696 | } |
| 674 | 697 | |
| 675 | 698 | test "saturating multiplication" { |
| 699 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 676 | 700 | // TODO: once #9660 has been solved, remove this line |
| 677 | 701 | if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest; |
| 678 | 702 | |
| ... | ... | @@ -688,6 +712,7 @@ test "saturating multiplication" { |
| 688 | 712 | } |
| 689 | 713 | |
| 690 | 714 | test "saturating shift-left" { |
| 715 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 691 | 716 | const S = struct { |
| 692 | 717 | fn doTheTest() !void { |
| 693 | 718 | const u8x3 = std.meta.Vector(3, u8); |