SPARC 汇编mov常量到寄存器

使用 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处理器)