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:
Condition N V Meaning GE 0 0 Continue loop (compare failed and last element not selected) LT 0 1 Terminate loop (last element selected) LT 1 0 Terminate loop (compare succeeded) GE 1 1 Never generated
The scalar source operands are 32-bit or 64-bit general-purpose registers of the same size.
Variants: FEAT_SVE || FEAT_SME (FEAT_SVE || FEAT_SME)
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 |
0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||
op | sz | Rm | Rn | ne |
---|
if !IsFeatureImplemented(FEAT_SVE) && !IsFeatureImplemented(FEAT_SME) then EndOfDecode(Decode_UNDEF); constant integer esize = 32 << UInt(sz); constant integer n = UInt(Rn); constant integer m = UInt(Rm); constant CmpOp cmp_op = Cmp_EQ;
Variants: FEAT_SVE || FEAT_SME (FEAT_SVE || FEAT_SME)
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 |
0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | |||||||||||
op | sz | Rm | Rn | ne |
---|
if !IsFeatureImplemented(FEAT_SVE) && !IsFeatureImplemented(FEAT_SME) then EndOfDecode(Decode_UNDEF); constant integer esize = 32 << UInt(sz); constant integer n = UInt(Rn); constant integer m = UInt(Rm); constant CmpOp cmp_op = Cmp_NE;
CheckSVEEnabled(); constant bits(esize) operand1 = X[n, esize]; constant bits(esize) operand2 = X[m, esize]; constant integer element1 = UInt(operand1); constant integer element2 = UInt(operand2); boolean term; case cmp_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);
If PSTATE.DIT is 1: