[assembler] Add scratch register to cvtui2sd SSE instruction
Change-Id: I861babb77f224626f6cdb88a7be08db75f5cf327 Bug: v8:6666 Reviewed-on: https://chromium-review.googlesource.com/c/1283089 Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#56698}
This commit is contained in:
parent
8060b60fae
commit
f64edae08f
@ -1476,7 +1476,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
__ cvtsi2sd(i.OutputDoubleRegister(), i.InputOperand(0));
|
||||
break;
|
||||
case kSSEUint32ToFloat64:
|
||||
__ Cvtui2sd(i.OutputDoubleRegister(), i.InputOperand(0));
|
||||
__ Cvtui2sd(i.OutputDoubleRegister(), i.InputOperand(0),
|
||||
i.TempRegister(0));
|
||||
break;
|
||||
case kSSEFloat64ExtractLowWord32:
|
||||
if (instr->InputAt(0)->IsFPStackSlot()) {
|
||||
|
@ -185,7 +185,9 @@ namespace {
|
||||
|
||||
void VisitRO(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
|
||||
IA32OperandGenerator g(selector);
|
||||
selector->Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
|
||||
InstructionOperand temps[] = {g.TempRegister()};
|
||||
selector->Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0)),
|
||||
arraysize(temps), temps);
|
||||
}
|
||||
|
||||
|
||||
|
@ -590,13 +590,13 @@ void TurboAssembler::Cvttss2ui(Register dst, Operand src, XMMRegister tmp) {
|
||||
bind(&done);
|
||||
}
|
||||
|
||||
void TurboAssembler::Cvtui2sd(XMMRegister dst, Operand src) {
|
||||
void TurboAssembler::Cvtui2sd(XMMRegister dst, Operand src, Register scratch) {
|
||||
Label done;
|
||||
cmp(src, Immediate(0));
|
||||
ExternalReference uint32_bias = ExternalReference::address_of_uint32_bias();
|
||||
Cvtsi2sd(dst, src);
|
||||
j(not_sign, &done, Label::kNear);
|
||||
addsd(dst, StaticVariable(uint32_bias));
|
||||
addsd(dst, ExternalReferenceAsOperand(uint32_bias, scratch));
|
||||
bind(&done);
|
||||
}
|
||||
|
||||
|
@ -423,8 +423,10 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
|
||||
Cvttss2ui(dst, Operand(src), tmp);
|
||||
}
|
||||
void Cvttss2ui(Register dst, Operand src, XMMRegister tmp);
|
||||
void Cvtui2sd(XMMRegister dst, Register src) { Cvtui2sd(dst, Operand(src)); }
|
||||
void Cvtui2sd(XMMRegister dst, Operand src);
|
||||
void Cvtui2sd(XMMRegister dst, Register src, Register scratch) {
|
||||
Cvtui2sd(dst, Operand(src), scratch);
|
||||
}
|
||||
void Cvtui2sd(XMMRegister dst, Operand src, Register scratch);
|
||||
void Cvttsd2ui(Register dst, XMMRegister src, XMMRegister tmp) {
|
||||
Cvttsd2ui(dst, Operand(src), tmp);
|
||||
}
|
||||
|
@ -1242,7 +1242,8 @@ inline void ConvertFloatToIntAndBack(LiftoffAssembler* assm, Register dst,
|
||||
assm->Cvtsi2sd(converted_back, dst);
|
||||
} else { // f64 -> u32
|
||||
assm->Cvttsd2ui(dst, src, liftoff::kScratchDoubleReg);
|
||||
assm->Cvtui2sd(converted_back, dst);
|
||||
assm->Cvtui2sd(converted_back, dst,
|
||||
assm->GetUnusedRegister(kGpReg, pinned).gp());
|
||||
}
|
||||
} else { // f32
|
||||
if (std::is_signed<dst_type>::value) { // f32 -> i32
|
||||
@ -1349,9 +1350,12 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode,
|
||||
case kExprF64SConvertI32:
|
||||
Cvtsi2sd(dst.fp(), src.gp());
|
||||
return true;
|
||||
case kExprF64UConvertI32:
|
||||
Cvtui2sd(dst.fp(), src.gp());
|
||||
case kExprF64UConvertI32: {
|
||||
LiftoffRegList pinned = LiftoffRegList::ForRegs(dst, src);
|
||||
Register scratch = GetUnusedRegister(kGpReg, pinned).gp();
|
||||
Cvtui2sd(dst.fp(), src.gp(), scratch);
|
||||
return true;
|
||||
}
|
||||
case kExprF64ConvertF32:
|
||||
cvtss2sd(dst.fp(), src.fp());
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user