Commit 6ae4a89e authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Relax register constraints for LMathSqrt.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/299423005

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent eabd5a19
......@@ -2063,6 +2063,15 @@ void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
}
void Assembler::sqrtsd(XMMRegister dst, const Operand& src) {
EnsureSpace ensure_space(this);
EMIT(0xF2);
EMIT(0x0F);
EMIT(0x51);
emit_sse_operand(dst, src);
}
void Assembler::andpd(XMMRegister dst, XMMRegister src) {
EnsureSpace ensure_space(this);
EMIT(0x66);
......
......@@ -936,6 +936,7 @@ class Assembler : public AssemblerBase {
void divsd(XMMRegister dst, XMMRegister src);
void xorpd(XMMRegister dst, XMMRegister src);
void sqrtsd(XMMRegister dst, XMMRegister src);
void sqrtsd(XMMRegister dst, const Operand& src);
void andpd(XMMRegister dst, XMMRegister src);
void orpd(XMMRegister dst, XMMRegister src);
......
......@@ -3708,9 +3708,9 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
void LCodeGen::DoMathSqrt(LMathSqrt* instr) {
XMMRegister input_reg = ToDoubleRegister(instr->value());
ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
__ sqrtsd(input_reg, input_reg);
Operand input = ToOperand(instr->value());
XMMRegister output = ToDoubleRegister(instr->result());
__ sqrtsd(output, input);
}
......
......@@ -1219,9 +1219,8 @@ LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) {
LOperand* input = UseRegisterAtStart(instr->value());
LMathSqrt* result = new(zone()) LMathSqrt(input);
return DefineSameAsFirst(result);
LOperand* input = UseAtStart(instr->value());
return DefineAsRegister(new(zone()) LMathSqrt(input));
}
......
......@@ -2794,6 +2794,16 @@ void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
}
void Assembler::sqrtsd(XMMRegister dst, const Operand& src) {
EnsureSpace ensure_space(this);
emit(0xF2);
emit_optional_rex_32(dst, src);
emit(0x0F);
emit(0x51);
emit_sse_operand(dst, src);
}
void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
EnsureSpace ensure_space(this);
emit(0x66);
......
......@@ -1069,6 +1069,7 @@ class Assembler : public AssemblerBase {
void orpd(XMMRegister dst, XMMRegister src);
void xorpd(XMMRegister dst, XMMRegister src);
void sqrtsd(XMMRegister dst, XMMRegister src);
void sqrtsd(XMMRegister dst, const Operand& src);
void ucomisd(XMMRegister dst, XMMRegister src);
void ucomisd(XMMRegister dst, const Operand& src);
......
......@@ -3725,9 +3725,14 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
void LCodeGen::DoMathSqrt(LMathSqrt* instr) {
XMMRegister input_reg = ToDoubleRegister(instr->value());
ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
__ sqrtsd(input_reg, input_reg);
XMMRegister output = ToDoubleRegister(instr->result());
if (instr->value()->IsDoubleRegister()) {
XMMRegister input = ToDoubleRegister(instr->value());
__ sqrtsd(output, input);
} else {
Operand input = ToOperand(instr->value());
__ sqrtsd(output, input);
}
}
......
......@@ -1182,9 +1182,8 @@ LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) {
LOperand* input = UseRegisterAtStart(instr->value());
LMathSqrt* result = new(zone()) LMathSqrt(input);
return DefineSameAsFirst(result);
LOperand* input = UseAtStart(instr->value());
return DefineAsRegister(new(zone()) LMathSqrt(input));
}
......
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