I-type immediate: bits[31:20], sign-extended to 64 bits.
(word: u32)
| 894 | |
| 895 | // I-type immediate: bits[31:20], sign-extended to 64 bits. |
| 896 | fn i_imm(word: u32) -> i64 { |
| 897 | sign_ext(field(word, 31, 20), 12) |
| 898 | } |
| 899 | |
| 900 | // U-type immediate: upper 20 bits placed at [31:12], lower 12 bits zero. |
| 901 | // We sign-extend from the 32-bit word so that large addresses work correctly. |