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

Side by Side Diff: src/compiler/instruction-selector.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-selector-ia32.cc ('k') | src/compiler/machine-operator.h » ('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.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties-inl.h" 9 #include "src/compiler/node-properties-inl.h"
10 #include "src/compiler/pipeline.h" 10 #include "src/compiler/pipeline.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 case IrOpcode::kFrameState: 487 case IrOpcode::kFrameState:
488 case IrOpcode::kStateValues: 488 case IrOpcode::kStateValues:
489 return; 489 return;
490 case IrOpcode::kLoad: { 490 case IrOpcode::kLoad: {
491 LoadRepresentation rep = OpParameter<LoadRepresentation>(node); 491 LoadRepresentation rep = OpParameter<LoadRepresentation>(node);
492 MarkAsRepresentation(rep, node); 492 MarkAsRepresentation(rep, node);
493 return VisitLoad(node); 493 return VisitLoad(node);
494 } 494 }
495 case IrOpcode::kStore: 495 case IrOpcode::kStore:
496 return VisitStore(node); 496 return VisitStore(node);
497 case IrOpcode::kWord32And: 497
498 return VisitWord32And(node); 498 #define VISIT_DEFAULT(name) \
499 case IrOpcode::kWord32Or: 499 case IrOpcode::k##name: \
500 return VisitWord32Or(node); 500 return Visit##name(node)
501 case IrOpcode::kWord32Xor: 501 #define VISIT_FLOAT64(name) \
502 return VisitWord32Xor(node); 502 case IrOpcode::k##name: \
503 case IrOpcode::kWord32Shl: 503 return MarkAsDouble(node), Visit##name(node)
504 return VisitWord32Shl(node); 504 #define VISIT_FLOAT32(name) \
505 case IrOpcode::kWord32Shr: 505 case IrOpcode::k##name: \
506 return VisitWord32Shr(node); 506 return MarkAsDouble(node), Visit##name(node)
507 case IrOpcode::kWord32Sar: 507
508 return VisitWord32Sar(node); 508 VISIT_DEFAULT(Word32And);
509 case IrOpcode::kWord32Ror: 509 VISIT_DEFAULT(Word32Or);
510 return VisitWord32Ror(node); 510 VISIT_DEFAULT(Word32Xor);
511 case IrOpcode::kWord32Equal: 511 VISIT_DEFAULT(Word32Shl);
512 return VisitWord32Equal(node); 512 VISIT_DEFAULT(Word32Shr);
513 case IrOpcode::kWord64And: 513 VISIT_DEFAULT(Word32Sar);
514 return VisitWord64And(node); 514 VISIT_DEFAULT(Word32Ror);
515 case IrOpcode::kWord64Or: 515 VISIT_DEFAULT(Word32Equal);
516 return VisitWord64Or(node); 516
517 case IrOpcode::kWord64Xor: 517 VISIT_DEFAULT(Word64And);
518 return VisitWord64Xor(node); 518 VISIT_DEFAULT(Word64Or);
519 case IrOpcode::kWord64Shl: 519 VISIT_DEFAULT(Word64Xor);
520 return VisitWord64Shl(node); 520 VISIT_DEFAULT(Word64Shl);
521 case IrOpcode::kWord64Shr: 521 VISIT_DEFAULT(Word64Shr);
522 return VisitWord64Shr(node); 522 VISIT_DEFAULT(Word64Sar);
523 case IrOpcode::kWord64Sar: 523 VISIT_DEFAULT(Word64Ror);
524 return VisitWord64Sar(node); 524 VISIT_DEFAULT(Word64Equal);
525 case IrOpcode::kWord64Ror: 525
526 return VisitWord64Ror(node); 526 VISIT_DEFAULT(Int32Add);
527 case IrOpcode::kWord64Equal: 527 VISIT_DEFAULT(Int32AddWithOverflow);
528 return VisitWord64Equal(node); 528 VISIT_DEFAULT(Int32Sub);
529 case IrOpcode::kInt32Add: 529 VISIT_DEFAULT(Int32SubWithOverflow);
530 return VisitInt32Add(node); 530 VISIT_DEFAULT(Int32Mul);
531 case IrOpcode::kInt32AddWithOverflow: 531 VISIT_DEFAULT(Int32Div);
532 return VisitInt32AddWithOverflow(node); 532 VISIT_DEFAULT(Int32UDiv);
533 case IrOpcode::kInt32Sub: 533 VISIT_DEFAULT(Int32Mod);
534 return VisitInt32Sub(node); 534 VISIT_DEFAULT(Int32UMod);
535 case IrOpcode::kInt32SubWithOverflow: 535 VISIT_DEFAULT(Int32LessThan);
536 return VisitInt32SubWithOverflow(node); 536 VISIT_DEFAULT(Int32LessThanOrEqual);
537 case IrOpcode::kInt32Mul: 537 VISIT_DEFAULT(Uint32LessThan);
538 return VisitInt32Mul(node); 538 VISIT_DEFAULT(Uint32LessThanOrEqual);
539 case IrOpcode::kInt32Div: 539
540 return VisitInt32Div(node); 540 VISIT_DEFAULT(Int64Add);
541 case IrOpcode::kInt32UDiv: 541 VISIT_DEFAULT(Int64Sub);
542 return VisitInt32UDiv(node); 542 VISIT_DEFAULT(Int64Mul);
543 case IrOpcode::kInt32Mod: 543 VISIT_DEFAULT(Int64Div);
544 return VisitInt32Mod(node); 544 VISIT_DEFAULT(Int64UDiv);
545 case IrOpcode::kInt32UMod: 545 VISIT_DEFAULT(Int64Mod);
546 return VisitInt32UMod(node); 546 VISIT_DEFAULT(Int64UMod);
547 case IrOpcode::kInt32LessThan: 547 VISIT_DEFAULT(Int64LessThan);
548 return VisitInt32LessThan(node); 548 VISIT_DEFAULT(Int64LessThanOrEqual);
549 case IrOpcode::kInt32LessThanOrEqual: 549
550 return VisitInt32LessThanOrEqual(node); 550 VISIT_FLOAT64(ChangeFloat32ToFloat64);
551 case IrOpcode::kUint32LessThan: 551 VISIT_FLOAT32(ChangeFloat64ToFloat32);
552 return VisitUint32LessThan(node); 552 VISIT_DEFAULT(ChangeFloat64ToInt32);
553 case IrOpcode::kUint32LessThanOrEqual: 553 VISIT_DEFAULT(ChangeFloat64ToUint32);
554 return VisitUint32LessThanOrEqual(node); 554 VISIT_FLOAT64(ChangeInt32ToFloat64);
555 case IrOpcode::kInt64Add: 555 VISIT_DEFAULT(ChangeInt32ToInt64);
556 return VisitInt64Add(node); 556 VISIT_FLOAT64(ChangeUint32ToFloat64);
557 case IrOpcode::kInt64Sub: 557 VISIT_DEFAULT(ChangeUint32ToUint64);
558 return VisitInt64Sub(node); 558
559 case IrOpcode::kInt64Mul: 559 VISIT_FLOAT32(TruncateFloat64ToFloat32);
560 return VisitInt64Mul(node); 560 VISIT_DEFAULT(TruncateFloat64ToInt32);
561 case IrOpcode::kInt64Div: 561 VISIT_DEFAULT(TruncateInt64ToInt32);
562 return VisitInt64Div(node); 562
563 case IrOpcode::kInt64UDiv: 563 VISIT_FLOAT64(Float64Add);
564 return VisitInt64UDiv(node); 564 VISIT_FLOAT64(Float64Sub);
565 case IrOpcode::kInt64Mod: 565 VISIT_FLOAT64(Float64Mul);
566 return VisitInt64Mod(node); 566 VISIT_FLOAT64(Float64Div);
567 case IrOpcode::kInt64UMod: 567 VISIT_FLOAT64(Float64Mod);
568 return VisitInt64UMod(node); 568 VISIT_DEFAULT(Float64Equal);
569 case IrOpcode::kInt64LessThan: 569 VISIT_DEFAULT(Float64LessThan);
570 return VisitInt64LessThan(node); 570 VISIT_DEFAULT(Float64LessThanOrEqual);
571 case IrOpcode::kInt64LessThanOrEqual:
572 return VisitInt64LessThanOrEqual(node);
573 case IrOpcode::kChangeInt32ToFloat64:
574 return MarkAsDouble(node), VisitChangeInt32ToFloat64(node);
575 case IrOpcode::kChangeUint32ToFloat64:
576 return MarkAsDouble(node), VisitChangeUint32ToFloat64(node);
577 case IrOpcode::kChangeFloat64ToInt32:
578 return VisitChangeFloat64ToInt32(node);
579 case IrOpcode::kChangeFloat64ToUint32:
580 return VisitChangeFloat64ToUint32(node);
581 case IrOpcode::kChangeInt32ToInt64:
582 return VisitChangeInt32ToInt64(node);
583 case IrOpcode::kChangeUint32ToUint64:
584 return VisitChangeUint32ToUint64(node);
585 case IrOpcode::kTruncateFloat64ToInt32:
586 return VisitTruncateFloat64ToInt32(node);
587 case IrOpcode::kTruncateInt64ToInt32:
588 return VisitTruncateInt64ToInt32(node);
589 case IrOpcode::kFloat64Add:
590 return MarkAsDouble(node), VisitFloat64Add(node);
591 case IrOpcode::kFloat64Sub:
592 return MarkAsDouble(node), VisitFloat64Sub(node);
593 case IrOpcode::kFloat64Mul:
594 return MarkAsDouble(node), VisitFloat64Mul(node);
595 case IrOpcode::kFloat64Div:
596 return MarkAsDouble(node), VisitFloat64Div(node);
597 case IrOpcode::kFloat64Mod:
598 return MarkAsDouble(node), VisitFloat64Mod(node);
599 case IrOpcode::kFloat64Equal:
600 return VisitFloat64Equal(node);
601 case IrOpcode::kFloat64LessThan:
602 return VisitFloat64LessThan(node);
603 case IrOpcode::kFloat64LessThanOrEqual:
604 return VisitFloat64LessThanOrEqual(node);
605 default: 571 default:
606 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", 572 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
607 node->opcode(), node->op()->mnemonic(), node->id()); 573 node->opcode(), node->op()->mnemonic(), node->id());
608 } 574 }
609 } 575 }
610 576
611 577
612 #if V8_TURBOFAN_BACKEND 578 #if V8_TURBOFAN_BACKEND
613 579
614 void InstructionSelector::VisitWord32Equal(Node* node) { 580 void InstructionSelector::VisitWord32Equal(Node* node) {
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 1056
1091 1057
1092 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, 1058 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
1093 BasicBlock* deoptimization) {} 1059 BasicBlock* deoptimization) {}
1094 1060
1095 #endif // !V8_TURBOFAN_BACKEND 1061 #endif // !V8_TURBOFAN_BACKEND
1096 1062
1097 } // namespace compiler 1063 } // namespace compiler
1098 } // namespace internal 1064 } // namespace internal
1099 } // namespace v8 1065 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698