MATCH

Detect any matching elements, setting the condition flags

This instruction compares each active 8-bit or 16-bit character in the first source vector with all of the characters in the corresponding 128-bit segment of the second source vector. Where the first source element detects any matching characters in the second segment it places true in the corresponding element of the destination predicate, otherwise false. Inactive elements in the destination predicate register are set to zero. This instruction sets the First (N), None (Z), and !Last (C) condition flags based on the predicate result, and sets the V flag to zero.

This instruction is illegal when executed in Streaming SVE mode, unless FEAT_SME_FA64 is implemented and enabled.

SVE2
(FEAT_SVE2)

313029282726252423222120191817161514131211109876543210
01000101size1Zm100PgZn0Pd
op

Encoding

MATCH <Pd>.<T>, <Pg>/Z, <Zn>.<T>, <Zm>.<T>

Decode for this encoding

if !IsFeatureImplemented(FEAT_SVE2) then EndOfDecode(Decode_UNDEF); end; if size IN {'1x'} then EndOfDecode(Decode_UNDEF); end; let esize : integer{} = 8 << UInt(size); let g : integer = UInt(Pg); let d : integer = UInt(Pd); let n : integer = UInt(Zn); let m : integer = UInt(Zm);

Assembler Symbols

<Pd>

Is the name of the destination scalable predicate register, encoded in the "Pd" field.

<T>

Is the size specifier, encoded in size[0]:

size[0] <T>
0 B
1 H
<Pg>

Is the name of the governing scalable predicate register P0-P7, encoded in the "Pg" field.

<Zn>

Is the name of the first source scalable vector register, encoded in the "Zn" field.

<Zm>

Is the name of the second source scalable vector register, encoded in the "Zm" field.

Operation

CheckNonStreamingSVEEnabled(); let VL : integer{} = CurrentVL(); let PL : integer{} = VL DIV 8; let elements : integer = VL DIV esize; let eltspersegment : integer = 128 DIV esize; let mask : bits(PL) = P{}(g); let operand1 : bits(VL) = if AnyActiveElement{PL}(mask, esize) then Z{VL}(n) else Zeros{VL}; let operand2 : bits(VL) = if AnyActiveElement{PL}(mask, esize) then Z{VL}(m) else Zeros{VL}; var result : bits(PL); let psize : integer{} = esize DIV 8; for e = 0 to elements-1 do if ActivePredicateElement{PL}(mask, e, esize) then let segmentbase : integer = e - (e MOD eltspersegment); result[e*:psize] = ZeroExtend{psize}('0'); let element1 : bits(esize) = operand1[e*:esize]; for i = segmentbase to (segmentbase + eltspersegment) - 1 do let element2 : bits(esize) = operand2[i*:esize]; if element1 == element2 then result[e*:psize] = ZeroExtend{psize}('1'); end; end; else result[e*:psize] = ZeroExtend{psize}('0'); end; end; PSTATE.[N,Z,C,V] = PredTest{PL}(mask, result, esize); P{PL}(d) = result;


2025-12_rel 2025-12-10 16:41:45

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