uqadd

UQADD <Zd>.<T>, <Zn>.<T>, <Zm>.<T>

Unsigned Saturating Add.

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
00000100
31:24
size
23:22
1
21
Zm
20:16
000
15:13
10
12:11
1
10
Zn
9:5
Zd
4:0
 
Format SVE2
Opcode 0x04201400
Extension SVE2

Related

Other forms of uqadd

  • uqadd Vector Unsigned Saturating Add

More in SVE2

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x7E200C00 UQADD <V><d>, <V><n>, <V><m> A64 01 | 1 | 11110 | size | 1 | Rm | 00001 | 1 | Rn | Rd
0x2E200C00 UQADD <Vd>.<T>, <Vn>.<T>, <Vm>.<T> A64 0 | Q | 1 | 01110 | size | 1 | Rm | 00001 | 1 | Rn | Rd
0x44198000 UQADD <Zdn>.<T>, <Pg>/M, <Zdn>.<T>, <Zm>.<T> A64 01000100 | size | 011 | 0 | 0 | 1 | 100 | Pg | Zm | Zdn
0x2525C000 UQADD <Zdn>.<T>, <Zdn>.<T>, #<imm>{, <shift>} A64 00100101 | size | 100 | 10 | 1 | 11 | sh | imm8 | Zdn
0x04201400 UQADD <Zd>.<T>, <Zn>.<T>, <Zm>.<T> A64 00000100 | size | 1 | Zm | 000 | 10 | 1 | Zn | Zd

Description

Unsigned saturating add all elements of the second source vector to corresponding elements of the first source vector and place the results in the corresponding elements of the destination vector. Each result element is saturated to the N-bit element's unsigned integer range 0 to (2N)-1. This instruction is unpredicated.

Operation

CheckSVEEnabled();
constant integer VL = CurrentVL;
constant integer elements = VL DIV esize;
bits(VL) operand1 = Z[n, VL];
bits(VL) operand2 = Z[m, VL];
bits(VL) result;

for e = 0 to elements-1
    integer element1 = Int(Elem[operand1, e, esize], unsigned);
    integer element2 = Int(Elem[operand2, e, esize], unsigned);
    (Elem[result, e, esize], -) = SatQ(element1 + element2, esize, unsigned);

Z[d, VL] = result;