VREV16

Vector Reverse in halfwords reverses the order of 8-bit elements in each halfword of the vector, and places the result in the corresponding destination vector.

There is no distinction between data types, other than size.

The following figure shows an example of the operation of VREV16 doubleword operation.
VREV16 doubleword operation

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

313029282726252423222120191817161514131211109876543210
111100111D11size00Vd00010QM0Vm
op

64-bit SIMD vector (Q == 0)

VREV16{<c>}{<q>}.<dt> <Dd>, <Dm>

128-bit SIMD vector (Q == 1)

VREV16{<c>}{<q>}.<dt> <Qd>, <Qm>

if UInt(op)+UInt(size) >= 3 then UNDEFINED; if Q == '1' && (Vd<0> == '1' || Vm<0> == '1') then UNDEFINED; constant esize = 8 << UInt(size); integer container_size; case op of when '10' container_size = 16; when '01' container_size = 32; when '00' container_size = 64; constant integer containers = 64 DIV container_size; constant integer elements_per_container = container_size DIV esize; constant d = UInt(D:Vd); constant m = UInt(M:Vm); constant regs = if Q == '0' then 1 else 2;

T1

15141312111098765432101514131211109876543210
111111111D11size00Vd00010QM0Vm
op

64-bit SIMD vector (Q == 0)

VREV16{<c>}{<q>}.<dt> <Dd>, <Dm>

128-bit SIMD vector (Q == 1)

VREV16{<c>}{<q>}.<dt> <Qd>, <Qm>

if UInt(op)+UInt(size) >= 3 then UNDEFINED; if Q == '1' && (Vd<0> == '1' || Vm<0> == '1') then UNDEFINED; constant esize = 8 << UInt(size); integer container_size; case op of when '10' container_size = 16; when '01' container_size = 32; when '00' container_size = 64; constant integer containers = 64 DIV container_size; constant integer elements_per_container = container_size DIV esize; constant d = UInt(D:Vd); constant m = UInt(M:Vm); constant regs = if Q == '0' then 1 else 2;

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>

See Standard assembler syntax fields.

<dt>

Is the data type for the elements of the operand, encoded in size:

size <dt>
00 8
01 RESERVED
1x RESERVED
<Qd>

Is the 128-bit name of the SIMD&FP destination register, encoded in the "D:Vd" field as <Qd>*2.

<Qm>

Is the 128-bit name of the SIMD&FP source register, encoded in the "M:Vm" field as <Qm>*2.

<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, encoded in the "M:Vm" field.

Operation

if ConditionPassed() then EncodingSpecificOperations(); CheckAdvSIMDEnabled(); bits(64) result; integer element; integer rev_element; for r = 0 to regs-1 element = 0; for c = 0 to containers-1 rev_element = (element + elements_per_container) - 1; for e = 0 to elements_per_container-1 Elem[result, rev_element, esize] = Elem[D[m+r], element, esize]; element = element + 1; rev_element = rev_element - 1; D[d+r] = result;

Operational information

If CPSR.DIT is 1 and this instruction passes its condition execution check:


Internal version only: isa v01_31, pseudocode v2024-03_rel ; Build timestamp: 2024-03-25T10:05

Copyright © 2010-2024 Arm Limited or its affiliates. All rights reserved. This document is Non-Confidential.