| Index: test/cctest/wasm/test-run-wasm-simd.cc
|
| diff --git a/test/cctest/wasm/test-run-wasm-simd.cc b/test/cctest/wasm/test-run-wasm-simd.cc
|
| index 42b0a959f5c5831032ae4f20710639419009329f..f9b33543dd6e92d4d507018ee3bea843ea9ee964 100644
|
| --- a/test/cctest/wasm/test-run-wasm-simd.cc
|
| +++ b/test/cctest/wasm/test-run-wasm-simd.cc
|
| @@ -799,7 +799,6 @@ WASM_EXEC_TEST(I32x4Add) { RunI32x4BinOpTest(kExprI32x4Add, Add); }
|
|
|
| WASM_EXEC_TEST(I32x4Sub) { RunI32x4BinOpTest(kExprI32x4Sub, Sub); }
|
|
|
| -#if V8_TARGET_ARCH_ARM
|
| WASM_EXEC_TEST(I32x4Mul) { RunI32x4BinOpTest(kExprI32x4Mul, Mul); }
|
|
|
| WASM_EXEC_TEST(I32x4Min) { RunI32x4BinOpTest(kExprI32x4MinS, Minimum); }
|
| @@ -814,11 +813,6 @@ WASM_EXEC_TEST(Ui32x4Max) {
|
| RunI32x4BinOpTest(kExprI32x4MaxU, UnsignedMaximum);
|
| }
|
|
|
| -WASM_EXEC_TEST(S128And) { RunI32x4BinOpTest(kExprS128And, And); }
|
| -
|
| -WASM_EXEC_TEST(S128Or) { RunI32x4BinOpTest(kExprS128Or, Or); }
|
| -
|
| -WASM_EXEC_TEST(S128Xor) { RunI32x4BinOpTest(kExprS128Xor, Xor); }
|
|
|
| void RunI32x4CompareOpTest(WasmOpcode simd_op, Int32BinOp expected_op) {
|
| FLAG_wasm_simd_prototype = true;
|
| @@ -845,6 +839,50 @@ WASM_EXEC_TEST(I32x4Equal) { RunI32x4CompareOpTest(kExprI32x4Eq, Equal); }
|
|
|
| WASM_EXEC_TEST(I32x4NotEqual) { RunI32x4CompareOpTest(kExprI32x4Ne, NotEqual); }
|
|
|
| +// Test Select by making a mask where the first two lanes are true and the rest
|
| +// false, and comparing for non-equality with zero to materialize a bool vector.
|
| +#define WASM_SIMD_SELECT_TEST(format) \
|
| + WASM_EXEC_TEST(S##format##Select) { \
|
| + FLAG_wasm_simd_prototype = true; \
|
| + WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); \
|
| + byte val1 = 0; \
|
| + byte val2 = 1; \
|
| + byte src1 = r.AllocateLocal(kWasmS128); \
|
| + byte src2 = r.AllocateLocal(kWasmS128); \
|
| + byte zero = r.AllocateLocal(kWasmS128); \
|
| + byte mask = r.AllocateLocal(kWasmS128); \
|
| + BUILD(r, WASM_SET_LOCAL( \
|
| + src1, WASM_SIMD_I##format##_SPLAT(WASM_GET_LOCAL(val1))), \
|
| + WASM_SET_LOCAL(src2, \
|
| + WASM_SIMD_I##format##_SPLAT(WASM_GET_LOCAL(val2))), \
|
| + WASM_SET_LOCAL(zero, WASM_SIMD_I##format##_SPLAT(WASM_ZERO)), \
|
| + WASM_SET_LOCAL(mask, WASM_SIMD_I##format##_REPLACE_LANE( \
|
| + 1, WASM_GET_LOCAL(zero), WASM_I32V(-1))), \
|
| + WASM_SET_LOCAL(mask, WASM_SIMD_I##format##_REPLACE_LANE( \
|
| + 2, WASM_GET_LOCAL(mask), WASM_I32V(-1))), \
|
| + WASM_SET_LOCAL( \
|
| + mask, \
|
| + WASM_SIMD_SELECT(format, WASM_SIMD_BINOP(kExprI##format##Ne, \
|
| + WASM_GET_LOCAL(mask), \
|
| + WASM_GET_LOCAL(zero)), \
|
| + WASM_GET_LOCAL(src1), WASM_GET_LOCAL(src2))), \
|
| + WASM_SIMD_CHECK_LANE(I##format, mask, I32, val2, 0), \
|
| + WASM_SIMD_CHECK_LANE(I##format, mask, I32, val1, 1), \
|
| + WASM_SIMD_CHECK_LANE(I##format, mask, I32, val1, 2), \
|
| + WASM_SIMD_CHECK_LANE(I##format, mask, I32, val2, 3), WASM_ONE); \
|
| + \
|
| + CHECK_EQ(1, r.Call(0x12, 0x34)); \
|
| + }
|
| +
|
| +WASM_SIMD_SELECT_TEST(32x4)
|
| +
|
| +#if V8_TARGET_ARCH_ARM
|
| +WASM_EXEC_TEST(S128And) { RunI32x4BinOpTest(kExprS128And, And); }
|
| +
|
| +WASM_EXEC_TEST(S128Or) { RunI32x4BinOpTest(kExprS128Or, Or); }
|
| +
|
| +WASM_EXEC_TEST(S128Xor) { RunI32x4BinOpTest(kExprS128Xor, Xor); }
|
| +
|
| WASM_EXEC_TEST(I32x4Greater) { RunI32x4CompareOpTest(kExprI32x4GtS, Greater); }
|
|
|
| WASM_EXEC_TEST(I32x4GreaterEqual) {
|
| @@ -1196,42 +1234,6 @@ WASM_EXEC_TEST(I8x16ShrU) {
|
| RunI8x16ShiftOpTest(kExprI8x16ShrU, LogicalShiftRight, 1);
|
| }
|
|
|
| -// Test Select by making a mask where the first two lanes are true and the rest
|
| -// false, and comparing for non-equality with zero to materialize a bool vector.
|
| -#define WASM_SIMD_SELECT_TEST(format) \
|
| - WASM_EXEC_TEST(S##format##Select) { \
|
| - FLAG_wasm_simd_prototype = true; \
|
| - WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); \
|
| - byte val1 = 0; \
|
| - byte val2 = 1; \
|
| - byte src1 = r.AllocateLocal(kWasmS128); \
|
| - byte src2 = r.AllocateLocal(kWasmS128); \
|
| - byte zero = r.AllocateLocal(kWasmS128); \
|
| - byte mask = r.AllocateLocal(kWasmS128); \
|
| - BUILD(r, WASM_SET_LOCAL( \
|
| - src1, WASM_SIMD_I##format##_SPLAT(WASM_GET_LOCAL(val1))), \
|
| - WASM_SET_LOCAL(src2, \
|
| - WASM_SIMD_I##format##_SPLAT(WASM_GET_LOCAL(val2))), \
|
| - WASM_SET_LOCAL(zero, WASM_SIMD_I##format##_SPLAT(WASM_ZERO)), \
|
| - WASM_SET_LOCAL(mask, WASM_SIMD_I##format##_REPLACE_LANE( \
|
| - 1, WASM_GET_LOCAL(zero), WASM_I32V(-1))), \
|
| - WASM_SET_LOCAL(mask, WASM_SIMD_I##format##_REPLACE_LANE( \
|
| - 2, WASM_GET_LOCAL(mask), WASM_I32V(-1))), \
|
| - WASM_SET_LOCAL( \
|
| - mask, \
|
| - WASM_SIMD_SELECT(format, WASM_SIMD_BINOP(kExprI##format##Ne, \
|
| - WASM_GET_LOCAL(mask), \
|
| - WASM_GET_LOCAL(zero)), \
|
| - WASM_GET_LOCAL(src1), WASM_GET_LOCAL(src2))), \
|
| - WASM_SIMD_CHECK_LANE(I##format, mask, I32, val2, 0), \
|
| - WASM_SIMD_CHECK_LANE(I##format, mask, I32, val1, 1), \
|
| - WASM_SIMD_CHECK_LANE(I##format, mask, I32, val1, 2), \
|
| - WASM_SIMD_CHECK_LANE(I##format, mask, I32, val2, 3), WASM_ONE); \
|
| - \
|
| - CHECK_EQ(1, r.Call(0x12, 0x34)); \
|
| - }
|
| -
|
| -WASM_SIMD_SELECT_TEST(32x4)
|
| WASM_SIMD_SELECT_TEST(16x8)
|
| WASM_SIMD_SELECT_TEST(8x16)
|
| #endif // V8_TARGET_ARCH_ARM
|
|
|