PowerPC and the clrlslwi -or- rlwinm instruction

喜夏-厌秋 提交于 2020-01-07 02:28:26

问题


I've read the other posts here, but still have a question about PPC and rlwinm.

The example I'm looking at is:

li  r0, 0x100
clrlslwi  r9, r0, 27,5 (which afaik is the same as rlwinm r9, r0,5,22,26)

First I load r0 = 0x100 Then Left Shift r0 by 5 so r0 = 0x2000 (No overflow, so no rotate needed)

Make a Mask with bits 22 to 26 set = 0x3e0

AND r0 with the Mask = 0x2000 AND 0x3E0 = 0

I must be doing something wrong...this would always net 0 What am I missing?

来源:https://stackoverflow.com/questions/36657387/powerpc-and-the-clrlslwi-or-rlwinm-instruction

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!