一切进展顺利,大多数信息都是在网上找到的.
但是,在查看一些示例时,我发现了这个:
rlwinm r3,r3,1,1
我怎么用C做这个?
我尝试做一些研究,但找不到任何帮助我的东西.
提前致谢!
rlwinm RA,RS,SH,MB,ME
根据description page:
RA SpecifIEs target general-purpose register where result of operation is stored. RS SpecifIEs source general-purpose register for operation. SH SpecifIEs shift value for operation. MB SpecifIEs begin value of mask for operation. ME SpecifIEs end value of mask for operation. BM SpecifIEs value of 32-bit mask.
和
If the MB value is less than the ME value + 1,then the mask bits
between and including the starting point and the end point are set to
ones. All other bits are set to zeros. If the MB value is the same as
the ME value + 1,then all 32 mask bits are set to ones. If the MB value is greater than the ME value + 1,then all of the mask bits
between and including the ME value +1 and the MB value -1 are set to
zeros. All other bits are set to ones.
因此在您的示例中,源和目标是相同的.移位量为0,因此没有移位.并且MB = ME = 1,因此第一种情况适用,使得掩码变为全为0,位号1为1,而编号从MSB = 0:0x40000000.
在C中我们可以像写一样简单
a &= 0x40000000;
假设a是32位变量.
总结以上是内存溢出为你收集整理的了解PowerPC rlwinm指令全部内容,希望文章能够帮你解决了解PowerPC rlwinm指令所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)