Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: test/cctest/wasm/test-run-wasm-simd.cc

Issue 2874403002: [wasm] Swap the implementation of SIMD compare ops using Gt/Ge insteas of Lt/Le (Closed)
Patch Set: Add Todo with bug reference Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 1499
1500 WASM_EXEC_COMPILED_TEST(I8x16Eq) { RunI8x16CompareOpTest(kExprI8x16Eq, Equal); } 1500 WASM_EXEC_COMPILED_TEST(I8x16Eq) { RunI8x16CompareOpTest(kExprI8x16Eq, Equal); }
1501 1501
1502 WASM_EXEC_COMPILED_TEST(I8x16Ne) { 1502 WASM_EXEC_COMPILED_TEST(I8x16Ne) {
1503 RunI8x16CompareOpTest(kExprI8x16Ne, NotEqual); 1503 RunI8x16CompareOpTest(kExprI8x16Ne, NotEqual);
1504 } 1504 }
1505 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET 1505 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET
1506 1506
1507 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET 1507 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
1508 WASM_EXEC_COMPILED_TEST(I8x16Mul) { RunI8x16BinOpTest(kExprI8x16Mul, Mul); } 1508 WASM_EXEC_COMPILED_TEST(I8x16Mul) { RunI8x16BinOpTest(kExprI8x16Mul, Mul); }
1509 #endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64
1509 1510
1511 // TODO(gdeepti): Remove special case for ARM64 after v8:6421 is fixed
1512 #if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET && !V8_TARGET_ARCH_ARM64
1510 WASM_EXEC_COMPILED_TEST(I8x16GtS) { 1513 WASM_EXEC_COMPILED_TEST(I8x16GtS) {
1511 RunI8x16CompareOpTest(kExprI8x16GtS, Greater); 1514 RunI8x16CompareOpTest(kExprI8x16GtS, Greater);
1512 } 1515 }
1513 1516
1514 WASM_EXEC_COMPILED_TEST(I8x16GeS) { 1517 WASM_EXEC_COMPILED_TEST(I8x16GeS) {
1515 RunI8x16CompareOpTest(kExprI8x16GeS, GreaterEqual); 1518 RunI8x16CompareOpTest(kExprI8x16GeS, GreaterEqual);
1516 } 1519 }
1517 1520
1518 WASM_EXEC_COMPILED_TEST(I8x16LtS) { 1521 WASM_EXEC_COMPILED_TEST(I8x16LtS) {
1519 RunI8x16CompareOpTest(kExprI8x16LtS, Less); 1522 RunI8x16CompareOpTest(kExprI8x16LtS, Less);
(...skipping 11 matching lines...) Expand all
1531 RunI8x16CompareOpTest(kExprI8x16GeU, UnsignedGreaterEqual); 1534 RunI8x16CompareOpTest(kExprI8x16GeU, UnsignedGreaterEqual);
1532 } 1535 }
1533 1536
1534 WASM_EXEC_COMPILED_TEST(I8x16LtU) { 1537 WASM_EXEC_COMPILED_TEST(I8x16LtU) {
1535 RunI8x16CompareOpTest(kExprI8x16LtU, UnsignedLess); 1538 RunI8x16CompareOpTest(kExprI8x16LtU, UnsignedLess);
1536 } 1539 }
1537 1540
1538 WASM_EXEC_COMPILED_TEST(I8x16LeU) { 1541 WASM_EXEC_COMPILED_TEST(I8x16LeU) {
1539 RunI8x16CompareOpTest(kExprI8x16LeU, UnsignedLessEqual); 1542 RunI8x16CompareOpTest(kExprI8x16LeU, UnsignedLessEqual);
1540 } 1543 }
1541 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET 1544 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET && !V8_TARGET_ARCH_ARM64
1542 1545
1543 void RunI8x16ShiftOpTest(WasmOpcode simd_op, Int8ShiftOp expected_op, 1546 void RunI8x16ShiftOpTest(WasmOpcode simd_op, Int8ShiftOp expected_op,
1544 int shift) { 1547 int shift) {
1545 FLAG_wasm_simd_prototype = true; 1548 FLAG_wasm_simd_prototype = true;
1546 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled); 1549 WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled);
1547 byte a = 0; 1550 byte a = 0;
1548 byte expected = 1; 1551 byte expected = 1;
1549 byte simd = r.AllocateLocal(kWasmS128); 1552 byte simd = r.AllocateLocal(kWasmS128);
1550 BUILD(r, WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))), 1553 BUILD(r, WASM_SET_LOCAL(simd, WASM_SIMD_I8x16_SPLAT(WASM_GET_LOCAL(a))),
1551 WASM_SET_LOCAL( 1554 WASM_SET_LOCAL(
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 WASM_SIMD_I32x4_EXTRACT_LANE( 2340 WASM_SIMD_I32x4_EXTRACT_LANE(
2338 0, WASM_LOAD_MEM(MachineType::Simd128(), WASM_ZERO))); 2341 0, WASM_LOAD_MEM(MachineType::Simd128(), WASM_ZERO)));
2339 2342
2340 FOR_INT32_INPUTS(i) { 2343 FOR_INT32_INPUTS(i) {
2341 int32_t expected = *i; 2344 int32_t expected = *i;
2342 r.module().WriteMemory(&memory[0], expected); 2345 r.module().WriteMemory(&memory[0], expected);
2343 CHECK_EQ(expected, r.Call()); 2346 CHECK_EQ(expected, r.Call());
2344 } 2347 }
2345 } 2348 }
2346 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_X64 2349 #endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698