s390: Optimize LoadDoubleLiteral
R=joransiu@ca.ibm.com, bjaideep@ca.ibm.com BUG= Review-Url: https://codereview.chromium.org/2611773003 Cr-Commit-Position: refs/heads/master@{#42050}
This commit is contained in:
parent
e87e82b8e7
commit
410606a09d
@ -4334,9 +4334,16 @@ void MacroAssembler::LoadDoubleLiteral(DoubleRegister result, uint64_t value,
|
|||||||
uint32_t lo_32 = static_cast<uint32_t>(value);
|
uint32_t lo_32 = static_cast<uint32_t>(value);
|
||||||
|
|
||||||
// Load the 64-bit value into a GPR, then transfer it to FPR via LDGR
|
// Load the 64-bit value into a GPR, then transfer it to FPR via LDGR
|
||||||
iihf(scratch, Operand(hi_32));
|
if (value == 0) {
|
||||||
iilf(scratch, Operand(lo_32));
|
lzdr(result);
|
||||||
ldgr(result, scratch);
|
} else if (lo_32 == 0) {
|
||||||
|
llihf(scratch, Operand(hi_32));
|
||||||
|
ldgr(result, scratch);
|
||||||
|
} else {
|
||||||
|
iihf(scratch, Operand(hi_32));
|
||||||
|
iilf(scratch, Operand(lo_32));
|
||||||
|
ldgr(result, scratch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAssembler::LoadDoubleLiteral(DoubleRegister result, double value,
|
void MacroAssembler::LoadDoubleLiteral(DoubleRegister result, double value,
|
||||||
@ -4347,13 +4354,9 @@ void MacroAssembler::LoadDoubleLiteral(DoubleRegister result, double value,
|
|||||||
|
|
||||||
void MacroAssembler::LoadFloat32Literal(DoubleRegister result, float value,
|
void MacroAssembler::LoadFloat32Literal(DoubleRegister result, float value,
|
||||||
Register scratch) {
|
Register scratch) {
|
||||||
uint32_t hi_32 = bit_cast<uint32_t>(value);
|
uint64_t int_val = static_cast<uint64_t>(bit_cast<uint32_t, float>(value))
|
||||||
uint32_t lo_32 = 0;
|
<< 32;
|
||||||
|
LoadDoubleLiteral(result, int_val, scratch);
|
||||||
// Load the 64-bit value into a GPR, then transfer it to FPR via LDGR
|
|
||||||
iihf(scratch, Operand(hi_32));
|
|
||||||
iilf(scratch, Operand(lo_32));
|
|
||||||
ldgr(result, scratch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAssembler::CmpSmiLiteral(Register src1, Smi* smi, Register scratch) {
|
void MacroAssembler::CmpSmiLiteral(Register src1, Smi* smi, Register scratch) {
|
||||||
|
Loading…
Reference in New Issue
Block a user