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

Side by Side Diff: src/compiler/ia32/instruction-selector-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, 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 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/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties-inl.h" 7 #include "src/compiler/node-properties-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 void InstructionSelector::VisitInt32Mod(Node* node) { 347 void InstructionSelector::VisitInt32Mod(Node* node) {
348 VisitMod(this, node, kIA32Idiv); 348 VisitMod(this, node, kIA32Idiv);
349 } 349 }
350 350
351 351
352 void InstructionSelector::VisitInt32UMod(Node* node) { 352 void InstructionSelector::VisitInt32UMod(Node* node) {
353 VisitMod(this, node, kIA32Udiv); 353 VisitMod(this, node, kIA32Udiv);
354 } 354 }
355 355
356 356
357 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) {
358 IA32OperandGenerator g(this);
359 // TODO(turbofan): IA32 SSE conversions should take an operand.
360 Emit(kCvtss2sd, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
361 }
362
363
357 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { 364 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
358 IA32OperandGenerator g(this); 365 IA32OperandGenerator g(this);
359 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 366 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
360 } 367 }
361 368
362 369
363 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { 370 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
364 IA32OperandGenerator g(this); 371 IA32OperandGenerator g(this);
365 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand. 372 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand.
366 Emit(kSSEUint32ToFloat64, g.DefineAsRegister(node), 373 Emit(kSSEUint32ToFloat64, g.DefineAsRegister(node),
367 g.UseRegister(node->InputAt(0))); 374 g.UseRegister(node->InputAt(0)));
368 } 375 }
369 376
370 377
371 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { 378 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
372 IA32OperandGenerator g(this); 379 IA32OperandGenerator g(this);
373 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 380 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
374 } 381 }
375 382
376 383
377 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { 384 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
378 IA32OperandGenerator g(this); 385 IA32OperandGenerator g(this);
379 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 386 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
380 } 387 }
381 388
382 389
390 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
391 IA32OperandGenerator g(this);
392 // TODO(turbofan): IA32 SSE conversions should take an operand.
393 Emit(kCvtsd2ss, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
394 }
395
396
383 void InstructionSelector::VisitFloat64Add(Node* node) { 397 void InstructionSelector::VisitFloat64Add(Node* node) {
384 IA32OperandGenerator g(this); 398 IA32OperandGenerator g(this);
385 Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), 399 Emit(kSSEFloat64Add, g.DefineSameAsFirst(node),
386 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); 400 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
387 } 401 }
388 402
389 403
390 void InstructionSelector::VisitFloat64Sub(Node* node) { 404 void InstructionSelector::VisitFloat64Sub(Node* node) {
391 IA32OperandGenerator g(this); 405 IA32OperandGenerator g(this);
392 Emit(kSSEFloat64Sub, g.DefineSameAsFirst(node), 406 Emit(kSSEFloat64Sub, g.DefineSameAsFirst(node),
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 call_instr->MarkAsCall(); 562 call_instr->MarkAsCall();
549 if (deoptimization != NULL) { 563 if (deoptimization != NULL) {
550 DCHECK(continuation != NULL); 564 DCHECK(continuation != NULL);
551 call_instr->MarkAsControl(); 565 call_instr->MarkAsControl();
552 } 566 }
553 } 567 }
554 568
555 } // namespace compiler 569 } // namespace compiler
556 } // namespace internal 570 } // namespace internal
557 } // namespace v8 571 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698