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

Function b_imm

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

B-type immediate: [31]<<12 | [7]<<11 | [30:25]<<5 | [11:8]<<1, sign-extended to 13 bits.

(word: u32)

Source from the content-addressed store, hash-verified

912fn j_imm(word: u32) -> i64 {
913 let bit20 = field(word, 31, 31) << 20;
914 let bits19_12 = field(word, 19, 12) << 12;
915 let bit11 = field(word, 20, 20) << 11;
916 let bits10_1 = field(word, 30, 21) << 1;
917 sign_ext(bit20 | bits19_12 | bit11 | bits10_1, 21)
918}

Callers 1

decodeFunction · 0.85

Calls 2

fieldFunction · 0.85
sign_extFunction · 0.85

Tested by

no test coverage detected