Skip to content

Commit

Permalink
correctly sign extend immediates
Browse files Browse the repository at this point in the history
  • Loading branch information
sgpthomas committed May 23, 2024
1 parent d9df89f commit fd7c2d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main.futil
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ component main(@go go: 1) -> (@done done: 1) {
curr_rs1 = std_reg(32);
curr_rs2 = std_reg(32);
curr_imm_cat = std_cat(7, 5, 13);
// TODO: padding isn't correct for immediates, we need to sign extend
curr_imm = std_pad(13, 32);
curr_imm = std_sign_extend(13, 32);
btype_immediate = btype_immediate();
jtype_immediate = jtype_immediate();
j_retval_incr = std_add(32);
Expand Down

0 comments on commit fd7c2d6

Please sign in to comment.