使用 mov const,%r1 只能将13位以下的常量加载到r1寄存器
装载32位常量到寄存器
sethi %hi(const),%r1
or %r1,%lo(const),%r1
装载64位常量到寄存器
sethi %uhi(const), %rtmp
or %rtmp,%ulo(const),%rtmp
sllx %rtmp,32,%rtmp
sethi %hi(const),%r
or %r,%lo(const),%r
or $rtmp,%r,%r
RISC是这么坑人的吗?
本文介绍了如何在SPARC汇编中将不同大小的常量加载到寄存器,包括13位以下、32位和64位常量的加载方法,涉及到sethi、or指令的使用。同时也表达了对于RISC指令集这种做法的疑问。
1万+

被折叠的 条评论
为什么被折叠?



