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

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

Issue 697663003: [turbofan] Also optimize unsigned division by constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Slight improvement 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/arm/instruction-codes-arm.h ('k') | src/compiler/arm64/code-generator-arm64.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/base/bits.h" 5 #include "src/base/bits.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 case kArchJmp: 79 case kArchJmp:
80 case kArchNop: 80 case kArchNop:
81 case kArchRet: 81 case kArchRet:
82 case kArchStackPointer: 82 case kArchStackPointer:
83 case kArchTruncateDoubleToI: 83 case kArchTruncateDoubleToI:
84 case kArmMul: 84 case kArmMul:
85 case kArmMla: 85 case kArmMla:
86 case kArmMls: 86 case kArmMls:
87 case kArmSmmul: 87 case kArmSmmul:
88 case kArmSmmla: 88 case kArmSmmla:
89 case kArmUmull:
89 case kArmSdiv: 90 case kArmSdiv:
90 case kArmUdiv: 91 case kArmUdiv:
91 case kArmBfc: 92 case kArmBfc:
92 case kArmUbfx: 93 case kArmUbfx:
93 case kArmVcmpF64: 94 case kArmVcmpF64:
94 case kArmVaddF64: 95 case kArmVaddF64:
95 case kArmVsubF64: 96 case kArmVsubF64:
96 case kArmVmulF64: 97 case kArmVmulF64:
97 case kArmVmlaF64: 98 case kArmVmlaF64:
98 case kArmVmlsF64: 99 case kArmVmlsF64:
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 } 652 }
652 653
653 654
654 void InstructionSelector::VisitInt32MulHigh(Node* node) { 655 void InstructionSelector::VisitInt32MulHigh(Node* node) {
655 ArmOperandGenerator g(this); 656 ArmOperandGenerator g(this);
656 Emit(kArmSmmul, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)), 657 Emit(kArmSmmul, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)),
657 g.UseRegister(node->InputAt(1))); 658 g.UseRegister(node->InputAt(1)));
658 } 659 }
659 660
660 661
662 void InstructionSelector::VisitUint32MulHigh(Node* node) {
663 ArmOperandGenerator g(this);
664 InstructionOperand* outputs[] = {g.TempRegister(), g.DefineAsRegister(node)};
665 InstructionOperand* inputs[] = {g.UseRegister(node->InputAt(0)),
666 g.UseRegister(node->InputAt(1))};
667 Emit(kArmUmull, arraysize(outputs), outputs, arraysize(inputs), inputs);
668 }
669
670
661 static void EmitDiv(InstructionSelector* selector, ArchOpcode div_opcode, 671 static void EmitDiv(InstructionSelector* selector, ArchOpcode div_opcode,
662 ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode, 672 ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode,
663 InstructionOperand* result_operand, 673 InstructionOperand* result_operand,
664 InstructionOperand* left_operand, 674 InstructionOperand* left_operand,
665 InstructionOperand* right_operand) { 675 InstructionOperand* right_operand) {
666 ArmOperandGenerator g(selector); 676 ArmOperandGenerator g(selector);
667 if (selector->IsSupported(SUDIV)) { 677 if (selector->IsSupported(SUDIV)) {
668 selector->Emit(div_opcode, result_operand, left_operand, right_operand); 678 selector->Emit(div_opcode, result_operand, left_operand, right_operand);
669 return; 679 return;
670 } 680 }
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 MachineOperatorBuilder::kFloat64Ceil | 1196 MachineOperatorBuilder::kFloat64Ceil |
1187 MachineOperatorBuilder::kFloat64RoundTruncate | 1197 MachineOperatorBuilder::kFloat64RoundTruncate |
1188 MachineOperatorBuilder::kFloat64RoundTiesAway; 1198 MachineOperatorBuilder::kFloat64RoundTiesAway;
1189 } 1199 }
1190 return flags; 1200 return flags;
1191 } 1201 }
1192 1202
1193 } // namespace compiler 1203 } // namespace compiler
1194 } // namespace internal 1204 } // namespace internal
1195 } // namespace v8 1205 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm/instruction-codes-arm.h ('k') | src/compiler/arm64/code-generator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698