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

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(kSSECvtss2sd, 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(kSSECvtsd2ss, 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 call_instr->MarkAsCall(); 568 call_instr->MarkAsCall();
555 if (deoptimization != NULL) { 569 if (deoptimization != NULL) {
556 DCHECK(continuation != NULL); 570 DCHECK(continuation != NULL);
557 call_instr->MarkAsControl(); 571 call_instr->MarkAsControl();
558 } 572 }
559 } 573 }
560 574
561 } // namespace compiler 575 } // namespace compiler
562 } // namespace internal 576 } // namespace internal
563 } // namespace v8 577 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/ia32/instruction-selector-ia32-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698