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

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 591023003: WIP: Add first-class support for float32 representations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(kSSEFloat32ToFloat64, g.DefineAsRegister(node),
361 g.UseRegister(node->InputAt(0)));
362 }
363
364
365 void InstructionSelector::VisitChangeFloat64ToFloat32(Node* node) {
366 IA32OperandGenerator g(this);
367 // TODO(turbofan): IA32 SSE conversions should take an operand.
368 Emit(kSSEFloat64ToFloat32, g.DefineAsRegister(node),
369 g.UseRegister(node->InputAt(0)));
370 }
371
372
357 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { 373 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
358 IA32OperandGenerator g(this); 374 IA32OperandGenerator g(this);
359 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 375 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
360 } 376 }
361 377
362 378
363 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { 379 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
364 IA32OperandGenerator g(this); 380 IA32OperandGenerator g(this);
365 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand. 381 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand.
366 Emit(kSSEUint32ToFloat64, g.DefineAsRegister(node), 382 Emit(kSSEUint32ToFloat64, g.DefineAsRegister(node),
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 426
411 void InstructionSelector::VisitFloat64Mod(Node* node) { 427 void InstructionSelector::VisitFloat64Mod(Node* node) {
412 IA32OperandGenerator g(this); 428 IA32OperandGenerator g(this);
413 InstructionOperand* temps[] = {g.TempRegister(eax)}; 429 InstructionOperand* temps[] = {g.TempRegister(eax)};
414 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node), 430 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node),
415 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1, 431 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1,
416 temps); 432 temps);
417 } 433 }
418 434
419 435
436 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
437 IA32OperandGenerator g(this);
438 Emit(kSSEFloat64ToFloat32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
439 }
440
441
420 void InstructionSelector::VisitInt32AddWithOverflow(Node* node, 442 void InstructionSelector::VisitInt32AddWithOverflow(Node* node,
421 FlagsContinuation* cont) { 443 FlagsContinuation* cont) {
422 VisitBinop(this, node, kIA32Add, cont); 444 VisitBinop(this, node, kIA32Add, cont);
423 } 445 }
424 446
425 447
426 void InstructionSelector::VisitInt32SubWithOverflow(Node* node, 448 void InstructionSelector::VisitInt32SubWithOverflow(Node* node,
427 FlagsContinuation* cont) { 449 FlagsContinuation* cont) {
428 VisitBinop(this, node, kIA32Sub, cont); 450 VisitBinop(this, node, kIA32Sub, cont);
429 } 451 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 if (descriptor->kind() == CallDescriptor::kCallAddress && 580 if (descriptor->kind() == CallDescriptor::kCallAddress &&
559 buffer.pushed_nodes.size() > 0) { 581 buffer.pushed_nodes.size() > 0) {
560 DCHECK(deoptimization == NULL && continuation == NULL); 582 DCHECK(deoptimization == NULL && continuation == NULL);
561 Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL); 583 Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL);
562 } 584 }
563 } 585 }
564 586
565 } // namespace compiler 587 } // namespace compiler
566 } // namespace internal 588 } // namespace internal
567 } // namespace v8 589 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698