Commit 7dfd8c6c authored by Martyn Capewell's avatar Martyn Capewell Committed by Commit Bot

[arm64] Use Neon for float construct/extract

Use Neon for floating point number insertion and extraction in
TurboFan code generator.

Bug: 
Change-Id: Ic955ff0bc5ddaadfe560ea9cfdd82f6b40815be3
Reviewed-on: https://chromium-review.googlesource.com/806172Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/master@{#49859}
parent 2d347a1a
......@@ -1652,28 +1652,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ Fmov(i.OutputRegister32(), i.InputFloat32Register(0));
break;
case kArm64Float64ExtractHighWord32:
// TODO(arm64): This should use MOV (to general) when NEON is supported.
__ Fmov(i.OutputRegister(), i.InputFloat64Register(0));
__ Lsr(i.OutputRegister(), i.OutputRegister(), 32);
__ Umov(i.OutputRegister32(), i.InputFloat64Register(0).V2S(), 1);
break;
case kArm64Float64InsertLowWord32: {
// TODO(arm64): This should use MOV (from general) when NEON is supported.
UseScratchRegisterScope scope(tasm());
Register tmp = scope.AcquireX();
__ Fmov(tmp, i.InputFloat64Register(0));
__ Bfi(tmp, i.InputRegister(1), 0, 32);
__ Fmov(i.OutputFloat64Register(), tmp);
case kArm64Float64InsertLowWord32:
DCHECK(i.OutputFloat64Register().Is(i.InputFloat64Register(0)));
__ Ins(i.OutputFloat64Register().V2S(), 0, i.InputRegister32(1));
break;
}
case kArm64Float64InsertHighWord32: {
// TODO(arm64): This should use MOV (from general) when NEON is supported.
UseScratchRegisterScope scope(tasm());
Register tmp = scope.AcquireX();
__ Fmov(tmp.W(), i.InputFloat32Register(0));
__ Bfi(tmp, i.InputRegister(1), 32, 32);
__ Fmov(i.OutputFloat64Register(), tmp);
case kArm64Float64InsertHighWord32:
DCHECK(i.OutputFloat64Register().Is(i.InputFloat64Register(0)));
__ Ins(i.OutputFloat64Register().V2S(), 1, i.InputRegister32(1));
break;
}
case kArm64Float64MoveU64:
__ Fmov(i.OutputFloat64Register(), i.InputRegister(0));
break;
......
......@@ -2671,7 +2671,7 @@ void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(right));
return;
}
Emit(kArm64Float64InsertLowWord32, g.DefineAsRegister(node),
Emit(kArm64Float64InsertLowWord32, g.DefineSameAsFirst(node),
g.UseRegister(left), g.UseRegister(right));
}
......@@ -2688,7 +2688,7 @@ void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(left));
return;
}
Emit(kArm64Float64InsertHighWord32, g.DefineAsRegister(node),
Emit(kArm64Float64InsertHighWord32, g.DefineSameAsFirst(node),
g.UseRegister(left), g.UseRegister(right));
}
......
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