PowerPC - Trying to understand the rlwinm instruction
#9
rlwinm r3, r12, 5, 15, 16

r12 = 0x80000004 before the instruction is executed. result will go into r3 ofc.

--

1: Rotate 0x80000004 counter clockwise by 5 bits

Before rotation: 1000 0000 0000 0000 0000 0000 0000 0100
After rotation: 0000 0000 0000 0000 0000 0000 1001 0000
Temporary rotated value is 0x00000090

2. 15,16 = AND mask of 0000 0000 0000 0001 1000 0000 0000 0000
The MB and ME marks which bits are high in the ANDing mask

3. 0x00000090 AND'd with 0x00018000 = 0x00000000

4. r3 = 0

Apologies for any more typos, in a rush multitasking with other things atm
Reply


Messages In This Thread
RE: PowerPC - Trying to understand the rlwinm instruction - by Vega - 06-26-2021, 10:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)