Index: src/mips64/assembler-mips64.cc |
diff --git a/src/mips64/assembler-mips64.cc b/src/mips64/assembler-mips64.cc |
index fbb0a612fc10956fa93f02451f384274a2d31fd1..4c1235e80c49a9256322e80d5e4781f32196c0c9 100644 |
--- a/src/mips64/assembler-mips64.cc |
+++ b/src/mips64/assembler-mips64.cc |
@@ -1372,17 +1372,21 @@ void Assembler::bne(Register rs, Register rt, int16_t offset) { |
void Assembler::bovc(Register rs, Register rt, int16_t offset) { |
DCHECK(kArchVariant == kMips64r6); |
- DCHECK(!(rs.is(zero_reg))); |
- DCHECK(rs.code() >= rt.code()); |
- GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); |
+ if (rs.code() >= rt.code()) { |
+ GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); |
+ } else { |
+ GenInstrImmediate(ADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH); |
+ } |
} |
void Assembler::bnvc(Register rs, Register rt, int16_t offset) { |
DCHECK(kArchVariant == kMips64r6); |
- DCHECK(!(rs.is(zero_reg))); |
- DCHECK(rs.code() >= rt.code()); |
- GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); |
+ if (rs.code() >= rt.code()) { |
+ GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); |
+ } else { |
+ GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH); |
+ } |
} |