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

Unified Diff: src/mips/constants-mips.cc

Issue 1396133002: MIPS: r6 compact branch optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/constants-mips.h ('k') | src/mips/disasm-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/constants-mips.cc
diff --git a/src/mips/constants-mips.cc b/src/mips/constants-mips.cc
index ff8a79f1b2246870e4ec1e221f965c2deff05aa0..1b23ed3b5fa2a63bd800a07d042ffb075b036c6b 100644
--- a/src/mips/constants-mips.cc
+++ b/src/mips/constants-mips.cc
@@ -126,24 +126,28 @@ int FPURegisters::Number(const char* name) {
// -----------------------------------------------------------------------------
// Instructions.
-bool Instruction::IsForbiddenInBranchDelay() const {
- const int op = OpcodeFieldRaw();
- switch (op) {
+bool Instruction::IsForbiddenAfterBranchInstr(Instr instr) {
+ Opcode opcode = static_cast<Opcode>(instr & kOpcodeMask);
+ switch (opcode) {
case J:
case JAL:
case BEQ:
case BNE:
- case BLEZ:
- case BGTZ:
+ case BLEZ: // POP06 bgeuc/bleuc, blezalc, bgezalc
+ case BGTZ: // POP07 bltuc/bgtuc, bgtzalc, bltzalc
case BEQL:
case BNEL:
- case BLEZL:
- case BGTZL:
+ case BLEZL: // POP26 bgezc, blezc, bgec/blec
+ case BGTZL: // POP27 bgtzc, bltzc, bltc/bgtc
case BC:
case BALC:
+ case POP10: // beqzalc, bovc, beqc
+ case POP30: // bnezalc, bvnc, bnec
+ case POP66: // beqzc, jic
+ case POP76: // bnezc, jialc
return true;
case REGIMM:
- switch (RtFieldRaw()) {
+ switch (instr & kRtFieldMask) {
case BLTZ:
case BGEZ:
case BLTZAL:
@@ -154,7 +158,7 @@ bool Instruction::IsForbiddenInBranchDelay() const {
}
break;
case SPECIAL:
- switch (FunctionFieldRaw()) {
+ switch (instr & kFunctionFieldMask) {
case JR:
case JALR:
return true;
@@ -169,8 +173,7 @@ bool Instruction::IsForbiddenInBranchDelay() const {
bool Instruction::IsLinkingInstruction() const {
- const int op = OpcodeFieldRaw();
- switch (op) {
+ switch (OpcodeFieldRaw()) {
case JAL:
return true;
case POP76:
« no previous file with comments | « src/mips/constants-mips.h ('k') | src/mips/disasm-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698