MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / bits

Function bits

KittyMemoryEx/KittyAsm.cpp:13–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace KittyAsm
12{
13 uint32_t bits(uint32_t v, int hi, int lo)
14 {
15 if (hi < lo)
16 return 0u;
17
18 int width = hi - lo + 1;
19 if (width >= 32)
20 return v >> lo;
21
22 uint32_t mask = (width == 32) ? 0xFFFFFFFFu : ((1u << width) - 1u);
23 return (v >> lo) & mask;
24 }
25} // namespace KittyAsm
26
27using namespace KittyAsm;

Callers 3

decodeInsnTypeFunction · 0.85
decodeInsnFunction · 0.85
bitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected