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

Unified Diff: src/compiler/x87/code-generator-x87.cc

Issue 1362783003: X87: [turbofan] Add support for reinterpreting integers as floating point and vice versa. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | src/compiler/x87/instruction-codes-x87.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x87/code-generator-x87.cc
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc
index 596b7ab775343b251f55e1014dfce84ddcbe78e0..c0a6303dd8bb9d9fe2a072d10b6dc26d7fa842de 100644
--- a/src/compiler/x87/code-generator-x87.cc
+++ b/src/compiler/x87/code-generator-x87.cc
@@ -1069,6 +1069,28 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
}
break;
}
+ case kX87BitcastFI: {
+ __ fstp(0);
+ __ mov(i.OutputRegister(), MemOperand(esp, 0));
+ __ lea(esp, Operand(esp, kFloatSize));
+ break;
+ }
+ case kX87BitcastIF: {
+ if (instr->InputAt(0)->IsRegister()) {
+ __ lea(esp, Operand(esp, -kFloatSize));
+ __ mov(MemOperand(esp, 0), i.InputRegister(0));
+ __ fstp(0);
+ __ fld_s(MemOperand(esp, 0));
+ __ lea(esp, Operand(esp, kFloatSize));
+ } else {
+ __ lea(esp, Operand(esp, -kDoubleSize));
+ __ mov(MemOperand(esp, 0), i.InputRegister(0));
+ __ fstp(0);
+ __ fld_d(MemOperand(esp, 0));
+ __ lea(esp, Operand(esp, kDoubleSize));
+ }
+ break;
+ }
case kX87Lea: {
AddressingMode mode = AddressingModeField::decode(instr->opcode());
// Shorten "leal" to "addl", "subl" or "shll" if the register allocation
« no previous file with comments | « no previous file | src/compiler/x87/instruction-codes-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698