vsli
Vector Shift Left and Insert
VSLI<c>.<size> <Qd>, <Qm>, #<imm>
Shifts bits left and inserts into destination (merging).
Details
Shifts each element in the source register left by the immediate shift amount and inserts the shifted bits into the low bits of the destination element, leaving the high bits of the destination unchanged (merging operation). The shift amount is unsigned. No condition flags are modified. This is a NEON instruction available in both A32 and T32 instruction sets.
Pseudocode Operation
for i = 0 to elements_in_Qd - 1
shift_amount ← imm6
shifted ← Qm[i] << shift_amount
mask ← (1 << shift_amount) - 1
Qd[i] ← (Qd[i] & ~mask) | (shifted & mask)
endfor
Example
VSLI.size q0, q2, #16
Encoding
Binary Layout
1111001
1
1
D
imm6
Vd
0101
L
1
M
1
Vm
Operands
-
Qd
Destination 128-bit SIMD register -
Qm
Second source 128-bit SIMD register -
imm
Signed immediate value
Reference (Arm AArch32 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0xF3800510 | VSLI{<c>}{<q>}.<size> {<Dd>,} <Dm>, #<imm> | A32 | 1111001 | 1 | 1 | D | imm6 | Vd | 0101 | L | 0 | M | 1 | Vm | ||
| 0xF3800550 | VSLI{<c>}{<q>}.<size> {<Qd>,} <Qm>, #<imm> | A32 | 1111001 | 1 | 1 | D | imm6 | Vd | 0101 | L | 1 | M | 1 | Vm | ||
| 0xFF800510 | VSLI{<c>}{<q>}.<size> {<Dd>,} <Dm>, #<imm> | T32 | 111 | 1 | 11111 | D | imm6 | Vd | 0101 | L | 0 | M | 1 | Vm | ||
| 0xFF800550 | VSLI{<c>}{<q>}.<size> {<Qd>,} <Qm>, #<imm> | T32 | 111 | 1 | 11111 | D | imm6 | Vd | 0101 | L | 1 | M | 1 | Vm |
Description
Vector Shift Left and Insert takes each element in the operand vector, left shifts them by an immediate value, and inserts the results in the destination vector. Bits shifted out of the left of each element are lost.
The elements must all be the same size, and can be 8-bit, 16-bit, 32-bit, or 64-bit. There is no distinction between data types.
Depending on settings in the CPACR, NSACR, and HCPTR registers, and the Security state and PE mode in which the instruction is executed, an attempt to execute the instruction might be undefined, or trapped to Hyp mode. For more information see Enabling Advanced SIMD and floating-point support.
Operation
if ConditionPassed() then
EncodingSpecificOperations(); CheckAdvSIMDEnabled();
mask = LSL(Ones(esize), shift_amount);
for r = 0 to regs-1
for e = 0 to elements-1
shifted_op = LSL(Elem[D[m+r],e,esize], shift_amount);
Elem[D[d+r],e,esize] = (Elem[D[d+r],e,esize] AND NOT(mask)) OR shifted_op;