我在理解上有点困难rlwinm
PPC 汇编指令(旋转左字立即然后与掩码)。
我正在尝试反转函数的这一部分
rlwinm r3, r3, 0, 28, 28
我已经知道什么了r3
is. r3
在本例中是一个 4 字节整数,但我不确定这条指令到底是什么rlwinm
正在做它。
顺便说一句,这是在 32 位机器上。
你的理解不是quite正确的。根据IBM link https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.alangref/idalangref_rlwinm_rlinm_rtlwrdimm_instrs.htm在此说明中,您看到的表格是:
rlwinm <target=r3>, <source=r3>, <shift=0>, <begin-mask=28>, <end-mask=28>
Hence no actual shift is involved. And the actual mask used for the AND
operation is constructed from the begin
and end
mask positions, it's not given as an explicit argument(a).
在这种情况下,由于两个位置都是 28,因此掩码只是一个位,根据链接页面(稍微解释一下):
If the 开始掩码值小于end-mask值加一,则起点和终点之间(包括起点和终点)的掩码位设置为 1。所有其他位均设置为零。
所以你看到的指令并不比单个指令更复杂AND
手术。
(a) There is a form that allows you to specify the actual mask (assuming it consists of contiguous one-bits) but it's the four-argument version and really just syntactic sugar that the assembler can turn into the five-argument one.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)