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

Side by Side Diff: src/compiler/arm64/code-generator-arm64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/arm64/macro-assembler-arm64.h" 7 #include "src/arm64/macro-assembler-arm64.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // TODO(dcarney): implement directly. See note in lithium-codegen-arm64.cc 366 // TODO(dcarney): implement directly. See note in lithium-codegen-arm64.cc
367 FrameScope scope(masm(), StackFrame::MANUAL); 367 FrameScope scope(masm(), StackFrame::MANUAL);
368 DCHECK(d0.is(i.InputDoubleRegister(0))); 368 DCHECK(d0.is(i.InputDoubleRegister(0)));
369 DCHECK(d1.is(i.InputDoubleRegister(1))); 369 DCHECK(d1.is(i.InputDoubleRegister(1)));
370 DCHECK(d0.is(i.OutputDoubleRegister())); 370 DCHECK(d0.is(i.OutputDoubleRegister()));
371 // TODO(dcarney): make sure this saves all relevant registers. 371 // TODO(dcarney): make sure this saves all relevant registers.
372 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), 372 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()),
373 0, 2); 373 0, 2);
374 break; 374 break;
375 } 375 }
376 case kArm64Float32ToFloat64:
377 __ Fcvt(i.OutputDoubleRegister(), i.InputDoubleRegister(0).S());
378 break;
379 case kArm64Float64ToFloat32:
380 __ Fcvt(i.OutputDoubleRegister().S(), i.InputDoubleRegister(0));
381 break;
376 case kArm64Float64ToInt32: 382 case kArm64Float64ToInt32:
377 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0)); 383 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0));
378 break; 384 break;
379 case kArm64Float64ToUint32: 385 case kArm64Float64ToUint32:
380 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); 386 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0));
381 break; 387 break;
382 case kArm64Int32ToFloat64: 388 case kArm64Int32ToFloat64:
383 __ Scvtf(i.OutputDoubleRegister(), i.InputRegister32(0)); 389 __ Scvtf(i.OutputDoubleRegister(), i.InputRegister32(0));
384 break; 390 break;
385 case kArm64Uint32ToFloat64: 391 case kArm64Uint32ToFloat64:
(...skipping 22 matching lines...) Expand all
408 break; 414 break;
409 case kArm64StrW: 415 case kArm64StrW:
410 __ Str(i.InputRegister32(2), i.MemoryOperand()); 416 __ Str(i.InputRegister32(2), i.MemoryOperand());
411 break; 417 break;
412 case kArm64Ldr: 418 case kArm64Ldr:
413 __ Ldr(i.OutputRegister(), i.MemoryOperand()); 419 __ Ldr(i.OutputRegister(), i.MemoryOperand());
414 break; 420 break;
415 case kArm64Str: 421 case kArm64Str:
416 __ Str(i.InputRegister(2), i.MemoryOperand()); 422 __ Str(i.InputRegister(2), i.MemoryOperand());
417 break; 423 break;
418 case kArm64LdrS: { 424 case kArm64LdrS:
419 UseScratchRegisterScope scope(masm()); 425 __ Ldr(i.OutputDoubleRegister().S(), i.MemoryOperand());
420 FPRegister scratch = scope.AcquireS();
421 __ Ldr(scratch, i.MemoryOperand());
422 __ Fcvt(i.OutputDoubleRegister(), scratch);
423 break; 426 break;
424 } 427 case kArm64StrS:
425 case kArm64StrS: { 428 __ Str(i.InputDoubleRegister(2).S(), i.MemoryOperand());
426 UseScratchRegisterScope scope(masm());
427 FPRegister scratch = scope.AcquireS();
428 __ Fcvt(scratch, i.InputDoubleRegister(2));
429 __ Str(scratch, i.MemoryOperand());
430 break; 429 break;
431 }
432 case kArm64LdrD: 430 case kArm64LdrD:
433 __ Ldr(i.OutputDoubleRegister(), i.MemoryOperand()); 431 __ Ldr(i.OutputDoubleRegister(), i.MemoryOperand());
434 break; 432 break;
435 case kArm64StrD: 433 case kArm64StrD:
436 __ Str(i.InputDoubleRegister(2), i.MemoryOperand()); 434 __ Str(i.InputDoubleRegister(2), i.MemoryOperand());
437 break; 435 break;
438 case kArm64StoreWriteBarrier: { 436 case kArm64StoreWriteBarrier: {
439 Register object = i.InputRegister(0); 437 Register object = i.InputRegister(0);
440 Register index = i.InputRegister(1); 438 Register index = i.InputRegister(1);
441 Register value = i.InputRegister(2); 439 Register value = i.InputRegister(2);
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 865 }
868 } 866 }
869 MarkLazyDeoptSite(); 867 MarkLazyDeoptSite();
870 } 868 }
871 869
872 #undef __ 870 #undef __
873 871
874 } // namespace compiler 872 } // namespace compiler
875 } // namespace internal 873 } // namespace internal
876 } // namespace v8 874 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698