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

Side by Side Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 2022073002: [turbofan] ARM64: Match 64 bit compare with zero and branch (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/base/bits.h ('k') | src/compiler/arm64/instruction-codes-arm64.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/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/arm64/macro-assembler-arm64.h" 8 #include "src/arm64/macro-assembler-arm64.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 break; 1031 break;
1032 case kArm64Bfi: 1032 case kArm64Bfi:
1033 __ Bfi(i.OutputRegister(), i.InputRegister(1), i.InputInt6(2), 1033 __ Bfi(i.OutputRegister(), i.InputRegister(1), i.InputInt6(2),
1034 i.InputInt6(3)); 1034 i.InputInt6(3));
1035 break; 1035 break;
1036 case kArm64TestAndBranch32: 1036 case kArm64TestAndBranch32:
1037 case kArm64TestAndBranch: 1037 case kArm64TestAndBranch:
1038 // Pseudo instructions turned into tbz/tbnz in AssembleArchBranch. 1038 // Pseudo instructions turned into tbz/tbnz in AssembleArchBranch.
1039 break; 1039 break;
1040 case kArm64CompareAndBranch32: 1040 case kArm64CompareAndBranch32:
1041 case kArm64CompareAndBranch:
1041 // Pseudo instruction turned into cbz/cbnz in AssembleArchBranch. 1042 // Pseudo instruction turned into cbz/cbnz in AssembleArchBranch.
1042 break; 1043 break;
1043 case kArm64ClaimCSP: { 1044 case kArm64ClaimCSP: {
1044 int count = RoundUp(i.InputInt32(0), 2); 1045 int count = RoundUp(i.InputInt32(0), 2);
1045 Register prev = __ StackPointer(); 1046 Register prev = __ StackPointer();
1046 if (prev.Is(jssp)) { 1047 if (prev.Is(jssp)) {
1047 // TODO(titzer): make this a macro-assembler method. 1048 // TODO(titzer): make this a macro-assembler method.
1048 // Align the CSP and store the previous JSSP on the stack. 1049 // Align the CSP and store the previous JSSP on the stack.
1049 UseScratchRegisterScope scope(masm()); 1050 UseScratchRegisterScope scope(masm());
1050 Register tmp = scope.AcquireX(); 1051 Register tmp = scope.AcquireX();
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 switch (condition) { 1497 switch (condition) {
1497 case kEqual: 1498 case kEqual:
1498 __ Cbz(i.InputRegister32(0), tlabel); 1499 __ Cbz(i.InputRegister32(0), tlabel);
1499 break; 1500 break;
1500 case kNotEqual: 1501 case kNotEqual:
1501 __ Cbnz(i.InputRegister32(0), tlabel); 1502 __ Cbnz(i.InputRegister32(0), tlabel);
1502 break; 1503 break;
1503 default: 1504 default:
1504 UNREACHABLE(); 1505 UNREACHABLE();
1505 } 1506 }
1507 } else if (opcode == kArm64CompareAndBranch) {
1508 switch (condition) {
1509 case kEqual:
1510 __ Cbz(i.InputRegister64(0), tlabel);
1511 break;
1512 case kNotEqual:
1513 __ Cbnz(i.InputRegister64(0), tlabel);
1514 break;
1515 default:
1516 UNREACHABLE();
1517 }
1506 } else if (opcode == kArm64TestAndBranch32) { 1518 } else if (opcode == kArm64TestAndBranch32) {
1507 switch (condition) { 1519 switch (condition) {
1508 case kEqual: 1520 case kEqual:
1509 __ Tbz(i.InputRegister32(0), i.InputInt5(1), tlabel); 1521 __ Tbz(i.InputRegister32(0), i.InputInt5(1), tlabel);
1510 break; 1522 break;
1511 case kNotEqual: 1523 case kNotEqual:
1512 __ Tbnz(i.InputRegister32(0), i.InputInt5(1), tlabel); 1524 __ Tbnz(i.InputRegister32(0), i.InputInt5(1), tlabel);
1513 break; 1525 break;
1514 default: 1526 default:
1515 UNREACHABLE(); 1527 UNREACHABLE();
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 padding_size -= kInstructionSize; 1917 padding_size -= kInstructionSize;
1906 } 1918 }
1907 } 1919 }
1908 } 1920 }
1909 1921
1910 #undef __ 1922 #undef __
1911 1923
1912 } // namespace compiler 1924 } // namespace compiler
1913 } // namespace internal 1925 } // namespace internal
1914 } // namespace v8 1926 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/bits.h ('k') | src/compiler/arm64/instruction-codes-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698