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

Unified Diff: src/a64/macro-assembler-a64-inl.h

Issue 194753002: A64: Fix Fmov with signalling NaN literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « src/a64/macro-assembler-a64.h ('k') | test/cctest/test-assembler-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/macro-assembler-a64-inl.h
diff --git a/src/a64/macro-assembler-a64-inl.h b/src/a64/macro-assembler-a64-inl.h
index 09efcc38b7ded2eaab72da37b8f4de9d5f136e4c..89f4be74d20e7db89d9de4ce4a3c0e78d75b7bbf 100644
--- a/src/a64/macro-assembler-a64-inl.h
+++ b/src/a64/macro-assembler-a64-inl.h
@@ -737,26 +737,44 @@ void MacroAssembler::Fmov(FPRegister fd, Register rn) {
void MacroAssembler::Fmov(FPRegister fd, double imm) {
ASSERT(allow_macro_instructions_);
- if ((fd.Is64Bits() && IsImmFP64(imm)) ||
- (fd.Is32Bits() && IsImmFP32(imm)) ||
- ((imm == 0.0) && (copysign(1.0, imm) == 1.0))) {
- // These cases can be handled by the Assembler.
+ if (fd.Is32Bits()) {
+ Fmov(fd, static_cast<float>(imm));
+ return;
+ }
+
+ ASSERT(fd.Is64Bits());
+ if (IsImmFP64(imm)) {
fmov(fd, imm);
+ } else if ((imm == 0.0) && (copysign(1.0, imm) == 1.0)) {
+ fmov(fd, xzr);
} else {
UseScratchRegisterScope temps(this);
- // TODO(all): The Assembler would try to relocate the immediate with
- // Assembler::ldr(const FPRegister& ft, double imm) but it is not
- // implemented yet.
- if (fd.SizeInBits() == kDRegSize) {
- Register tmp = temps.AcquireX();
- Mov(tmp, double_to_rawbits(imm));
- Fmov(fd, tmp);
- } else {
- ASSERT(fd.SizeInBits() == kSRegSize);
- Register tmp = temps.AcquireW();
- Mov(tmp, float_to_rawbits(static_cast<float>(imm)));
- Fmov(fd, tmp);
- }
+ Register tmp = temps.AcquireX();
+ // TODO(all): Use Assembler::ldr(const FPRegister& ft, double imm).
+ Mov(tmp, double_to_rawbits(imm));
+ Fmov(fd, tmp);
+ }
+}
+
+
+void MacroAssembler::Fmov(FPRegister fd, float imm) {
+ ASSERT(allow_macro_instructions_);
+ if (fd.Is64Bits()) {
+ Fmov(fd, static_cast<double>(imm));
+ return;
+ }
+
+ ASSERT(fd.Is32Bits());
+ if (IsImmFP32(imm)) {
+ fmov(fd, imm);
+ } else if ((imm == 0.0) && (copysign(1.0, imm) == 1.0)) {
+ fmov(fd, wzr);
+ } else {
+ UseScratchRegisterScope temps(this);
+ Register tmp = temps.AcquireW();
+ // TODO(all): Use Assembler::ldr(const FPRegister& ft, float imm).
+ Mov(tmp, float_to_rawbits(imm));
+ Fmov(fd, tmp);
}
}
« no previous file with comments | « src/a64/macro-assembler-a64.h ('k') | test/cctest/test-assembler-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698