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

Unified Diff: test/cctest/wasm/test-run-wasm-simd.cc

Issue 2778203002: MIPS[64]: Support for some SIMD operations (4) (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« src/compiler/mips/code-generator-mips.cc ('K') | « src/mips64/assembler-mips64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e110b35a199fdf0b36b40b2c7bf0acfb2c1732d3..b3f8c2c53b1526055d0343984fc89eece504a69d 100644
--- a/test/cctest/wasm/test-run-wasm-simd.cc
+++ b/test/cctest/wasm/test-run-wasm-simd.cc
@@ -74,7 +74,8 @@ T Maximum(T a, T b) {
}
// For float operands, Min and Max must return NaN if either operand is NaN.
-#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \
+ V8_TARGET_ARCH_MIPS64
template <>
float Minimum(float a, float b) {
if (std::isnan(a) || std::isnan(b))
@@ -88,7 +89,8 @@ float Maximum(float a, float b) {
return std::numeric_limits<float>::quiet_NaN();
return a >= b ? a : b;
}
-#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS ||
+ // V8_TARGET_ARCH_MIPS64
template <typename T>
T UnsignedMinimum(T a, T b) {
@@ -472,7 +474,10 @@ WASM_EXEC_COMPILED_TEST(F32x4FromInt32x4) {
static_cast<float>(static_cast<uint32_t>(*i))));
}
}
+#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \
+ V8_TARGET_ARCH_MIPS64
void RunF32x4UnOpTest(WasmOpcode simd_op, FloatUnOp expected_op,
float error = 0.0f) {
FLAG_wasm_simd_prototype = true;
@@ -497,13 +502,14 @@ void RunF32x4UnOpTest(WasmOpcode simd_op, FloatUnOp expected_op,
WASM_EXEC_COMPILED_TEST(F32x4Abs) { RunF32x4UnOpTest(kExprF32x4Abs, std::abs); }
WASM_EXEC_COMPILED_TEST(F32x4Neg) { RunF32x4UnOpTest(kExprF32x4Neg, Negate); }
-#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS ||
+ // V8_TARGET_ARCH_MIPS64
#if SIMD_LOWERING_TARGET
WASM_EXEC_COMPILED_TEST(F32x4Sqrt) { RunF32x4UnOpTest(kExprF32x4Sqrt, Sqrt); }
#endif // SIMD_LOWERING_TARGET
-#if V8_TARGET_ARCH_ARM
+#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
static const float kApproxError = 0.01f;
WASM_EXEC_COMPILED_TEST(F32x4RecipApprox) {
@@ -513,9 +519,10 @@ WASM_EXEC_COMPILED_TEST(F32x4RecipApprox) {
WASM_EXEC_COMPILED_TEST(F32x4RecipSqrtApprox) {
RunF32x4UnOpTest(kExprF32x4RecipSqrtApprox, RecipSqrt, kApproxError);
}
-#endif // V8_TARGET_ARCH_ARM
+#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
-#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \
+ V8_TARGET_ARCH_MIPS64
void RunF32x4BinOpTest(WasmOpcode simd_op, FloatBinOp expected_op) {
FLAG_wasm_simd_prototype = true;
WasmRunner<int32_t, float, float, float> r(kExecuteCompiled);
@@ -550,13 +557,14 @@ WASM_EXEC_COMPILED_TEST(F32x4_Min) {
WASM_EXEC_COMPILED_TEST(F32x4_Max) {
RunF32x4BinOpTest(kExprF32x4Max, Maximum);
}
-#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS ||
+ // V8_TARGET_ARCH_MIPS64
#if SIMD_LOWERING_TARGET
WASM_EXEC_COMPILED_TEST(F32x4Div) { RunF32x4BinOpTest(kExprF32x4Div, Div); }
#endif // SIMD_LOWERING_TARGET
-#if V8_TARGET_ARCH_ARM
+#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
WASM_EXEC_COMPILED_TEST(F32x4RecipRefine) {
RunF32x4BinOpTest(kExprF32x4RecipRefine, RecipRefine);
}
@@ -564,9 +572,10 @@ WASM_EXEC_COMPILED_TEST(F32x4RecipRefine) {
WASM_EXEC_COMPILED_TEST(F32x4RecipSqrtRefine) {
RunF32x4BinOpTest(kExprF32x4RecipSqrtRefine, RecipSqrtRefine);
}
-#endif // V8_TARGET_ARCH_ARM
+#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
-#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \
+ V8_TARGET_ARCH_MIPS64
void RunF32x4CompareOpTest(WasmOpcode simd_op, FloatCompareOp expected_op) {
FLAG_wasm_simd_prototype = true;
WasmRunner<int32_t, float, float, int32_t> r(kExecuteCompiled);
@@ -613,7 +622,8 @@ WASM_EXEC_COMPILED_TEST(F32x4Lt) { RunF32x4CompareOpTest(kExprF32x4Lt, Less); }
WASM_EXEC_COMPILED_TEST(F32x4Le) {
RunF32x4CompareOpTest(kExprF32x4Le, LessEqual);
}
-#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS ||
+ // V8_TARGET_ARCH_MIPS64
WASM_EXEC_COMPILED_TEST(I32x4Splat) {
FLAG_wasm_simd_prototype = true;
@@ -849,7 +859,8 @@ WASM_EXEC_COMPILED_TEST(I8x16ReplaceLane) {
}
#endif // V8_TARGET_ARCH_ARM
-#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
+#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \
+ V8_TARGET_ARCH_MIPS64
// Determines if conversion from float to int will be valid.
bool CanRoundToZeroAndConvert(double val, bool unsigned_integer) {
const double max_uint = static_cast<double>(0xffffffffu);
@@ -914,7 +925,10 @@ WASM_EXEC_COMPILED_TEST(I32x4FromFloat32x4) {
CHECK_EQ(1, r.Call(*i, signed_value, unsigned_value));
}
}
+#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS ||
+ // V8_TARGET_ARCH_MIPS64
+#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
void RunI32x4UnOpTest(WasmOpcode simd_op, Int32UnOp expected_op) {
FLAG_wasm_simd_prototype = true;
WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled);
« src/compiler/mips/code-generator-mips.cc ('K') | « src/mips64/assembler-mips64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698