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

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

Issue 596703004: [turbofan] Add backend support for float32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 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 | Annotate | Revision Log
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/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // Move output to stack and clean up. 281 // Move output to stack and clean up.
282 __ fstp(1); 282 __ fstp(1);
283 __ fstp_d(Operand(esp, 0)); 283 __ fstp_d(Operand(esp, 0));
284 __ movsd(i.OutputDoubleRegister(), Operand(esp, 0)); 284 __ movsd(i.OutputDoubleRegister(), Operand(esp, 0));
285 __ add(esp, Immediate(kDoubleSize)); 285 __ add(esp, Immediate(kDoubleSize));
286 break; 286 break;
287 } 287 }
288 case kSSEFloat64Sqrt: 288 case kSSEFloat64Sqrt:
289 __ sqrtsd(i.OutputDoubleRegister(), i.InputOperand(0)); 289 __ sqrtsd(i.OutputDoubleRegister(), i.InputOperand(0));
290 break; 290 break;
291 case kSSECvtss2sd:
292 __ cvtss2sd(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
293 break;
294 case kSSECvtsd2ss:
295 __ cvtsd2ss(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
296 break;
291 case kSSEFloat64ToInt32: 297 case kSSEFloat64ToInt32:
292 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0)); 298 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0));
293 break; 299 break;
294 case kSSEFloat64ToUint32: { 300 case kSSEFloat64ToUint32: {
295 XMMRegister scratch = xmm0; 301 XMMRegister scratch = xmm0;
296 __ Move(scratch, -2147483648.0); 302 __ Move(scratch, -2147483648.0);
297 __ addsd(scratch, i.InputOperand(0)); 303 __ addsd(scratch, i.InputOperand(0));
298 __ cvttsd2si(i.OutputRegister(), scratch); 304 __ cvttsd2si(i.OutputRegister(), scratch);
299 __ add(i.OutputRegister(), Immediate(0x80000000)); 305 __ add(i.OutputRegister(), Immediate(0x80000000));
300 break; 306 break;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand()); 362 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand());
357 } else { 363 } else {
358 int index = 0; 364 int index = 0;
359 Operand operand = i.MemoryOperand(&index); 365 Operand operand = i.MemoryOperand(&index);
360 __ movsd(operand, i.InputDoubleRegister(index)); 366 __ movsd(operand, i.InputDoubleRegister(index));
361 } 367 }
362 break; 368 break;
363 case kIA32Movss: 369 case kIA32Movss:
364 if (instr->HasOutput()) { 370 if (instr->HasOutput()) {
365 __ movss(i.OutputDoubleRegister(), i.MemoryOperand()); 371 __ movss(i.OutputDoubleRegister(), i.MemoryOperand());
366 __ cvtss2sd(i.OutputDoubleRegister(), i.OutputDoubleRegister());
367 } else { 372 } else {
368 int index = 0; 373 int index = 0;
369 Operand operand = i.MemoryOperand(&index); 374 Operand operand = i.MemoryOperand(&index);
370 __ cvtsd2ss(xmm0, i.InputDoubleRegister(index)); 375 __ movss(operand, i.InputDoubleRegister(index));
371 __ movss(operand, xmm0);
372 } 376 }
373 break; 377 break;
374 case kIA32Push: 378 case kIA32Push:
375 if (HasImmediateInput(instr, 0)) { 379 if (HasImmediateInput(instr, 0)) {
376 __ push(i.InputImmediate(0)); 380 __ push(i.InputImmediate(0));
377 } else { 381 } else {
378 __ push(i.InputOperand(0)); 382 __ push(i.InputOperand(0));
379 } 383 }
380 break; 384 break;
381 case kIA32StoreWriteBarrier: { 385 case kIA32StoreWriteBarrier: {
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 954 }
951 } 955 }
952 MarkLazyDeoptSite(); 956 MarkLazyDeoptSite();
953 } 957 }
954 958
955 #undef __ 959 #undef __
956 960
957 } // namespace compiler 961 } // namespace compiler
958 } // namespace internal 962 } // namespace internal
959 } // namespace v8 963 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64-unittest.cc ('k') | src/compiler/ia32/instruction-codes-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698