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

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

Issue 850653002: [turbofan] Improve code generation for unordered comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('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 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 case IrOpcode::kInt32LessThanOrEqual: 1160 case IrOpcode::kInt32LessThanOrEqual:
1161 cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual); 1161 cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
1162 return VisitWordCompare(selector, value, cont); 1162 return VisitWordCompare(selector, value, cont);
1163 case IrOpcode::kUint32LessThan: 1163 case IrOpcode::kUint32LessThan:
1164 cont->OverwriteAndNegateIfEqual(kUnsignedLessThan); 1164 cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
1165 return VisitWordCompare(selector, value, cont); 1165 return VisitWordCompare(selector, value, cont);
1166 case IrOpcode::kUint32LessThanOrEqual: 1166 case IrOpcode::kUint32LessThanOrEqual:
1167 cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual); 1167 cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
1168 return VisitWordCompare(selector, value, cont); 1168 return VisitWordCompare(selector, value, cont);
1169 case IrOpcode::kFloat64Equal: 1169 case IrOpcode::kFloat64Equal:
1170 cont->OverwriteAndNegateIfEqual(kUnorderedEqual); 1170 cont->OverwriteAndNegateIfEqual(kEqual);
1171 return VisitFloat64Compare(selector, value, cont); 1171 return VisitFloat64Compare(selector, value, cont);
1172 case IrOpcode::kFloat64LessThan: 1172 case IrOpcode::kFloat64LessThan:
1173 cont->OverwriteAndNegateIfEqual(kUnorderedLessThan); 1173 cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
1174 return VisitFloat64Compare(selector, value, cont); 1174 return VisitFloat64Compare(selector, value, cont);
1175 case IrOpcode::kFloat64LessThanOrEqual: 1175 case IrOpcode::kFloat64LessThanOrEqual:
1176 cont->OverwriteAndNegateIfEqual(kUnorderedLessThanOrEqual); 1176 cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
1177 return VisitFloat64Compare(selector, value, cont); 1177 return VisitFloat64Compare(selector, value, cont);
1178 case IrOpcode::kProjection: 1178 case IrOpcode::kProjection:
1179 // Check if this is the overflow output projection of an 1179 // Check if this is the overflow output projection of an
1180 // <Operation>WithOverflow node. 1180 // <Operation>WithOverflow node.
1181 if (OpParameter<size_t>(value) == 1u) { 1181 if (OpParameter<size_t>(value) == 1u) {
1182 // We cannot combine the <Operation>WithOverflow with this branch 1182 // We cannot combine the <Operation>WithOverflow with this branch
1183 // unless the 0th projection (the use of the actual value of the 1183 // unless the 0th projection (the use of the actual value of the
1184 // <Operation> is either NULL, which means there's no use of the 1184 // <Operation> is either NULL, which means there's no use of the
1185 // actual value, or was already defined, which means it is scheduled 1185 // actual value, or was already defined, which means it is scheduled
1186 // *AFTER* this branch). 1186 // *AFTER* this branch).
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 if (Node* ovf = node->FindProjection(1)) { 1297 if (Node* ovf = node->FindProjection(1)) {
1298 FlagsContinuation cont(kOverflow, ovf); 1298 FlagsContinuation cont(kOverflow, ovf);
1299 return VisitBinop(this, node, kArmSub, kArmRsb, &cont); 1299 return VisitBinop(this, node, kArmSub, kArmRsb, &cont);
1300 } 1300 }
1301 FlagsContinuation cont; 1301 FlagsContinuation cont;
1302 VisitBinop(this, node, kArmSub, kArmRsb, &cont); 1302 VisitBinop(this, node, kArmSub, kArmRsb, &cont);
1303 } 1303 }
1304 1304
1305 1305
1306 void InstructionSelector::VisitFloat64Equal(Node* node) { 1306 void InstructionSelector::VisitFloat64Equal(Node* node) {
1307 FlagsContinuation cont(kUnorderedEqual, node); 1307 FlagsContinuation cont(kEqual, node);
1308 VisitFloat64Compare(this, node, &cont); 1308 VisitFloat64Compare(this, node, &cont);
1309 } 1309 }
1310 1310
1311 1311
1312 void InstructionSelector::VisitFloat64LessThan(Node* node) { 1312 void InstructionSelector::VisitFloat64LessThan(Node* node) {
1313 FlagsContinuation cont(kUnorderedLessThan, node); 1313 FlagsContinuation cont(kUnsignedLessThan, node);
1314 VisitFloat64Compare(this, node, &cont); 1314 VisitFloat64Compare(this, node, &cont);
1315 } 1315 }
1316 1316
1317 1317
1318 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { 1318 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
1319 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); 1319 FlagsContinuation cont(kUnsignedLessThanOrEqual, node);
1320 VisitFloat64Compare(this, node, &cont); 1320 VisitFloat64Compare(this, node, &cont);
1321 } 1321 }
1322 1322
1323 1323
1324 // static 1324 // static
1325 MachineOperatorBuilder::Flags 1325 MachineOperatorBuilder::Flags
1326 InstructionSelector::SupportedMachineOperatorFlags() { 1326 InstructionSelector::SupportedMachineOperatorFlags() {
1327 MachineOperatorBuilder::Flags flags = 1327 MachineOperatorBuilder::Flags flags =
1328 MachineOperatorBuilder::kInt32DivIsSafe | 1328 MachineOperatorBuilder::kInt32DivIsSafe |
1329 MachineOperatorBuilder::kUint32DivIsSafe; 1329 MachineOperatorBuilder::kUint32DivIsSafe;
1330 1330
1331 if (CpuFeatures::IsSupported(ARMv8)) { 1331 if (CpuFeatures::IsSupported(ARMv8)) {
1332 flags |= MachineOperatorBuilder::kFloat64Floor | 1332 flags |= MachineOperatorBuilder::kFloat64Floor |
1333 MachineOperatorBuilder::kFloat64Ceil | 1333 MachineOperatorBuilder::kFloat64Ceil |
1334 MachineOperatorBuilder::kFloat64RoundTruncate | 1334 MachineOperatorBuilder::kFloat64RoundTruncate |
1335 MachineOperatorBuilder::kFloat64RoundTiesAway; 1335 MachineOperatorBuilder::kFloat64RoundTiesAway;
1336 } 1336 }
1337 return flags; 1337 return flags;
1338 } 1338 }
1339 1339
1340 } // namespace compiler 1340 } // namespace compiler
1341 } // namespace internal 1341 } // namespace internal
1342 } // namespace v8 1342 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('k') | src/compiler/arm64/code-generator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698