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: |