authorgravatar for paul@plutojl.orgPaul Berg <paul@plutojl.org> 2024-02-13 22:29:01+01:00
committergravatar for paul@plutojl.orgPaul Berg <paul@plutojl.org> 2024-02-15 13:17:37+01:00
log42446e6bf9cd224125fbbf334dd5a0712c94e8c5
tree4f04e10541e8072b618c3524992f714ac0674ad1
parent11381662896e1961df2f94a5f044e892d9baf93a

wasm: enable bool vectors tests for stage2_llvm


2 files changed, 10 insertions(+), 5 deletions(-)

test/c_abi/cfuncs.c+6-1
...@@ -236,7 +236,7 @@ struct SplitStructMixed zig_ret_split_struct_mixed();...@@ -236,7 +236,7 @@ struct SplitStructMixed zig_ret_split_struct_mixed();
236236
237struct BigStruct zig_big_struct_both(struct BigStruct);237struct BigStruct zig_big_struct_both(struct BigStruct);
238238
239#if defined(ZIG_BACKEND_STAGE2_X86_64) || defined(ZIG_PPC32)239#if defined(ZIG_BACKEND_STAGE2_X86_64) || defined(ZIG_PPC32) || defined(__wasm__)
240240
241typedef bool Vector2Bool __attribute__((ext_vector_type(2)));241typedef bool Vector2Bool __attribute__((ext_vector_type(2)));
242typedef bool Vector4Bool __attribute__((ext_vector_type(4)));242typedef bool Vector4Bool __attribute__((ext_vector_type(4)));
...@@ -523,6 +523,9 @@ void c_vector_128_bool(Vector128Bool vec) {...@@ -523,6 +523,9 @@ void c_vector_128_bool(Vector128Bool vec) {
523 assert_or_panic(vec[127] == true);523 assert_or_panic(vec[127] == true);
524}524}
525525
526// WASM: The following vector functions define too many Wasm locals for wasmtime in debug mode and are therefore disabled for the wasm target.
527#if !defined(__wasm__)
528
526void c_vector_256_bool(Vector256Bool vec) {529void c_vector_256_bool(Vector256Bool vec) {
527 assert_or_panic(vec[0] == false);530 assert_or_panic(vec[0] == false);
528 assert_or_panic(vec[1] == true);531 assert_or_panic(vec[1] == true);
...@@ -1297,6 +1300,8 @@ void c_vector_512_bool(Vector512Bool vec) {...@@ -1297,6 +1300,8 @@ void c_vector_512_bool(Vector512Bool vec) {
1297 assert_or_panic(vec[511] == true);1300 assert_or_panic(vec[511] == true);
1298}1301}
12991302
1303#endif
1304
1300Vector2Bool c_ret_vector_2_bool(void) {1305Vector2Bool c_ret_vector_2_bool(void) {
1301 return (Vector2Bool){1306 return (Vector2Bool){
1302 true,1307 true,
test/c_abi/main.zig+4-4
...@@ -921,7 +921,7 @@ extern fn c_ret_vector_256_bool() Vector256Bool;...@@ -921,7 +921,7 @@ extern fn c_ret_vector_256_bool() Vector256Bool;
921extern fn c_ret_vector_512_bool() Vector512Bool;921extern fn c_ret_vector_512_bool() Vector512Bool;
922922
923test "bool simd vector" {923test "bool simd vector" {
924 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .powerpc) return error.SkipZigTest;924 if (builtin.zig_backend == .stage2_llvm and (builtin.cpu.arch != .powerpc and builtin.cpu.arch != .wasm32)) return error.SkipZigTest;
925925
926 {926 {
927 c_vector_2_bool(.{927 c_vector_2_bool(.{
...@@ -1473,8 +1473,9 @@ test "bool simd vector" {...@@ -1473,8 +1473,9 @@ test "bool simd vector" {
1473 try expect(vec[126] == false);1473 try expect(vec[126] == false);
1474 try expect(vec[127] == true);1474 try expect(vec[127] == true);
1475 }1475 }
1476
1476 {1477 {
1477 c_vector_256_bool(.{1478 if (builtin.target.cpu.arch != .wasm32) c_vector_256_bool(.{
1478 false,1479 false,
1479 true,1480 true,
1480 true,1481 true,
...@@ -1992,7 +1993,7 @@ test "bool simd vector" {...@@ -1992,7 +1993,7 @@ test "bool simd vector" {
1992 try expect(vec[255] == false);1993 try expect(vec[255] == false);
1993 }1994 }
1994 {1995 {
1995 c_vector_512_bool(.{1996 if (builtin.target.cpu.arch != .wasm32) c_vector_512_bool(.{
1996 true,1997 true,
1997 true,1998 true,
1998 true,1999 true,
...@@ -3025,7 +3026,6 @@ test "bool simd vector" {...@@ -3025,7 +3026,6 @@ test "bool simd vector" {
30253026
3026comptime {3027comptime {
3027 skip: {3028 skip: {
3028 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) break :skip;
3029 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64) break :skip;3029 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64) break :skip;
30303030
3031 _ = struct {3031 _ = struct {