void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) {
LOperand* input = instr->value();
LOperand* output = instr->result();
- LOperand* temp = instr->temp();
- __ LoadUint32(ToDoubleRegister(output),
- ToRegister(input),
- ToDoubleRegister(temp));
+ __ LoadUint32(ToDoubleRegister(output), ToRegister(input));
}
LNumberTagI* instr)
: LDeferredCode(codegen), instr_(instr) { }
virtual void Generate() V8_OVERRIDE {
- codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp(),
- NULL, SIGNED_INT32);
+ codegen()->DoDeferredNumberTagIU(
+ instr_, instr_->value(), instr_->temp(), SIGNED_INT32);
}
virtual LInstruction* instr() V8_OVERRIDE { return instr_; }
private:
DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr)
: LDeferredCode(codegen), instr_(instr) { }
virtual void Generate() V8_OVERRIDE {
- codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(),
- instr_->temp2(), UNSIGNED_INT32);
+ codegen()->DoDeferredNumberTagIU(
+ instr_, instr_->value(), instr_->temp(), UNSIGNED_INT32);
}
virtual LInstruction* instr() V8_OVERRIDE { return instr_; }
private:
void LCodeGen::DoDeferredNumberTagIU(LInstruction* instr,
LOperand* value,
- LOperand* temp1,
- LOperand* temp2,
+ LOperand* temp,
IntegerSignedness signedness) {
Label done, slow;
Register reg = ToRegister(value);
- Register tmp = ToRegister(temp1);
+ Register tmp = ToRegister(temp);
XMMRegister xmm_scratch = double_scratch0();
if (signedness == SIGNED_INT32) {
__ xor_(reg, 0x80000000);
__ Cvtsi2sd(xmm_scratch, Operand(reg));
} else {
- __ LoadUint32(xmm_scratch, reg, ToDoubleRegister(temp2));
+ __ LoadUint32(xmm_scratch, reg);
}
if (FLAG_inline_new) {
enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 };
void DoDeferredNumberTagIU(LInstruction* instr,
LOperand* value,
- LOperand* temp1,
- LOperand* temp2,
+ LOperand* temp,
IntegerSignedness signedness);
void DoDeferredTaggedToI(LTaggedToI* instr, Label* done);
} else if (from.IsInteger32()) {
info()->MarkAsDeferredCalling();
if (to.IsTagged()) {
+ LOperand* value = UseRegister(val);
if (!instr->CheckFlag(HValue::kCanOverflow)) {
- LOperand* value = UseRegister(val);
return DefineSameAsFirst(new(zone()) LSmiTag(value));
} else if (val->CheckFlag(HInstruction::kUint32)) {
- LOperand* value = UseRegister(val);
- LOperand* temp1 = TempRegister();
- LOperand* temp2 = FixedTemp(xmm1);
- LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2);
+ LOperand* temp = TempRegister();
+ LNumberTagU* result = new(zone()) LNumberTagU(value, temp);
return AssignPointerMap(DefineSameAsFirst(result));
} else {
- LOperand* value = UseRegister(val);
LOperand* temp = TempRegister();
LNumberTagI* result = new(zone()) LNumberTagI(value, temp);
return AssignPointerMap(DefineSameAsFirst(result));
} else {
ASSERT(to.IsDouble());
if (val->CheckFlag(HInstruction::kUint32)) {
- LOperand* temp = FixedTemp(xmm1);
- return DefineAsRegister(
- new(zone()) LUint32ToDouble(UseRegister(val), temp));
+ return DefineAsRegister(new(zone()) LUint32ToDouble(UseRegister(val)));
} else {
return DefineAsRegister(new(zone()) LInteger32ToDouble(Use(val)));
}
};
-class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LUint32ToDouble(LOperand* value, LOperand* temp) {
+ explicit LUint32ToDouble(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
};
};
-class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 2> {
+class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 1> {
public:
- LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ LNumberTagU(LOperand* value, LOperand* temp) {
inputs_[0] = value;
- temps_[0] = temp1;
- temps_[1] = temp2;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp1() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
+ LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
};
void MacroAssembler::LoadUint32(XMMRegister dst,
- Register src,
- XMMRegister scratch) {
+ Register src) {
Label done;
cmp(src, Immediate(0));
ExternalReference uint32_bias =
ExternalReference::address_of_uint32_bias();
- movsd(scratch, Operand::StaticVariable(uint32_bias));
Cvtsi2sd(dst, src);
j(not_sign, &done, Label::kNear);
- addsd(dst, scratch);
+ addsd(dst, Operand::StaticVariable(uint32_bias));
bind(&done);
}
j(not_carry, is_smi);
}
- void LoadUint32(XMMRegister dst, Register src, XMMRegister scratch);
+ void LoadUint32(XMMRegister dst, Register src);
// Jump the register contains a smi.
inline void JumpIfSmi(Register value,
void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) {
LOperand* input = instr->value();
LOperand* output = instr->result();
- LOperand* temp = instr->temp();
- __ LoadUint32(ToDoubleRegister(output),
- ToRegister(input),
- ToDoubleRegister(temp));
+ __ LoadUint32(ToDoubleRegister(output), ToRegister(input));
}
// 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(temp_xmm, reg, xmm_scratch);
+ __ LoadUint32(temp_xmm, reg);
if (FLAG_inline_new) {
__ AllocateHeapNumber(reg, tmp, &slow);
} else {
ASSERT(to.IsDouble());
if (val->CheckFlag(HInstruction::kUint32)) {
- LOperand* temp = FixedTemp(xmm1);
- return DefineAsRegister(
- new(zone()) LUint32ToDouble(UseRegister(val), temp));
+ return DefineAsRegister(new(zone()) LUint32ToDouble(UseRegister(val)));
} else {
LOperand* value = Use(val);
return DefineAsRegister(new(zone()) LInteger32ToDouble(value));
};
-class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LUint32ToDouble(LOperand* value, LOperand* temp) {
+ explicit LUint32ToDouble(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
};
void MacroAssembler::LoadUint32(XMMRegister dst,
- Register src,
- XMMRegister scratch) {
+ Register src) {
if (FLAG_debug_code) {
cmpq(src, Immediate(0xffffffff));
Assert(below_equal, kInputGPRIsExpectedToHaveUpper32Cleared);
MinusZeroMode minus_zero_mode, Label* lost_precision,
Label::Distance dst = Label::kFar);
- void LoadUint32(XMMRegister dst, Register src, XMMRegister scratch);
+ void LoadUint32(XMMRegister dst, Register src);
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);