Skip to content

Commit 0c423af

Browse files
authored
[RISC-V] Fix emitOutputInstr (#86078)
- Fix to use instruction code not INS_
1 parent a5d13e2 commit 0c423af

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/coreclr/jit/emitriscv64.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,9 +2447,9 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
24472447
else
24482448
{
24492449
assert((-0x100000 <= imm) && (imm < 0x100000));
2450-
assert((INS_bne & 0xefff) == INS_beq);
2450+
assert((emitInsCode(INS_bne) & 0xefff) == emitInsCode(INS_beq));
24512451

2452-
code = emitInsCode((instruction)((int)ins ^ 0x1000));
2452+
code = emitInsCode(ins) ^ 0x1000;
24532453
code |= (code_t)reg1 << 15; /* rj */
24542454
code |= (code_t)reg2 << 20; /* rd */
24552455
code |= 0x8 << 7;
@@ -2469,10 +2469,10 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
24692469
else if ((INS_blt <= ins) && (ins <= INS_bgeu))
24702470
{
24712471
assert((-0x100000 <= imm) && (imm < 0x100000));
2472-
assert((INS_bge & 0xefff) == INS_blt);
2473-
assert((INS_bgeu & 0xefff) == INS_bltu);
2472+
assert((emitInsCode(INS_bge) & 0xefff) == emitInsCode(INS_blt));
2473+
assert((emitInsCode(INS_bgeu) & 0xefff) == emitInsCode(INS_bltu));
24742474

2475-
code = emitInsCode((instruction)((int)ins ^ 0x1000));
2475+
code = emitInsCode(ins) ^ 0x1000;
24762476
code |= (code_t)reg1 << 15; /* rj */
24772477
code |= (code_t)reg2 << 20; /* rd */
24782478
code |= 0x8 << 7;

0 commit comments

Comments
 (0)