MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / i_imm

Function i_imm

crates/virtual-machine/src/cpu/decoder.rs:896–898  ·  view source on GitHub ↗

I-type immediate: bits[31:20], sign-extended to 64 bits.

(word: u32)

Source from the content-addressed store, hash-verified

894
895// I-type immediate: bits[31:20], sign-extended to 64 bits.
896fn 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.

Callers 1

decodeFunction · 0.85

Calls 2

sign_extFunction · 0.85
fieldFunction · 0.85

Tested by

no test coverage detected