CTERMEQ, CTERMNE

Compare and terminate loop

Detect termination conditions in serialized vector loops. Tests whether the comparison between the scalar source operands holds true and if not tests the state of the !Last condition flag (C) which indicates whether the previous flag-setting predicate instruction selected the last element of the vector partition.

The Z and C condition flags are preserved by this instruction. The N and V condition flags are set as a pair to generate one of the following conditions for a subsequent conditional instruction:

* GE (N=0 & V=0): continue loop (compare failed and last element not selected);

* LT (N=0 & V=1): terminate loop (last element selected);

* LT (N=1 & V=0): terminate loop (compare succeeded);

The scalar source operands are 32-bit or 64-bit general-purpose registers of the same size.

It has encodings from 2 classes: Equal and Not equal

Equal

313029282726252423222120191817161514131211109876543210
001001011sz1Rm001000Rn00000
ne

CTERMEQ <R><n>, <R><m>

if !HaveSVE() && !HaveSME() then UNDEFINED; integer esize = 32 << UInt(sz); integer n = UInt(Rn); integer m = UInt(Rm); SVECmp op = Cmp_EQ;

Not equal

313029282726252423222120191817161514131211109876543210
001001011sz1Rm001000Rn10000
ne

CTERMNE <R><n>, <R><m>

if !HaveSVE() && !HaveSME() then UNDEFINED; integer esize = 32 << UInt(sz); integer n = UInt(Rn); integer m = UInt(Rm); SVECmp op = Cmp_NE;

Assembler Symbols

<R>

Is a width specifier, encoded in sz:

sz <R>
0 W
1 X
<n>

Is the number [0-30] of the source general-purpose register or the name ZR (31), encoded in the "Rn" field.

<m>

Is the number [0-30] of the source general-purpose register or the name ZR (31), encoded in the "Rm" field.

Operation

CheckSVEEnabled(); bits(esize) operand1 = X[n]; bits(esize) operand2 = X[m]; integer element1 = UInt(operand1); integer element2 = UInt(operand2); boolean term; case op of when Cmp_EQ term = element1 == element2; when Cmp_NE term = element1 != element2; if term then PSTATE.N = '1'; PSTATE.V = '0'; else PSTATE.N = '0'; PSTATE.V = (NOT PSTATE.C);

Operational information

If FEAT_SVE2 is enabled or FEAT_SME is enabled, then when PSTATE.DIT is 1:


Internal version only: isa v33.11seprel, AdvSIMD v29.05, pseudocode v2021-09_rel, sve v2021-09_rc3d ; Build timestamp: 2021-10-06T11:41

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