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 "src/wasm/wasm-macro-gen.h" | 6 #include "src/wasm/wasm-macro-gen.h" |
7 #include "test/cctest/cctest.h" | 7 #include "test/cctest/cctest.h" |
8 #include "test/cctest/compiler/value-helper.h" | 8 #include "test/cctest/compiler/value-helper.h" |
9 #include "test/cctest/wasm/wasm-run-utils.h" | 9 #include "test/cctest/wasm/wasm-run-utils.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 typedef int32_t (*Int32ShiftOp)(int32_t, int); | 24 typedef int32_t (*Int32ShiftOp)(int32_t, int); |
25 typedef int16_t (*Int16UnOp)(int16_t); | 25 typedef int16_t (*Int16UnOp)(int16_t); |
26 typedef int16_t (*Int16BinOp)(int16_t, int16_t); | 26 typedef int16_t (*Int16BinOp)(int16_t, int16_t); |
27 typedef int (*Int16CompareOp)(int16_t, int16_t); | 27 typedef int (*Int16CompareOp)(int16_t, int16_t); |
28 typedef int16_t (*Int16ShiftOp)(int16_t, int); | 28 typedef int16_t (*Int16ShiftOp)(int16_t, int); |
29 typedef int8_t (*Int8UnOp)(int8_t); | 29 typedef int8_t (*Int8UnOp)(int8_t); |
30 typedef int8_t (*Int8BinOp)(int8_t, int8_t); | 30 typedef int8_t (*Int8BinOp)(int8_t, int8_t); |
31 typedef int (*Int8CompareOp)(int8_t, int8_t); | 31 typedef int (*Int8CompareOp)(int8_t, int8_t); |
32 typedef int8_t (*Int8ShiftOp)(int8_t, int); | 32 typedef int8_t (*Int8ShiftOp)(int8_t, int); |
33 | 33 |
34 #if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_X64 | 34 #if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 |
35 #define SIMD_LOWERING_TARGET 1 | 35 #define SIMD_LOWERING_TARGET 1 |
36 #else | 36 #else |
37 #define SIMD_LOWERING_TARGET 0 | 37 #define SIMD_LOWERING_TARGET 0 |
38 #endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_X64 | 38 #endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 |
39 | 39 |
40 // Generic expected value functions. | 40 // Generic expected value functions. |
41 template <typename T> | 41 template <typename T> |
42 T Negate(T a) { | 42 T Negate(T a) { |
43 return -a; | 43 return -a; |
44 } | 44 } |
45 | 45 |
46 template <typename T> | 46 template <typename T> |
47 T Add(T a, T b) { | 47 T Add(T a, T b) { |
48 return a + b; | 48 return a + b; |
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1828 WASM_SET_GLOBAL(0, WASM_SIMD_F32x4_REPLACE_LANE(3, WASM_GET_GLOBAL(0), | 1828 WASM_SET_GLOBAL(0, WASM_SIMD_F32x4_REPLACE_LANE(3, WASM_GET_GLOBAL(0), |
1829 WASM_F32(65.0))), | 1829 WASM_F32(65.0))), |
1830 WASM_I32V(1)); | 1830 WASM_I32V(1)); |
1831 FOR_INT32_INPUTS(i) { CHECK_EQ(1, r.Call(0)); } | 1831 FOR_INT32_INPUTS(i) { CHECK_EQ(1, r.Call(0)); } |
1832 CHECK_EQ(*global, 13.5); | 1832 CHECK_EQ(*global, 13.5); |
1833 CHECK_EQ(*(global + 1), 45.5); | 1833 CHECK_EQ(*(global + 1), 45.5); |
1834 CHECK_EQ(*(global + 2), 32.25); | 1834 CHECK_EQ(*(global + 2), 32.25); |
1835 CHECK_EQ(*(global + 3), 65.0); | 1835 CHECK_EQ(*(global + 3), 65.0); |
1836 } | 1836 } |
1837 #endif // SIMD_LOWERING_TARGET | 1837 #endif // SIMD_LOWERING_TARGET |
OLD | NEW |