在手册的C3.3.9章节里面介绍。
LSL Logical shift left LSL (immediate) on page C6-995
打开配套链接=>C6.2.166 LSL (immediate)
提示该指令类似于一个助记符,实际指令是UBFM
LSL <Wd>, <Wn>, #<shift>
is equivalent to
UBFM <Wd>, <Wn>, #(-<shift> MOD 32), #(31-<shift>)
and is the preferred disassembly when imms + 1 == immr.
那么我们再继续研究 UBFM指令=>C6.2.310 UBFM
该指令实际是无符号数的位域移动指令。
看懂了UBFM之后,我们采用特殊值法分析LSL。
我们假设shift == 26
那么 r = (-<shift> MOD 32) = ((-26 + 32) MOD 32) = 6
s = (31-<shift>) = (31 - 26) = 5
指令退化成 UBFM <Wd>, <Wn>, #6, #5
由于 s <= r, 所以如下规则生效:
If <imms> is less than <immr>, this copies a bitfield of (<imms>+1) bits from the least significant bits of the source register to bit position (regsize-<immr>) of the destination register, where regsize is the destination register size of 32 or 64 bits.
也就是 拷贝 Wn的[5:0]位域到Wd的[26:31]
其中, 5是由 imms + 1 == 6共6个位域得来; 26是由32 - 6 == 26得来
参考文档《armv8-芯片手册_arm_v8.4.pdf》