Index: src/mips64/constants-mips64.cc |
diff --git a/src/mips64/constants-mips64.cc b/src/mips64/constants-mips64.cc |
index efabfe4f264c94f045386edd8a66874afd1b9380..c0e98eb623cbb9ea718d3fee221ac0c1e33eecd0 100644 |
--- a/src/mips64/constants-mips64.cc |
+++ b/src/mips64/constants-mips64.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, bnvc, 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; |
@@ -162,6 +166,17 @@ bool Instruction::IsForbiddenInBranchDelay() const { |
return false; |
} |
break; |
+ case COP1: |
+ switch (instr & kRsFieldMask) { |
+ case BC1: |
+ case BC1EQZ: |
+ case BC1NEZ: |
+ return true; |
+ break; |
+ default: |
+ return false; |
+ } |
+ break; |
default: |
return false; |
} |
@@ -169,8 +184,7 @@ bool Instruction::IsForbiddenInBranchDelay() const { |
bool Instruction::IsLinkingInstruction() const { |
- const int op = OpcodeFieldRaw(); |
- switch (op) { |
+ switch (OpcodeFieldRaw()) { |
case JAL: |
return true; |
case POP76: |