wasm: enable bool vectors tests for stage2_llvm

This commit is contained in:
Paul Berg 2024-02-13 22:29:01 +01:00 committed by Paul Berg
parent 1138166289
commit 42446e6bf9
2 changed files with 10 additions and 5 deletions

View File

@ -236,7 +236,7 @@ struct SplitStructMixed zig_ret_split_struct_mixed();
struct BigStruct zig_big_struct_both(struct BigStruct); struct BigStruct zig_big_struct_both(struct BigStruct);
#if defined(ZIG_BACKEND_STAGE2_X86_64) || defined(ZIG_PPC32) #if defined(ZIG_BACKEND_STAGE2_X86_64) || defined(ZIG_PPC32) || defined(__wasm__)
typedef bool Vector2Bool __attribute__((ext_vector_type(2))); typedef bool Vector2Bool __attribute__((ext_vector_type(2)));
typedef bool Vector4Bool __attribute__((ext_vector_type(4))); typedef bool Vector4Bool __attribute__((ext_vector_type(4)));
@ -523,6 +523,9 @@ void c_vector_128_bool(Vector128Bool vec) {
assert_or_panic(vec[127] == true); assert_or_panic(vec[127] == true);
} }
// WASM: The following vector functions define too many Wasm locals for wasmtime in debug mode and are therefore disabled for the wasm target.
#if !defined(__wasm__)
void c_vector_256_bool(Vector256Bool vec) { void c_vector_256_bool(Vector256Bool vec) {
assert_or_panic(vec[0] == false); assert_or_panic(vec[0] == false);
assert_or_panic(vec[1] == true); assert_or_panic(vec[1] == true);
@ -1297,6 +1300,8 @@ void c_vector_512_bool(Vector512Bool vec) {
assert_or_panic(vec[511] == true); assert_or_panic(vec[511] == true);
} }
#endif
Vector2Bool c_ret_vector_2_bool(void) { Vector2Bool c_ret_vector_2_bool(void) {
return (Vector2Bool){ return (Vector2Bool){
true, true,

View File

@ -921,7 +921,7 @@ extern fn c_ret_vector_256_bool() Vector256Bool;
extern fn c_ret_vector_512_bool() Vector512Bool; extern fn c_ret_vector_512_bool() Vector512Bool;
test "bool simd vector" { test "bool simd vector" {
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .powerpc) return error.SkipZigTest; if (builtin.zig_backend == .stage2_llvm and (builtin.cpu.arch != .powerpc and builtin.cpu.arch != .wasm32)) return error.SkipZigTest;
{ {
c_vector_2_bool(.{ c_vector_2_bool(.{
@ -1473,8 +1473,9 @@ test "bool simd vector" {
try expect(vec[126] == false); try expect(vec[126] == false);
try expect(vec[127] == true); try expect(vec[127] == true);
} }
{ {
c_vector_256_bool(.{ if (builtin.target.cpu.arch != .wasm32) c_vector_256_bool(.{
false, false,
true, true,
true, true,
@ -1992,7 +1993,7 @@ test "bool simd vector" {
try expect(vec[255] == false); try expect(vec[255] == false);
} }
{ {
c_vector_512_bool(.{ if (builtin.target.cpu.arch != .wasm32) c_vector_512_bool(.{
true, true,
true, true,
true, true,
@ -3025,7 +3026,6 @@ test "bool simd vector" {
comptime { comptime {
skip: { skip: {
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) break :skip;
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64) break :skip; if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64) break :skip;
_ = struct { _ = struct {