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

Unified Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 697653002: [turbofan] Select tbz/tbnz when possible on ARM64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/arm64/instruction-codes-arm64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm64/code-generator-arm64.cc
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
index 38c6531c5f3a4f4a49efb136ebe347bc3e3a068a..544d9161975a01a84648f06ca8f9bb985f158e1f 100644
--- a/src/compiler/arm64/code-generator-arm64.cc
+++ b/src/compiler/arm64/code-generator-arm64.cc
@@ -170,7 +170,16 @@ class Arm64OperandConverter FINAL : public InstructionOperandConverter {
int64_t imm = i.InputOperand##width(1).immediate().value(); \
__ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0), imm); \
} \
- } while (0);
+ } while (0)
+
+
+#define ASSEMBLE_TEST_AND_BRANCH(asm_instr, width) \
+ do { \
+ bool fallthrough = IsNextInAssemblyOrder(i.InputRpo(3)); \
+ __ asm_instr(i.InputRegister##width(0), i.InputInt6(1), \
+ code_->GetLabel(i.InputRpo(2))); \
+ if (!fallthrough) __ B(code_->GetLabel(i.InputRpo(3))); \
+ } while (0)
// Assembles an instruction after register allocation, producing machine code.
@@ -418,6 +427,18 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ Ubfx(i.OutputRegister32(), i.InputRegister32(0), i.InputInt8(1),
i.InputInt8(2));
break;
+ case kArm64Tbz:
+ ASSEMBLE_TEST_AND_BRANCH(Tbz, 64);
+ break;
+ case kArm64Tbz32:
+ ASSEMBLE_TEST_AND_BRANCH(Tbz, 32);
+ break;
+ case kArm64Tbnz:
+ ASSEMBLE_TEST_AND_BRANCH(Tbnz, 64);
+ break;
+ case kArm64Tbnz32:
+ ASSEMBLE_TEST_AND_BRANCH(Tbnz, 32);
+ break;
case kArm64Claim: {
int words = MiscField::decode(instr->opcode());
__ Claim(words);
« no previous file with comments | « no previous file | src/compiler/arm64/instruction-codes-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698