Skip to content

Commit

Permalink
fix case OP_COND_EXC_C
Browse files Browse the repository at this point in the history
after OP_ADDCC
  • Loading branch information
Xinlong-Wu committed Dec 23, 2023
1 parent 61a99b9 commit 400052a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mono/mono/mini/mini-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3174,8 +3174,14 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb)

MonoInst *branch_ins = next_ins;
if (branch_ins) {
if (branch_ins->opcode == OP_COND_EXC_C || branch_ins->opcode == OP_COND_EXC_IC ||
branch_ins->opcode == OP_COND_EXC_OV || branch_ins->opcode == OP_COND_EXC_IOV) {
if (branch_ins->opcode == OP_COND_EXC_C || branch_ins->opcode == OP_COND_EXC_IC){
// bltu rd, rs1, overflow

branch_ins->opcode = OP_RISCV_EXC_BLTU;
branch_ins->sreg1 = ins->dreg;
branch_ins->sreg2 = ins->sreg1;
}
else if (branch_ins->opcode == OP_COND_EXC_OV || branch_ins->opcode == OP_COND_EXC_IOV) {
// bne t3, t4, overflow
branch_ins->opcode = OP_RISCV_EXC_BNE;
branch_ins->sreg1 = mono_alloc_ireg (cfg);
Expand Down

0 comments on commit 400052a

Please sign in to comment.