MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / getBits64

Function getBits64

pcsx2/IPU/IPU_MultiISA.cpp:124–145  ·  view source on GitHub ↗

whenever reading fractions of bytes. The low bits always come from the next byte while the high bits come from the current byte

Source from the content-addressed store, hash-verified

122// whenever reading fractions of bytes. The low bits always come from the next byte
123// while the high bits come from the current byte
124__ri static u8 getBits64(u8 *address, bool advance)
125{
126 if (!g_BP.FillBuffer(64)) return 0;
127
128 const u8* readpos = &g_BP.internal_qwc[0]._u8[g_BP.BP/8];
129
130 if (uint shift = (g_BP.BP & 7))
131 {
132 u64 mask = (0xff >> shift);
133 mask = mask | (mask << 8) | (mask << 16) | (mask << 24) | (mask << 32) | (mask << 40) | (mask << 48) | (mask << 56);
134
135 *(u64*)address = ((~mask & *(u64*)(readpos + 1)) >> (8 - shift)) | (((mask) & *(u64*)readpos) << shift);
136 }
137 else
138 {
139 *(u64*)address = *(u64*)readpos;
140 }
141
142 if (advance) g_BP.Advance(64);
143
144 return 1;
145}
146
147// whenever reading fractions of bytes. The low bits always come from the next byte
148// while the high bits come from the current byte

Callers 4

ipuSETIQFunction · 0.85
ipuSETVQFunction · 0.85
ipuCSCFunction · 0.85
ipuPACKFunction · 0.85

Calls 2

FillBufferMethod · 0.80
AdvanceMethod · 0.45

Tested by

no test coverage detected