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

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

Issue 677433002: Add floor, ceil, round (truncate) instructions for ia32, x64 (if SSE4.1) and (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address changes and fix compilation on mac. Created 6 years, 1 month 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/js-builtin-reducer.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/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 return kMachFloat32; 596 return kMachFloat32;
597 case IrOpcode::kTruncateFloat64ToInt32: 597 case IrOpcode::kTruncateFloat64ToInt32:
598 case IrOpcode::kTruncateInt64ToInt32: 598 case IrOpcode::kTruncateInt64ToInt32:
599 return kMachInt32; 599 return kMachInt32;
600 case IrOpcode::kFloat64Add: 600 case IrOpcode::kFloat64Add:
601 case IrOpcode::kFloat64Sub: 601 case IrOpcode::kFloat64Sub:
602 case IrOpcode::kFloat64Mul: 602 case IrOpcode::kFloat64Mul:
603 case IrOpcode::kFloat64Div: 603 case IrOpcode::kFloat64Div:
604 case IrOpcode::kFloat64Mod: 604 case IrOpcode::kFloat64Mod:
605 case IrOpcode::kFloat64Sqrt: 605 case IrOpcode::kFloat64Sqrt:
606 case IrOpcode::kFloat64Floor:
607 case IrOpcode::kFloat64Ceil:
608 case IrOpcode::kFloat64RoundTruncate:
609 case IrOpcode::kFloat64RoundTiesAway:
606 return kMachFloat64; 610 return kMachFloat64;
607 case IrOpcode::kFloat64Equal: 611 case IrOpcode::kFloat64Equal:
608 case IrOpcode::kFloat64LessThan: 612 case IrOpcode::kFloat64LessThan:
609 case IrOpcode::kFloat64LessThanOrEqual: 613 case IrOpcode::kFloat64LessThanOrEqual:
610 return kMachBool; 614 return kMachBool;
611 default: 615 default:
612 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", 616 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
613 node->opcode(), node->op()->mnemonic(), node->id()); 617 node->opcode(), node->op()->mnemonic(), node->id());
614 } 618 }
615 return kMachNone; 619 return kMachNone;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 case IrOpcode::kFloat64Mod: 789 case IrOpcode::kFloat64Mod:
786 return MarkAsDouble(node), VisitFloat64Mod(node); 790 return MarkAsDouble(node), VisitFloat64Mod(node);
787 case IrOpcode::kFloat64Sqrt: 791 case IrOpcode::kFloat64Sqrt:
788 return MarkAsDouble(node), VisitFloat64Sqrt(node); 792 return MarkAsDouble(node), VisitFloat64Sqrt(node);
789 case IrOpcode::kFloat64Equal: 793 case IrOpcode::kFloat64Equal:
790 return VisitFloat64Equal(node); 794 return VisitFloat64Equal(node);
791 case IrOpcode::kFloat64LessThan: 795 case IrOpcode::kFloat64LessThan:
792 return VisitFloat64LessThan(node); 796 return VisitFloat64LessThan(node);
793 case IrOpcode::kFloat64LessThanOrEqual: 797 case IrOpcode::kFloat64LessThanOrEqual:
794 return VisitFloat64LessThanOrEqual(node); 798 return VisitFloat64LessThanOrEqual(node);
799 case IrOpcode::kFloat64Floor:
800 return MarkAsDouble(node), VisitFloat64Floor(node);
801 case IrOpcode::kFloat64Ceil:
802 return MarkAsDouble(node), VisitFloat64Ceil(node);
803 case IrOpcode::kFloat64RoundTruncate:
804 return MarkAsDouble(node), VisitFloat64RoundTruncate(node);
805 case IrOpcode::kFloat64RoundTiesAway:
806 return MarkAsDouble(node), VisitFloat64RoundTiesAway(node);
795 case IrOpcode::kLoadStackPointer: 807 case IrOpcode::kLoadStackPointer:
796 return VisitLoadStackPointer(node); 808 return VisitLoadStackPointer(node);
797 default: 809 default:
798 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", 810 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
799 node->opcode(), node->op()->mnemonic(), node->id()); 811 node->opcode(), node->op()->mnemonic(), node->id());
812 break;
800 } 813 }
801 } 814 }
802 815
803 816
804 #if V8_TURBOFAN_BACKEND 817 #if V8_TURBOFAN_BACKEND
805 818
806 void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { 819 void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) {
807 OperandGenerator g(this); 820 OperandGenerator g(this);
808 Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node), 821 Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node),
809 g.UseRegister(node->InputAt(0))); 822 g.UseRegister(node->InputAt(0)));
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 MachineOperatorBuilder::Flags 1112 MachineOperatorBuilder::Flags
1100 InstructionSelector::SupportedMachineOperatorFlags() { 1113 InstructionSelector::SupportedMachineOperatorFlags() {
1101 return MachineOperatorBuilder::Flag::kNoFlags; 1114 return MachineOperatorBuilder::Flag::kNoFlags;
1102 } 1115 }
1103 1116
1104 #endif // !V8_TURBOFAN_BACKEND 1117 #endif // !V8_TURBOFAN_BACKEND
1105 1118
1106 } // namespace compiler 1119 } // namespace compiler
1107 } // namespace internal 1120 } // namespace internal
1108 } // namespace v8 1121 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/js-builtin-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698