OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/assembler-inl.h" | 5 #include "src/assembler-inl.h" |
6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
7 #include "test/cctest/compiler/value-helper.h" | 7 #include "test/cctest/compiler/value-helper.h" |
8 #include "test/cctest/wasm/wasm-run-utils.h" | 8 #include "test/cctest/wasm/wasm-run-utils.h" |
9 #include "test/common/wasm/wasm-macro-gen.h" | 9 #include "test/common/wasm/wasm-macro-gen.h" |
10 | 10 |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 WASM_SIMD_I16x8_REPLACE_LANE(7, WASM_GET_LOCAL(simd), | 735 WASM_SIMD_I16x8_REPLACE_LANE(7, WASM_GET_LOCAL(simd), |
736 WASM_GET_LOCAL(new_val))), | 736 WASM_GET_LOCAL(new_val))), |
737 WASM_SIMD_CHECK_SPLAT8(I16x8, simd, I32, new_val), WASM_ONE); | 737 WASM_SIMD_CHECK_SPLAT8(I16x8, simd, I32, new_val), WASM_ONE); |
738 | 738 |
739 CHECK_EQ(1, r.Call(1, 2)); | 739 CHECK_EQ(1, r.Call(1, 2)); |
740 } | 740 } |
741 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET || | 741 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET || |
742 // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 742 // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 |
743 | 743 |
744 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || \ | 744 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || \ |
745 V8_TARGET_ARCH_MIPS64 | 745 V8_TARGET_ARCH_MIPS64 || SIMD_LOWERING_TARGET |
746 WASM_EXEC_COMPILED_TEST(I8x16Splat) { | 746 WASM_EXEC_COMPILED_TEST(I8x16Splat) { |
747 FLAG_wasm_simd_prototype = true; | 747 FLAG_wasm_simd_prototype = true; |
748 | 748 |
749 WasmRunner<int32_t, int32_t> r(kExecuteCompiled); | 749 WasmRunner<int32_t, int32_t> r(kExecuteCompiled); |
750 byte lane_val = 0; | 750 byte lane_val = 0; |
751 byte simd = r.AllocateLocal(kWasmS128); | 751 byte simd = r.AllocateLocal(kWasmS128); |
752 BUILD(r, | 752 BUILD(r, |
753 WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(lane_val))), | 753 WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(lane_val))), |
754 WASM_SIMD_CHECK_SPLAT8(I8x16, simd, I32, lane_val), WASM_ONE); | 754 WASM_SIMD_CHECK_SPLAT8(I8x16, simd, I32, lane_val), WASM_ONE); |
755 | 755 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 new_val, new_val, new_val, new_val, new_val, new_val, | 854 new_val, new_val, new_val, new_val, new_val, new_val, |
855 new_val, new_val, new_val, new_val, new_val, old_val), | 855 new_val, new_val, new_val, new_val, new_val, old_val), |
856 WASM_SET_LOCAL(simd, | 856 WASM_SET_LOCAL(simd, |
857 WASM_SIMD_I8x16_REPLACE_LANE(15, WASM_GET_LOCAL(simd), | 857 WASM_SIMD_I8x16_REPLACE_LANE(15, WASM_GET_LOCAL(simd), |
858 WASM_GET_LOCAL(new_val))), | 858 WASM_GET_LOCAL(new_val))), |
859 WASM_SIMD_CHECK_SPLAT16(I8x16, simd, I32, new_val), WASM_ONE); | 859 WASM_SIMD_CHECK_SPLAT16(I8x16, simd, I32, new_val), WASM_ONE); |
860 | 860 |
861 CHECK_EQ(1, r.Call(1, 2)); | 861 CHECK_EQ(1, r.Call(1, 2)); |
862 } | 862 } |
863 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || | 863 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || |
864 // V8_TARGET_ARCH_MIPS64 | 864 // V8_TARGET_ARCH_MIPS64 || SIMD_LOWERING_TARGET |
865 | 865 |
866 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \ | 866 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \ |
867 V8_TARGET_ARCH_MIPS64 | 867 V8_TARGET_ARCH_MIPS64 |
868 // Determines if conversion from float to int will be valid. | 868 // Determines if conversion from float to int will be valid. |
869 bool CanRoundToZeroAndConvert(double val, bool unsigned_integer) { | 869 bool CanRoundToZeroAndConvert(double val, bool unsigned_integer) { |
870 const double max_uint = static_cast<double>(0xffffffffu); | 870 const double max_uint = static_cast<double>(0xffffffffu); |
871 const double max_int = static_cast<double>(kMaxInt); | 871 const double max_int = static_cast<double>(kMaxInt); |
872 const double min_int = static_cast<double>(kMinInt); | 872 const double min_int = static_cast<double>(kMinInt); |
873 | 873 |
874 // Check for NaN. | 874 // Check for NaN. |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 WASM_EXEC_COMPILED_TEST(I16x8ShrS) { | 1363 WASM_EXEC_COMPILED_TEST(I16x8ShrS) { |
1364 RunI16x8ShiftOpTest(kExprI16x8ShrS, ArithmeticShiftRight, 1); | 1364 RunI16x8ShiftOpTest(kExprI16x8ShrS, ArithmeticShiftRight, 1); |
1365 } | 1365 } |
1366 | 1366 |
1367 WASM_EXEC_COMPILED_TEST(I16x8ShrU) { | 1367 WASM_EXEC_COMPILED_TEST(I16x8ShrU) { |
1368 RunI16x8ShiftOpTest(kExprI16x8ShrU, LogicalShiftRight, 1); | 1368 RunI16x8ShiftOpTest(kExprI16x8ShrU, LogicalShiftRight, 1); |
1369 } | 1369 } |
1370 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET || | 1370 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET || |
1371 // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 1371 // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 |
1372 | 1372 |
1373 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 1373 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || \ |
| 1374 SIMD_LOWERING_TARGET |
1374 void RunI8x16UnOpTest(WasmOpcode simd_op, Int8UnOp expected_op) { | 1375 void RunI8x16UnOpTest(WasmOpcode simd_op, Int8UnOp expected_op) { |
1375 FLAG_wasm_simd_prototype = true; | 1376 FLAG_wasm_simd_prototype = true; |
1376 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); | 1377 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); |
1377 byte a = 0; | 1378 byte a = 0; |
1378 byte expected = 1; | 1379 byte expected = 1; |
1379 byte simd = r.AllocateLocal(kWasmS128); | 1380 byte simd = r.AllocateLocal(kWasmS128); |
1380 BUILD(r, WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))), | 1381 BUILD(r, WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))), |
1381 WASM_SET_LOCAL(simd, WASM_SIMD_UNOP(simd_op, WASM_GET_LOCAL(simd))), | 1382 WASM_SET_LOCAL(simd, WASM_SIMD_UNOP(simd_op, WASM_GET_LOCAL(simd))), |
1382 WASM_SIMD_CHECK_SPLAT16(I8x16, simd, I32, expected), WASM_ONE); | 1383 WASM_SIMD_CHECK_SPLAT16(I8x16, simd, I32, expected), WASM_ONE); |
1383 | 1384 |
1384 FOR_INT8_INPUTS(i) { CHECK_EQ(1, r.Call(*i, expected_op(*i))); } | 1385 FOR_INT8_INPUTS(i) { CHECK_EQ(1, r.Call(*i, expected_op(*i))); } |
1385 } | 1386 } |
1386 | 1387 |
1387 WASM_EXEC_COMPILED_TEST(I8x16Neg) { RunI8x16UnOpTest(kExprI8x16Neg, Negate); } | 1388 WASM_EXEC_COMPILED_TEST(I8x16Neg) { RunI8x16UnOpTest(kExprI8x16Neg, Negate); } |
1388 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 1389 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || |
| 1390 // SIMD_LOWERING_TARGET |
1389 | 1391 |
1390 #if V8_TARGET_ARCH_ARM | 1392 #if V8_TARGET_ARCH_ARM |
1391 // Tests both signed and unsigned conversion from I16x8 (packing). | 1393 // Tests both signed and unsigned conversion from I16x8 (packing). |
1392 WASM_EXEC_COMPILED_TEST(I8x16ConvertI16x8) { | 1394 WASM_EXEC_COMPILED_TEST(I8x16ConvertI16x8) { |
1393 FLAG_wasm_simd_prototype = true; | 1395 FLAG_wasm_simd_prototype = true; |
1394 WasmRunner<int32_t, int32_t, int32_t, int32_t> r(kExecuteCompiled); | 1396 WasmRunner<int32_t, int32_t, int32_t, int32_t> r(kExecuteCompiled); |
1395 byte a = 0; | 1397 byte a = 0; |
1396 byte packed_signed = 1; | 1398 byte packed_signed = 1; |
1397 byte packed_unsigned = 2; | 1399 byte packed_unsigned = 2; |
1398 byte simd0 = r.AllocateLocal(kWasmS128); | 1400 byte simd0 = r.AllocateLocal(kWasmS128); |
(...skipping 12 matching lines...) Expand all Loading... |
1411 FOR_INT16_INPUTS(i) { | 1413 FOR_INT16_INPUTS(i) { |
1412 int32_t packed_signed = Narrow<int8_t>(*i); | 1414 int32_t packed_signed = Narrow<int8_t>(*i); |
1413 int32_t packed_unsigned = UnsignedNarrow<int8_t>(*i); | 1415 int32_t packed_unsigned = UnsignedNarrow<int8_t>(*i); |
1414 // Sign-extend here, since ExtractLane sign extends. | 1416 // Sign-extend here, since ExtractLane sign extends. |
1415 if (packed_unsigned & 0x80) packed_unsigned |= 0xffffff00; | 1417 if (packed_unsigned & 0x80) packed_unsigned |= 0xffffff00; |
1416 CHECK_EQ(1, r.Call(*i, packed_signed, packed_unsigned)); | 1418 CHECK_EQ(1, r.Call(*i, packed_signed, packed_unsigned)); |
1417 } | 1419 } |
1418 } | 1420 } |
1419 #endif // V8_TARGET_ARCH_ARM | 1421 #endif // V8_TARGET_ARCH_ARM |
1420 | 1422 |
1421 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 | 1423 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET |
1422 void RunI8x16BinOpTest(WasmOpcode simd_op, Int8BinOp expected_op) { | 1424 void RunI8x16BinOpTest(WasmOpcode simd_op, Int8BinOp expected_op) { |
1423 FLAG_wasm_simd_prototype = true; | 1425 FLAG_wasm_simd_prototype = true; |
1424 WasmRunner<int32_t, int32_t, int32_t, int32_t> r(kExecuteCompiled); | 1426 WasmRunner<int32_t, int32_t, int32_t, int32_t> r(kExecuteCompiled); |
1425 byte a = 0; | 1427 byte a = 0; |
1426 byte b = 1; | 1428 byte b = 1; |
1427 byte expected = 2; | 1429 byte expected = 2; |
1428 byte simd0 = r.AllocateLocal(kWasmS128); | 1430 byte simd0 = r.AllocateLocal(kWasmS128); |
1429 byte simd1 = r.AllocateLocal(kWasmS128); | 1431 byte simd1 = r.AllocateLocal(kWasmS128); |
1430 BUILD(r, WASM_SET_LOCAL(simd0, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))), | 1432 BUILD(r, WASM_SET_LOCAL(simd0, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))), |
1431 WASM_SET_LOCAL(simd1, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(b))), | 1433 WASM_SET_LOCAL(simd1, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(b))), |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 FOR_INT8_INPUTS(i) { | 1495 FOR_INT8_INPUTS(i) { |
1494 FOR_INT8_INPUTS(j) { CHECK_EQ(1, r.Call(*i, *j, expected_op(*i, *j))); } | 1496 FOR_INT8_INPUTS(j) { CHECK_EQ(1, r.Call(*i, *j, expected_op(*i, *j))); } |
1495 } | 1497 } |
1496 } | 1498 } |
1497 | 1499 |
1498 WASM_EXEC_COMPILED_TEST(I8x16Eq) { RunI8x16CompareOpTest(kExprI8x16Eq, Equal); } | 1500 WASM_EXEC_COMPILED_TEST(I8x16Eq) { RunI8x16CompareOpTest(kExprI8x16Eq, Equal); } |
1499 | 1501 |
1500 WASM_EXEC_COMPILED_TEST(I8x16Ne) { | 1502 WASM_EXEC_COMPILED_TEST(I8x16Ne) { |
1501 RunI8x16CompareOpTest(kExprI8x16Ne, NotEqual); | 1503 RunI8x16CompareOpTest(kExprI8x16Ne, NotEqual); |
1502 } | 1504 } |
1503 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 | 1505 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET |
1504 | 1506 |
1505 #if V8_TARGET_ARCH_ARM | 1507 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET |
1506 WASM_EXEC_COMPILED_TEST(I8x16Mul) { RunI8x16BinOpTest(kExprI8x16Mul, Mul); } | 1508 WASM_EXEC_COMPILED_TEST(I8x16Mul) { RunI8x16BinOpTest(kExprI8x16Mul, Mul); } |
1507 | 1509 |
1508 WASM_EXEC_COMPILED_TEST(I8x16GtS) { | 1510 WASM_EXEC_COMPILED_TEST(I8x16GtS) { |
1509 RunI8x16CompareOpTest(kExprI8x16GtS, Greater); | 1511 RunI8x16CompareOpTest(kExprI8x16GtS, Greater); |
1510 } | 1512 } |
1511 | 1513 |
1512 WASM_EXEC_COMPILED_TEST(I8x16GeS) { | 1514 WASM_EXEC_COMPILED_TEST(I8x16GeS) { |
1513 RunI8x16CompareOpTest(kExprI8x16GeS, GreaterEqual); | 1515 RunI8x16CompareOpTest(kExprI8x16GeS, GreaterEqual); |
1514 } | 1516 } |
1515 | 1517 |
(...skipping 13 matching lines...) Expand all Loading... |
1529 RunI8x16CompareOpTest(kExprI8x16GeU, UnsignedGreaterEqual); | 1531 RunI8x16CompareOpTest(kExprI8x16GeU, UnsignedGreaterEqual); |
1530 } | 1532 } |
1531 | 1533 |
1532 WASM_EXEC_COMPILED_TEST(I8x16LtU) { | 1534 WASM_EXEC_COMPILED_TEST(I8x16LtU) { |
1533 RunI8x16CompareOpTest(kExprI8x16LtU, UnsignedLess); | 1535 RunI8x16CompareOpTest(kExprI8x16LtU, UnsignedLess); |
1534 } | 1536 } |
1535 | 1537 |
1536 WASM_EXEC_COMPILED_TEST(I8x16LeU) { | 1538 WASM_EXEC_COMPILED_TEST(I8x16LeU) { |
1537 RunI8x16CompareOpTest(kExprI8x16LeU, UnsignedLessEqual); | 1539 RunI8x16CompareOpTest(kExprI8x16LeU, UnsignedLessEqual); |
1538 } | 1540 } |
1539 #endif // V8_TARGET_ARCH_ARM | 1541 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET |
1540 | 1542 |
1541 void RunI8x16ShiftOpTest(WasmOpcode simd_op, Int8ShiftOp expected_op, | 1543 void RunI8x16ShiftOpTest(WasmOpcode simd_op, Int8ShiftOp expected_op, |
1542 int shift) { | 1544 int shift) { |
1543 FLAG_wasm_simd_prototype = true; | 1545 FLAG_wasm_simd_prototype = true; |
1544 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); | 1546 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); |
1545 byte a = 0; | 1547 byte a = 0; |
1546 byte expected = 1; | 1548 byte expected = 1; |
1547 byte simd = r.AllocateLocal(kWasmS128); | 1549 byte simd = r.AllocateLocal(kWasmS128); |
1548 BUILD(r, WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))), | 1550 BUILD(r, WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))), |
1549 WASM_SET_LOCAL( | 1551 WASM_SET_LOCAL( |
1550 simd, WASM_SIMD_SHIFT_OP(simd_op, shift, WASM_GET_LOCAL(simd))), | 1552 simd, WASM_SIMD_SHIFT_OP(simd_op, shift, WASM_GET_LOCAL(simd))), |
1551 WASM_SIMD_CHECK_SPLAT16(I8x16, simd, I32, expected), WASM_ONE); | 1553 WASM_SIMD_CHECK_SPLAT16(I8x16, simd, I32, expected), WASM_ONE); |
1552 | 1554 |
1553 FOR_INT8_INPUTS(i) { CHECK_EQ(1, r.Call(*i, expected_op(*i, shift))); } | 1555 FOR_INT8_INPUTS(i) { CHECK_EQ(1, r.Call(*i, expected_op(*i, shift))); } |
1554 } | 1556 } |
1555 | 1557 |
1556 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 1558 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || \ |
| 1559 SIMD_LOWERING_TARGET |
1557 WASM_EXEC_COMPILED_TEST(I8x16Shl) { | 1560 WASM_EXEC_COMPILED_TEST(I8x16Shl) { |
1558 RunI8x16ShiftOpTest(kExprI8x16Shl, LogicalShiftLeft, 1); | 1561 RunI8x16ShiftOpTest(kExprI8x16Shl, LogicalShiftLeft, 1); |
1559 } | 1562 } |
1560 | 1563 |
1561 WASM_EXEC_COMPILED_TEST(I8x16ShrS) { | 1564 WASM_EXEC_COMPILED_TEST(I8x16ShrS) { |
1562 RunI8x16ShiftOpTest(kExprI8x16ShrS, ArithmeticShiftRight, 1); | 1565 RunI8x16ShiftOpTest(kExprI8x16ShrS, ArithmeticShiftRight, 1); |
1563 } | 1566 } |
1564 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 1567 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || |
| 1568 // SIMD_LOWERING_TARGET |
1565 | 1569 |
1566 #if V8_TARGET_ARCH_ARM | 1570 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET |
1567 WASM_EXEC_COMPILED_TEST(I8x16ShrU) { | 1571 WASM_EXEC_COMPILED_TEST(I8x16ShrU) { |
1568 RunI8x16ShiftOpTest(kExprI8x16ShrU, LogicalShiftRight, 1); | 1572 RunI8x16ShiftOpTest(kExprI8x16ShrU, LogicalShiftRight, 1); |
1569 } | 1573 } |
1570 #endif // V8_TARGET_ARCH_ARM | 1574 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET |
1571 | 1575 |
1572 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || \ | 1576 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || \ |
1573 V8_TARGET_ARCH_MIPS64 | 1577 V8_TARGET_ARCH_MIPS64 |
1574 // Test Select by making a mask where the first two lanes are true and the rest | 1578 // Test Select by making a mask where the first two lanes are true and the rest |
1575 // false, and comparing for non-equality with zero to materialize a bool vector. | 1579 // false, and comparing for non-equality with zero to materialize a bool vector. |
1576 #define WASM_SIMD_SELECT_TEST(format) \ | 1580 #define WASM_SIMD_SELECT_TEST(format) \ |
1577 WASM_EXEC_COMPILED_TEST(S##format##Select) { \ | 1581 WASM_EXEC_COMPILED_TEST(S##format##Select) { \ |
1578 FLAG_wasm_simd_prototype = true; \ | 1582 FLAG_wasm_simd_prototype = true; \ |
1579 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); \ | 1583 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); \ |
1580 byte val1 = 0; \ | 1584 byte val1 = 0; \ |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 WASM_EXEC_COMPILED_TEST(S1x8Xor) { RunS1x8BinOpTest(kExprS1x8Xor, Xor); } | 2057 WASM_EXEC_COMPILED_TEST(S1x8Xor) { RunS1x8BinOpTest(kExprS1x8Xor, Xor); } |
2054 | 2058 |
2055 WASM_EXEC_COMPILED_TEST(S1x16And) { RunS1x16BinOpTest(kExprS1x16And, And); } | 2059 WASM_EXEC_COMPILED_TEST(S1x16And) { RunS1x16BinOpTest(kExprS1x16And, And); } |
2056 | 2060 |
2057 WASM_EXEC_COMPILED_TEST(S1x16Or) { RunS1x16BinOpTest(kExprS1x16Or, Or); } | 2061 WASM_EXEC_COMPILED_TEST(S1x16Or) { RunS1x16BinOpTest(kExprS1x16Or, Or); } |
2058 | 2062 |
2059 WASM_EXEC_COMPILED_TEST(S1x16Xor) { RunS1x16BinOpTest(kExprS1x16Xor, Xor); } | 2063 WASM_EXEC_COMPILED_TEST(S1x16Xor) { RunS1x16BinOpTest(kExprS1x16Xor, Xor); } |
2060 #endif // !V8_TARGET_ARCH_ARM | 2064 #endif // !V8_TARGET_ARCH_ARM |
2061 | 2065 |
2062 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET | 2066 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET |
2063 | |
2064 WASM_EXEC_COMPILED_TEST(SimdI32x4ExtractWithF32x4) { | 2067 WASM_EXEC_COMPILED_TEST(SimdI32x4ExtractWithF32x4) { |
2065 FLAG_wasm_simd_prototype = true; | 2068 FLAG_wasm_simd_prototype = true; |
2066 WasmRunner<int32_t> r(kExecuteCompiled); | 2069 WasmRunner<int32_t> r(kExecuteCompiled); |
2067 BUILD(r, WASM_IF_ELSE_I( | 2070 BUILD(r, WASM_IF_ELSE_I( |
2068 WASM_I32_EQ(WASM_SIMD_I32x4_EXTRACT_LANE( | 2071 WASM_I32_EQ(WASM_SIMD_I32x4_EXTRACT_LANE( |
2069 0, WASM_SIMD_F32x4_SPLAT(WASM_F32(30.5))), | 2072 0, WASM_SIMD_F32x4_SPLAT(WASM_F32(30.5))), |
2070 WASM_I32_REINTERPRET_F32(WASM_F32(30.5))), | 2073 WASM_I32_REINTERPRET_F32(WASM_F32(30.5))), |
2071 WASM_I32V(1), WASM_I32V(0))); | 2074 WASM_I32V(1), WASM_I32V(0))); |
2072 CHECK_EQ(1, r.Call()); | 2075 CHECK_EQ(1, r.Call()); |
2073 } | 2076 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 WASM_SIMD_I32x4_EXTRACT_LANE( | 2337 WASM_SIMD_I32x4_EXTRACT_LANE( |
2335 0, WASM_LOAD_MEM(MachineType::Simd128(), WASM_ZERO))); | 2338 0, WASM_LOAD_MEM(MachineType::Simd128(), WASM_ZERO))); |
2336 | 2339 |
2337 FOR_INT32_INPUTS(i) { | 2340 FOR_INT32_INPUTS(i) { |
2338 int32_t expected = *i; | 2341 int32_t expected = *i; |
2339 r.module().WriteMemory(&memory[0], expected); | 2342 r.module().WriteMemory(&memory[0], expected); |
2340 CHECK_EQ(expected, r.Call()); | 2343 CHECK_EQ(expected, r.Call()); |
2341 } | 2344 } |
2342 } | 2345 } |
2343 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_X64 | 2346 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_X64 |
OLD | NEW |