Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: src/s390/macro-assembler-s390.cc

Issue 2611773003: s390: Optimize LoadDoubleLiteral (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/macro-assembler-s390.cc
diff --git a/src/s390/macro-assembler-s390.cc b/src/s390/macro-assembler-s390.cc
index a38fdc54adfaf2b05bc796d869a412680f1ca10a..de68c352734828d7e24557bded9ab39f51e38736 100644
--- a/src/s390/macro-assembler-s390.cc
+++ b/src/s390/macro-assembler-s390.cc
@@ -4334,9 +4334,16 @@ void MacroAssembler::LoadDoubleLiteral(DoubleRegister result, uint64_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
- iihf(scratch, Operand(hi_32));
- iilf(scratch, Operand(lo_32));
- ldgr(result, scratch);
+ if (value == 0) {
+ lzdr(result);
+ } 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,
@@ -4347,13 +4354,9 @@ void MacroAssembler::LoadDoubleLiteral(DoubleRegister result, double value,
void MacroAssembler::LoadFloat32Literal(DoubleRegister result, float value,
Register scratch) {
- uint32_t hi_32 = bit_cast<uint32_t>(value);
- uint32_t lo_32 = 0;
-
- // 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);
+ uint64_t int_val = static_cast<uint64_t>(bit_cast<uint32_t, float>(value))
+ << 32;
+ LoadDoubleLiteral(result, int_val, scratch);
}
void MacroAssembler::CmpSmiLiteral(Register src1, Smi* smi, Register scratch) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698