VTBL, VTBX
Vector Table Lookup uses byte indexes in a control vector to look up byte values in a table and generate a new vector. Indexes out of range return 0.
Vector Table Extension works in the same way, except that indexes out of range leave the destination element unchanged.
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.
It has encodings from the following instruction sets: A32 ( A1 ) and T32 ( T1 ) .
A1
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | D | 1 | 1 | Vn | Vd | 1 | 0 | len | N | op | M | 0 | Vm |
is_vtbl = (op == '0'); length = UInt(len)+1; d = UInt(D:Vd); n = UInt(N:Vn); m = UInt(M:Vm); if n+length > 32 then UNPREDICTABLE;
CONSTRAINED UNPREDICTABLE behavior
If n + length > 32, then one of the following behaviors must occur:
- The instruction is undefined.
- The instruction executes as NOP.
- One or more of the SIMD and floating-point registers are unknown. This behavior does not affect any general-purpose registers.
T1
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | D | 1 | 1 | Vn | Vd | 1 | 0 | len | N | op | M | 0 | Vm |
is_vtbl = (op == '0'); length = UInt(len)+1; d = UInt(D:Vd); n = UInt(N:Vn); m = UInt(M:Vm); if n+length > 32 then UNPREDICTABLE;
CONSTRAINED UNPREDICTABLE behavior
If n + length > 32, then one of the following behaviors must occur:
- The instruction is undefined.
- The instruction executes as NOP.
- One or more of the SIMD and floating-point registers are unknown. This behavior does not affect any general-purpose registers.
For more information about the constrained unpredictable behavior of this instruction, see Architectural Constraints on UNPREDICTABLE behaviors.
Assembler Symbols
<c> |
For encoding A1: see Standard assembler syntax fields. This encoding must be unconditional. |
For encoding T1: see Standard assembler syntax fields. |
<q> |
<Dd> |
Is the 64-bit name of the SIMD&FP destination register, encoded in the "D:Vd" field. |
<Dm> |
Is the 64-bit name of the SIMD&FP source register holding the indices, encoded in the "M:Vm" field. |
Operation
if ConditionPassed() then EncodingSpecificOperations(); CheckAdvSIMDEnabled(); // Create 256-bit = 32-byte table variable, with zeros in entries that will not be used. table3 = if length == 4 then D[n+3] else Zeros(64); table2 = if length >= 3 then D[n+2] else Zeros(64); table1 = if length >= 2 then D[n+1] else Zeros(64); table = table3 : table2 : table1 : D[n]; for i = 0 to 7 index = UInt(Elem[D[m],i,8]); if index < 8*length then Elem[D[d],i,8] = Elem[table,index,8]; else if is_vtbl then Elem[D[d],i,8] = Zeros(8); // else Elem[D[d],i,8] unchanged
Operational information
If CPSR.DIT is 1 and this instruction passes its condition execution check:
- The execution time of this instruction is independent of:
- The values of the data supplied in any of its registers.
- The values of the NZCV flags.
- The response of this instruction to asynchronous exceptions does not vary based on:
- The values of the data supplied in any of its registers.
- The values of the NZCV flags.