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

Function field

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

Extract bits [hi..lo] (inclusive) from `word`.

(word: u32, hi: u32, lo: u32)

Source from the content-addressed store, hash-verified

857
858// Extract bits [hi..lo] (inclusive) from `word`.
859fn field(word: u32, hi: u32, lo: u32) -> u32 {
860 let width = hi - lo + 1;
861 if width >= 32 {
862 word
863 } else {
864 (word >> lo) & ((1u32 << width) - 1)
865 }
866}
867
868#[inline]
869fn rd(word: u32) -> usize {

Callers 15

loadMethod · 0.85
capture_traceFunction · 0.85
decodeFunction · 0.85
decode_fenceFunction · 0.85
decode_systemFunction · 0.85
fmacFunction · 0.85
rdFunction · 0.85
rs1Function · 0.85
rs2Function · 0.85
funct3Function · 0.85
funct7Function · 0.85
i_immFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected