uzp1

SVE Unzip 1

UZP1 <Zd>.<T>, <Zn>.<T>, <Zm>.<T>

Selects even elements from concatenated vectors.

Details

SVE Unzip 1 deinterlaces the concatenation of Zn and Zm by selecting even-indexed elements (0, 2, 4, ...) and packing them into Zd. This is the inverse of a zip/transpose operation. This is an unpredicated operation. No condition flags are affected. This is an AArch64-only SVE instruction requiring SVE support.

Pseudocode Operation

integer esize = 8 << UInt(sz);
integer elements = VL / esize;
for e = 0 to elements-1
  integer src_index = 2 * e;
  if src_index < elements then
    Zd[e * esize +: esize] = Zn[src_index * esize +: esize];
  else
    Zd[e * esize +: esize] = Zm[(src_index - elements) * esize +: esize];

Example

UZP1 z0.s.T, z1.s.T, z2.s.T

Encoding

Binary Layout
00000101
size
1
Zm
011
01
0
Zn
Zd
 
Format SVE Permute
Opcode 0x05206800
Extension SVE

Operands

  • Zd
    Destination scalable vector register (SVE)
  • Zn
    First source scalable vector register (SVE)
  • Zm
    Second source scalable vector register (SVE)

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x0E001800 UZP1 <Vd>.<T>, <Vn>.<T>, <Vm>.<T> A64 0 | Q | 001110 | size | 0 | Rm | 0 | 0 | 0110 | Rn | Rd
0x05204800 UZP1 <Pd>.<T>, <Pn>.<T>, <Pm>.<T> A64 00000101 | size | 10 | Pm | 010 | 0 | 1 | 0 | 0 | Pn | 0 | Pd
0x05206800 UZP1 <Zd>.<T>, <Zn>.<T>, <Zm>.<T> A64 00000101 | size | 1 | Zm | 011 | 01 | 0 | Zn | Zd
0x05A00800 UZP1 <Zd>.Q, <Zn>.Q, <Zm>.Q A64 00000101101 | Zm | 000 | 0 | 1 | 0 | Zn | Zd

Description

Concatenate adjacent even or odd-numbered elements from the first and second source vectors and place in elements of the destination vector. This instruction is unpredicated. Note: UZP1 is equivalent to truncating and packing each element from two source vectors into a single destination vector with elements of half the size. The 128-bit element variant requires that the Effective SVE vector length is at least 256 bits. ID_AA64ZFR0_EL1.F64MM indicates whether the 128-bit element variant is implemented. The 128-bit element variant is illegal when executed in Streaming SVE mode, unless FEAT_SME_FA64 is implemented and enabled.

Operation

if esize < 128 then CheckSVEEnabled(); else CheckNonStreamingSVEEnabled();
constant integer VL = CurrentVL;
if VL < esize * 2 then UNDEFINED;
constant integer pairs = VL DIV (esize * 2);
bits(VL) operand1 = Z[n, VL];
bits(VL) operand2 = Z[m, VL];
bits(VL) result = Zeros(VL);

for p = 0 to pairs - 1
    Elem[result, p, esize] = Elem[operand1, 2*p+part, esize];

for p = 0 to pairs - 1
    Elem[result, pairs+p, esize] = Elem[operand2, 2*p+part, esize];

Z[d, VL] = result;