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

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

Issue 715433004: [turbofan] Use cbz/cbnz when possible on arm64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
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 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 return; 1263 return;
1264 } 1264 }
1265 return VisitWordCompare(this, value, kArm64Tst, &cont, true, 1265 return VisitWordCompare(this, value, kArm64Tst, &cont, true,
1266 kLogical64Imm); 1266 kLogical64Imm);
1267 } 1267 }
1268 default: 1268 default:
1269 break; 1269 break;
1270 } 1270 }
1271 } 1271 }
1272 1272
1273 // Branch could not be combined with a compare, emit compare against 0. 1273 // Branch could not be combined with a compare, compare against 0 and branch.
1274 VisitWord32Test(this, value, &cont); 1274 DCHECK((cont.condition() == kEqual) || (cont.condition() == kNotEqual));
1275 ArchOpcode opcode = (cont.condition() == kEqual) ? kArm64Cbz32 : kArm64Cbnz32;
1276 Emit(opcode, NULL, g.UseRegister(value), g.Label(cont.true_block()),
1277 g.Label(cont.false_block()))->MarkAsControl();
1275 } 1278 }
1276 1279
1277 1280
1278 void InstructionSelector::VisitWord32Equal(Node* const node) { 1281 void InstructionSelector::VisitWord32Equal(Node* const node) {
1279 Node* const user = node; 1282 Node* const user = node;
1280 FlagsContinuation cont(kEqual, node); 1283 FlagsContinuation cont(kEqual, node);
1281 Int32BinopMatcher m(user); 1284 Int32BinopMatcher m(user);
1282 if (m.right().Is(0)) { 1285 if (m.right().Is(0)) {
1283 Node* const value = m.left().node(); 1286 Node* const value = m.left().node();
1284 if (CanCover(user, value)) { 1287 if (CanCover(user, value)) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 MachineOperatorBuilder::Flags 1412 MachineOperatorBuilder::Flags
1410 InstructionSelector::SupportedMachineOperatorFlags() { 1413 InstructionSelector::SupportedMachineOperatorFlags() {
1411 return MachineOperatorBuilder::kFloat64Floor | 1414 return MachineOperatorBuilder::kFloat64Floor |
1412 MachineOperatorBuilder::kFloat64Ceil | 1415 MachineOperatorBuilder::kFloat64Ceil |
1413 MachineOperatorBuilder::kFloat64RoundTruncate | 1416 MachineOperatorBuilder::kFloat64RoundTruncate |
1414 MachineOperatorBuilder::kFloat64RoundTiesAway; 1417 MachineOperatorBuilder::kFloat64RoundTiesAway;
1415 } 1418 }
1416 } // namespace compiler 1419 } // namespace compiler
1417 } // namespace internal 1420 } // namespace internal
1418 } // namespace v8 1421 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698