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

[wasm-simd][arm] Improve f64x2 lt and le codegen

From 10 to 8 instructions (each). We do this by using mi (instead of lt)
and ls (instead of le), which check for strictly less than and greater
than or unordered. That way we don't have to have an extra mov for NaN.

Change-Id: I18ff876ac12b7097d73d6cbbb64de6c2a1148e43
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2208934Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67947}
parent b409a441
......@@ -1960,40 +1960,32 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArmF64x2Lt: {
UseScratchRegisterScope temps(tasm());
Register scratch = temps.Acquire();
__ mov(scratch, Operand(0));
__ VFPCompareAndSetFlags(i.InputSimd128Register(0).low(),
i.InputSimd128Register(1).low());
__ mov(scratch, Operand(-1), LeaveCC, lt);
// Check for NaN.
__ mov(scratch, Operand(0), LeaveCC, vs);
__ mov(scratch, Operand(0), LeaveCC, cs);
__ mov(scratch, Operand(-1), LeaveCC, mi);
__ vmov(i.OutputSimd128Register().low(), scratch, scratch);
__ mov(scratch, Operand(0));
__ VFPCompareAndSetFlags(i.InputSimd128Register(0).high(),
i.InputSimd128Register(1).high());
__ mov(scratch, Operand(-1), LeaveCC, lt);
// Check for NaN.
__ mov(scratch, Operand(0), LeaveCC, vs);
__ mov(scratch, Operand(0), LeaveCC, cs);
__ mov(scratch, Operand(-1), LeaveCC, mi);
__ vmov(i.OutputSimd128Register().high(), scratch, scratch);
break;
}
case kArmF64x2Le: {
UseScratchRegisterScope temps(tasm());
Register scratch = temps.Acquire();
__ mov(scratch, Operand(0));
__ VFPCompareAndSetFlags(i.InputSimd128Register(0).low(),
i.InputSimd128Register(1).low());
__ mov(scratch, Operand(-1), LeaveCC, le);
// Check for NaN.
__ mov(scratch, Operand(0), LeaveCC, vs);
__ mov(scratch, Operand(0), LeaveCC, hi);
__ mov(scratch, Operand(-1), LeaveCC, ls);
__ vmov(i.OutputSimd128Register().low(), scratch, scratch);
__ mov(scratch, Operand(0));
__ VFPCompareAndSetFlags(i.InputSimd128Register(0).high(),
i.InputSimd128Register(1).high());
__ mov(scratch, Operand(-1), LeaveCC, le);
// Check for NaN.
__ mov(scratch, Operand(0), LeaveCC, vs);
__ mov(scratch, Operand(0), LeaveCC, hi);
__ mov(scratch, Operand(-1), LeaveCC, ls);
__ vmov(i.OutputSimd128Register().high(), scratch, scratch);
break;
}
......
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