Chromium Code Reviews

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.
Jump to:
View unified diff | | 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 267 matching lines...)
278 __ fnstsw_ax(); 278 __ fnstsw_ax();
279 __ sahf(); 279 __ sahf();
280 __ j(parity_even, &mod_loop); 280 __ j(parity_even, &mod_loop);
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 kCvtss2sd:
289 __ cvtss2sd(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
290 break;
291 case kCvtsd2ss:
292 __ cvtsd2ss(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
293 break;
288 case kSSEFloat64ToInt32: 294 case kSSEFloat64ToInt32:
289 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0)); 295 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0));
290 break; 296 break;
291 case kSSEFloat64ToUint32: { 297 case kSSEFloat64ToUint32: {
292 XMMRegister scratch = xmm0; 298 XMMRegister scratch = xmm0;
293 __ Move(scratch, -2147483648.0); 299 __ Move(scratch, -2147483648.0);
294 __ addsd(scratch, i.InputOperand(0)); 300 __ addsd(scratch, i.InputOperand(0));
295 __ cvttsd2si(i.OutputRegister(), scratch); 301 __ cvttsd2si(i.OutputRegister(), scratch);
296 __ add(i.OutputRegister(), Immediate(0x80000000)); 302 __ add(i.OutputRegister(), Immediate(0x80000000));
297 break; 303 break;
(...skipping 55 matching lines...)
353 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand()); 359 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand());
354 } else { 360 } else {
355 int index = 0; 361 int index = 0;
356 Operand operand = i.MemoryOperand(&index); 362 Operand operand = i.MemoryOperand(&index);
357 __ movsd(operand, i.InputDoubleRegister(index)); 363 __ movsd(operand, i.InputDoubleRegister(index));
358 } 364 }
359 break; 365 break;
360 case kIA32Movss: 366 case kIA32Movss:
361 if (instr->HasOutput()) { 367 if (instr->HasOutput()) {
362 __ movss(i.OutputDoubleRegister(), i.MemoryOperand()); 368 __ movss(i.OutputDoubleRegister(), i.MemoryOperand());
363 __ cvtss2sd(i.OutputDoubleRegister(), i.OutputDoubleRegister());
364 } else { 369 } else {
365 int index = 0; 370 int index = 0;
366 Operand operand = i.MemoryOperand(&index); 371 Operand operand = i.MemoryOperand(&index);
367 __ cvtsd2ss(xmm0, i.InputDoubleRegister(index)); 372 __ movss(operand, i.InputDoubleRegister(index));
368 __ movss(operand, xmm0);
369 } 373 }
370 break; 374 break;
371 case kIA32Push: 375 case kIA32Push:
372 if (HasImmediateInput(instr, 0)) { 376 if (HasImmediateInput(instr, 0)) {
373 __ push(i.InputImmediate(0)); 377 __ push(i.InputImmediate(0));
374 } else { 378 } else {
375 __ push(i.InputOperand(0)); 379 __ push(i.InputOperand(0));
376 } 380 }
377 break; 381 break;
378 case kIA32StoreWriteBarrier: { 382 case kIA32StoreWriteBarrier: {
(...skipping 568 matching lines...)
947 } 951 }
948 } 952 }
949 MarkLazyDeoptSite(); 953 MarkLazyDeoptSite();
950 } 954 }
951 955
952 #undef __ 956 #undef __
953 957
954 } // namespace compiler 958 } // namespace compiler
955 } // namespace internal 959 } // namespace internal
956 } // namespace v8 960 } // namespace v8
OLDNEW

Powered by Google App Engine