Commit afbbfcbe authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd] Implement f64x2 abs neg for arm

Bug: v8:9813
Change-Id: Iff69b35ec7ea96f0e63610a93c01557429792c59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1866883Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64389}
parent f3b29768
......@@ -1780,6 +1780,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputDoubleRegister(2), i.InputInt8(1));
break;
}
case kArmF64x2Abs: {
__ vabs(i.OutputSimd128Register().low(), i.InputSimd128Register(0).low());
__ vabs(i.OutputSimd128Register().high(),
i.InputSimd128Register(0).high());
break;
}
case kArmF64x2Neg: {
__ vneg(i.OutputSimd128Register().low(), i.InputSimd128Register(0).low());
__ vneg(i.OutputSimd128Register().high(),
i.InputSimd128Register(0).high());
break;
}
case kArmF32x4Splat: {
int src_code = i.InputFloatRegister(0).code();
__ vdup(Neon32, i.OutputSimd128Register(),
......
......@@ -131,6 +131,8 @@ namespace compiler {
V(ArmF64x2Splat) \
V(ArmF64x2ExtractLane) \
V(ArmF64x2ReplaceLane) \
V(ArmF64x2Abs) \
V(ArmF64x2Neg) \
V(ArmF32x4Splat) \
V(ArmF32x4ExtractLane) \
V(ArmF32x4ReplaceLane) \
......
......@@ -111,6 +111,8 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kArmF64x2Splat:
case kArmF64x2ExtractLane:
case kArmF64x2ReplaceLane:
case kArmF64x2Abs:
case kArmF64x2Neg:
case kArmF32x4Splat:
case kArmF32x4ExtractLane:
case kArmF32x4ReplaceLane:
......
......@@ -2382,6 +2382,8 @@ void InstructionSelector::VisitWord32AtomicPairCompareExchange(Node* node) {
V(I8x16)
#define SIMD_UNOP_LIST(V) \
V(F64x2Abs, kArmF64x2Abs) \
V(F64x2Neg, kArmF64x2Neg) \
V(F32x4SConvertI32x4, kArmF32x4SConvertI32x4) \
V(F32x4UConvertI32x4, kArmF32x4UConvertI32x4) \
V(F32x4Abs, kArmF32x4Abs) \
......
......@@ -2648,8 +2648,6 @@ void InstructionSelector::VisitF64x2UConvertI64x2(Node* node) {
}
#if !V8_TARGET_ARCH_ARM64
#if !V8_TARGET_ARCH_IA32
void InstructionSelector::VisitF64x2Abs(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitF64x2Neg(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitF64x2Sqrt(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitF64x2Add(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitF64x2Sub(Node* node) { UNIMPLEMENTED(); }
......
......@@ -1175,7 +1175,6 @@ WASM_SIMD_TEST_NO_LOWERING(I64x2ExtractWithF64x2) {
}
#endif // V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_IA32
bool IsExtreme(double x) {
double abs_x = std::fabs(x);
const double kSmallFloatThreshold = 1.0e-298;
......@@ -1298,6 +1297,7 @@ WASM_SIMD_TEST_NO_LOWERING(F64x2Neg) {
RunF64x2UnOpTest(execution_tier, lower_simd, kExprF64x2Neg, Negate);
}
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_IA32
WASM_SIMD_TEST_NO_LOWERING(F64x2Sqrt) {
RunF64x2UnOpTest(execution_tier, lower_simd, kExprF64x2Sqrt, Sqrt);
}
......
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