Avoid using double temp register explicitly in lithium codegen
BUG= R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/23531084 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16989 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
b81c581b38
commit
dbdcf5b671
@ -5741,6 +5741,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
|
||||
|
||||
ASSERT(instr->unclamped()->Equals(instr->result()));
|
||||
Register input_reg = ToRegister(instr->unclamped());
|
||||
XMMRegister temp_xmm_reg = ToDoubleRegister(instr->temp_xmm());
|
||||
XMMRegister xmm_scratch = double_scratch0();
|
||||
Label is_smi, done, heap_number;
|
||||
|
||||
@ -5761,7 +5762,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
|
||||
// Heap number
|
||||
__ bind(&heap_number);
|
||||
__ movdbl(xmm_scratch, FieldOperand(input_reg, HeapNumber::kValueOffset));
|
||||
__ ClampDoubleToUint8(xmm_scratch, xmm1, input_reg);
|
||||
__ ClampDoubleToUint8(xmm_scratch, temp_xmm_reg, input_reg);
|
||||
__ jmp(&done, Label::kNear);
|
||||
|
||||
// smi
|
||||
|
@ -2508,12 +2508,13 @@ class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
||||
|
||||
class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> {
|
||||
public:
|
||||
LClampTToUint8(LOperand* value, LOperand* temp) {
|
||||
LClampTToUint8(LOperand* value, LOperand* temp_xmm) {
|
||||
inputs_[0] = value;
|
||||
temps_[0] = temp;
|
||||
temps_[0] = temp_xmm;
|
||||
}
|
||||
|
||||
LOperand* unclamped() { return inputs_[0]; }
|
||||
LOperand* temp_xmm() { return temps_[0]; }
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
|
||||
};
|
||||
|
@ -4523,16 +4523,17 @@ void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) {
|
||||
Label slow;
|
||||
Register reg = ToRegister(instr->value());
|
||||
Register tmp = reg.is(rax) ? rcx : rax;
|
||||
XMMRegister temp_xmm = ToDoubleRegister(instr->temp());
|
||||
|
||||
// Preserve the value of all registers.
|
||||
PushSafepointRegistersScope scope(this);
|
||||
|
||||
Label done;
|
||||
// Load value into xmm1 which will be preserved across potential call to
|
||||
// Load value into temp_xmm which will be preserved across potential call to
|
||||
// runtime (MacroAssembler::EnterExitFrameEpilogue preserves only allocatable
|
||||
// XMM registers on x64).
|
||||
XMMRegister xmm_scratch = double_scratch0();
|
||||
__ LoadUint32(xmm1, reg, xmm_scratch);
|
||||
__ LoadUint32(temp_xmm, reg, xmm_scratch);
|
||||
|
||||
if (FLAG_inline_new) {
|
||||
__ AllocateHeapNumber(reg, tmp, &slow);
|
||||
@ -4550,10 +4551,10 @@ void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) {
|
||||
CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
|
||||
if (!reg.is(rax)) __ movq(reg, rax);
|
||||
|
||||
// Done. Put the value in xmm1 into the value of the allocated heap
|
||||
// Done. Put the value in temp_xmm into the value of the allocated heap
|
||||
// number.
|
||||
__ bind(&done);
|
||||
__ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm1);
|
||||
__ movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm);
|
||||
__ StoreToSafepointRegisterSlot(reg, reg);
|
||||
}
|
||||
|
||||
|
@ -3738,7 +3738,7 @@ void MacroAssembler::EnterExitFrameEpilogue(int arg_stack_space,
|
||||
#endif
|
||||
// Optionally save all XMM registers.
|
||||
if (save_doubles) {
|
||||
int space = XMMRegister::kMaxNumRegisters * kDoubleSize +
|
||||
int space = XMMRegister::kMaxNumAllocatableRegisters * kDoubleSize +
|
||||
arg_stack_space * kPointerSize;
|
||||
subq(rsp, Immediate(space));
|
||||
int offset = -2 * kPointerSize;
|
||||
|
Loading…
Reference in New Issue
Block a user