Commit 7c31d892 authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

[wasm-simd]: Move AIX sign patch into the utils header

After https://crrev.com/c/2773784, patch is also needed within
test-run-wasm-relaxed-simd.cc.

Change-Id: Id1efc905c52840eee7b382b90795574b889a7249
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2788408Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#73713}
parent b8664737
......@@ -86,13 +86,6 @@ using Shuffle = std::array<int8_t, kSimd128Size>;
void RunWasm_##name##_Impl(LowerSimd lower_simd, \
TestExecutionTier execution_tier)
// Generic expected value functions.
template <typename T, typename = typename std::enable_if<
std::is_floating_point<T>::value>::type>
T Negate(T a) {
return -a;
}
// For signed integral types, use base::AddWithWraparound.
template <typename T, typename = typename std::enable_if<
std::is_floating_point<T>::value>::type>
......@@ -253,14 +246,6 @@ int64_t LessEqual(double a, double b) { return a <= b ? -1 : 0; }
lane_index, WASM_LOCAL_GET(value))), \
WASM_RETURN1(WASM_ZERO))
#if V8_OS_AIX
template <typename T>
bool MightReverseSign(T float_op) {
return float_op == static_cast<T>(Negate) ||
float_op == static_cast<T>(std::abs);
}
#endif
WASM_SIMD_TEST(S128Globals) {
WasmRunner<int32_t> r(execution_tier, lower_simd);
// Set up a global to hold input and output vectors.
......
......@@ -16,6 +16,21 @@ namespace wasm {
using FloatUnOp = float (*)(float);
// Generic expected value functions.
template <typename T, typename = typename std::enable_if<
std::is_floating_point<T>::value>::type>
T Negate(T a) {
return -a;
}
#if V8_OS_AIX
template <typename T>
bool MightReverseSign(T float_op) {
return float_op == static_cast<T>(Negate) ||
float_op == static_cast<T>(std::abs);
}
#endif
// Test some values not included in the float inputs from value_helper. These
// tests are useful for opcodes that are synthesized during code gen, like Min
// and Max on ia32 and x64.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment