assemblyarmarm64armv8capstone

What does MSL do in the ARM instruction MOVI <Vd>.<T> #<imm8>, MSL #amount


I am confused about the operation MSL, which is used in a variant of the MOVI and MVNI instructions.

There's not a lot of information out there, but I have seen it referred to as "Masking Shift Left". Could anyone give an example of what a masking shift is? The instruction variant is also described as "shifting ones variant". I am not sure what this means either.

https://developer.arm.com/documentation/dui0801/c/A64-SIMD-Vector-Instructions/MOVI--vector-


Solution

  • Running movi v0.4s, #32, msl #8 through gdb shows v0 containing {0x20FF, 0x20FF, 0x20FF, 0x20FF}, implying that MSL shifts to the left but pads in with 1's rather than 0's

    In binary: 32 would be 00100000 shifting left 8 places padding in 1's gives 0010000011111111 which is 20FF in hex

    The same is true with a negative immediate, with movi v1.4s #-32, msl #8 giving {0xE0FF, 0xE0FF, 0xE0FF, 0xE0FF}