So I finally convinced myself to try and learn/use PowerPC (PPC). Everything is going well and most information was found online. However, when looking at some examples I came across this:
rlwinm r3, r3, 0,1,1
How would I do this in C? I tried doing some research, but couldn't find anything that helped me out. Thanks in advance!
rlwinm
stands for "Rotate Left Word Immediate then aNd with Mask, and it's correct usage isAs per the description page:
And
So in your example the source and target are the same. Shift amount is
0
, so no shift. AndMB=ME=1
, so the first case applies, such that the mask becomes all zeros with bit number 1 as1
, while numbering fromMSB=0
:0x40000000
.In C we can write it as simple as
assuming
a
is 32-bit variable.