Skip to content

Commit

Permalink
Add missing ZEXT.H to binary translation
Browse files Browse the repository at this point in the history
  • Loading branch information
fwsGonzo committed Oct 22, 2023
1 parent 00defac commit 3c1856a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/libriscv/tr_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,9 @@ void CPU<W>::emit(std::string& code, const std::string& func, TransInstr<W>* ip,
case 0x40: // ADD.UW
add_code(code, dst + " = " + from_reg(tinfo, instr.Rtype.rs2) + " + " + src1 + ";");
break;
case 0x44: // ZEXT.H (imm=0x40):
add_code(code, dst + " = (uint16_t)(" + src1 + ");");
break;
case 0x102: // SH1ADD.UW
add_code(code, dst + " = " + from_reg(tinfo, instr.Rtype.rs2) + " + (" + src1 + " << 1);");
break;
Expand Down

0 comments on commit 3c1856a

Please sign in to comment.