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

Side by Side Diff: src/compiler/x64/code-generator-x64.cc

Issue 1356913002: [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: Rename ReinterpretAs to BitcastTo Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/compiler/x64/instruction-codes-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 break; 1164 break;
1165 case kX64Movsd: 1165 case kX64Movsd:
1166 if (instr->HasOutput()) { 1166 if (instr->HasOutput()) {
1167 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand()); 1167 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand());
1168 } else { 1168 } else {
1169 size_t index = 0; 1169 size_t index = 0;
1170 Operand operand = i.MemoryOperand(&index); 1170 Operand operand = i.MemoryOperand(&index);
1171 __ movsd(operand, i.InputDoubleRegister(index)); 1171 __ movsd(operand, i.InputDoubleRegister(index));
1172 } 1172 }
1173 break; 1173 break;
1174 case kX64BitcastFI:
1175 if (instr->InputAt(0)->IsDoubleStackSlot()) {
1176 __ movl(i.OutputRegister(), i.InputOperand(0));
1177 } else {
1178 __ movd(i.OutputRegister(), i.InputDoubleRegister(0));
1179 }
1180 break;
1181 case kX64BitcastDL:
1182 if (instr->InputAt(0)->IsDoubleStackSlot()) {
1183 __ movq(i.OutputRegister(), i.InputOperand(0));
1184 } else {
1185 __ movq(i.OutputRegister(), i.InputDoubleRegister(0));
1186 }
1187 break;
1188 case kX64BitcastIF:
1189 if (instr->InputAt(0)->IsRegister()) {
1190 __ movd(i.OutputDoubleRegister(), i.InputRegister(0));
1191 } else {
1192 __ movss(i.OutputDoubleRegister(), i.InputOperand(0));
1193 }
1194 break;
1195 case kX64BitcastLD:
1196 if (instr->InputAt(0)->IsRegister()) {
1197 __ movq(i.OutputDoubleRegister(), i.InputRegister(0));
1198 } else {
1199 __ movsd(i.OutputDoubleRegister(), i.InputOperand(0));
1200 }
1201 break;
1174 case kX64Lea32: { 1202 case kX64Lea32: {
1175 AddressingMode mode = AddressingModeField::decode(instr->opcode()); 1203 AddressingMode mode = AddressingModeField::decode(instr->opcode());
1176 // Shorten "leal" to "addl", "subl" or "shll" if the register allocation 1204 // Shorten "leal" to "addl", "subl" or "shll" if the register allocation
1177 // and addressing mode just happens to work out. The "addl"/"subl" forms 1205 // and addressing mode just happens to work out. The "addl"/"subl" forms
1178 // in these cases are faster based on measurements. 1206 // in these cases are faster based on measurements.
1179 if (i.InputRegister(0).is(i.OutputRegister())) { 1207 if (i.InputRegister(0).is(i.OutputRegister())) {
1180 if (mode == kMode_MRI) { 1208 if (mode == kMode_MRI) {
1181 int32_t constant_summand = i.InputInt32(1); 1209 int32_t constant_summand = i.InputInt32(1);
1182 if (constant_summand > 0) { 1210 if (constant_summand > 0) {
1183 __ addl(i.OutputRegister(), Immediate(constant_summand)); 1211 __ addl(i.OutputRegister(), Immediate(constant_summand));
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1806 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1779 __ Nop(padding_size); 1807 __ Nop(padding_size);
1780 } 1808 }
1781 } 1809 }
1782 1810
1783 #undef __ 1811 #undef __
1784 1812
1785 } // namespace internal 1813 } // namespace internal
1786 } // namespace compiler 1814 } // namespace compiler
1787 } // namespace v8 1815 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/compiler/x64/instruction-codes-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698