smaxp
SMAXP <Zdn>.<T>, <Pg>/M, <Zdn>.<T>, <Zm>.<T>
Signed Maximum Pairwise.
Pseudocode Operation
No pseudocode available.
Encoding
Binary Layout
01000100
31:24
size
23:22
010
21:19
1
18
0
17
0
16
101
15:13
Pg
12:10
Zm
9:5
Zdn
4:0
Related
More in SVE2
Reference
View in Arm A64 ISA Reference ↗
Arm A64 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x0E20A400 | SMAXP <Vd>.<T>, <Vn>.<T>, <Vm>.<T> | A64 | 0 | Q | 0 | 01110 | size | 1 | Rm | 1010 | 0 | 1 | Rn | Rd | ||
| 0x4414A000 | SMAXP <Zdn>.<T>, <Pg>/M, <Zdn>.<T>, <Zm>.<T> | A64 | 01000100 | size | 010 | 1 | 0 | 0 | 101 | Pg | Zm | Zdn |
Description
Compute the maximum value of each pair of adjacent signed integer elements within each source vector, and interleave the results from corresponding lanes. The interleaved result values are destructively placed in the first source vector.
Operation
CheckSVEEnabled();
constant integer VL = CurrentVL;
constant integer PL = VL DIV 8;
constant integer elements = VL DIV esize;
bits(PL) mask = P[g, PL];
bits(VL) operand1 = Z[dn, VL];
bits(VL) operand2 = if AnyActiveElement(mask, esize) then Z[m, VL] else Zeros(VL);
bits(VL) result;
integer element1;
integer element2;
for e = 0 to elements-1
if !ActivePredicateElement(mask, e, esize) then
Elem[result, e, esize] = Elem[operand1, e, esize];
else
if IsEven(e) then
element1 = SInt(Elem[operand1, e + 0, esize]);
element2 = SInt(Elem[operand1, e + 1, esize]);
else
element1 = SInt(Elem[operand2, e - 1, esize]);
element2 = SInt(Elem[operand2, e + 0, esize]);
integer res = Max(element1, element2);
Elem[result, e, esize] = res<esize-1:0>;
Z[dn, VL] = result;