PER ARM'S REQUEST, THIS SITE WILL BE DISCONTINUED ON 4 DECEMBER 2026. :(

Arm's lawyers have notified me to take down this site or face legal action.

To all of the fans of this site over the years (even the ones at Arm): thank you for your support! I'm glad I could provide a resource so many people found value in. I will look into solutions that can potentially keep bookmarks and links working.

— Jon

← Home

MATCH

Detect any matching elements within quadwords, setting the condition flags

This instruction compares each Active 8-bit or 16-bit element in the first source vector with all of the elements in the corresponding 128-bit segment of the second source vector. For each element in the first source vector, if any matching element is found in the corresponding segment of the second source vector, the corresponding element of the destination predicate is set to true, otherwise it is set to 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 class

(FEAT_SVE2)

313029282726252423222120191817161514131211109876543210
010001010sz1Zm100PgZn0Pd
op

Encoding

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

Decode

if !IsFeatureImplemented(FEAT_SVE2) then EndOfDecode(Decode_UNDEF); end; let esize : integer{} = 8 << UInt(sz); 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 sz:

sz <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;


Version 2026.09 — Copyright © 2010-2026 Arm Limited or its affiliates.

This site is provided as a community resource and is NOT affiliated with nor endorsed by Arm Limited.