Skip to content

Commit

Permalink
process all unorder operattions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinlong-Wu committed Dec 24, 2023
1 parent 4e05963 commit 09eec19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mono/mono/mini/mini-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,9 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb)
case OP_RCOMPARE: {
if (next_ins) {
// insert two OP_RISCV_FBNAN in case unordered compare
if (next_ins->opcode != OP_FBEQ && next_ins->opcode != OP_FBNE_UN){
if (next_ins->opcode == OP_FBLT_UN || next_ins->opcode == OP_FBGT_UN ||
next_ins->opcode == OP_FBGE_UN || next_ins->opcode == OP_FBLE_UN ||
next_ins->opcode == OP_FBNE_UN){
NEW_INS_BEFORE(cfg, ins, temp, OP_RISCV_RBNAN);
temp->sreg1 = ins->sreg1;
temp->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2);
Expand Down Expand Up @@ -2645,7 +2647,9 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb)
}
case OP_FCOMPARE: {
if (next_ins) {
if (next_ins->opcode != OP_FBEQ && next_ins->opcode != OP_FBNE_UN){
if (next_ins->opcode == OP_FBLT_UN || next_ins->opcode == OP_FBGT_UN ||
next_ins->opcode == OP_FBGE_UN || next_ins->opcode == OP_FBLE_UN ||
next_ins->opcode == OP_FBNE_UN){
// insert two OP_RISCV_FBNAN in case unordered compare
NEW_INS_BEFORE(cfg, ins, temp, OP_RISCV_FBNAN);
temp->sreg1 = ins->sreg1;
Expand Down

0 comments on commit 09eec19

Please sign in to comment.