cadd
SVE Complex Integer Add
Performs complex integer addition with rotation.
Pseudocode Operation
No pseudocode available.
Encoding
Related
More in SVE2
Reference
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x4500D800 | CADD <Zdn>.<T>, <Zdn>.<T>, <Zm>.<T>, <const> | A64 | 01000101 | size | 00000 | 0 | 11011 | rot | Zm | Zdn |
Description
Add the real and imaginary components of the integral complex numbers from the first source vector to the complex numbers from the second source vector which have first been rotated by 90 or 270 degrees in the direction from the positive real axis towards the positive imaginary axis, when considered in polar representation, equivalent to multiplying the complex numbers in the second source vector by ±j beforehand. Destructively place the results in the corresponding elements of the first source vector. This instruction is unpredicated. Each complex number is represented in a vector register as an even/odd pair of elements with the real part in the even-numbered element and the imaginary part in the odd-numbered element.
Operation
CheckSVEEnabled();
constant integer VL = CurrentVL;
constant integer PL = VL DIV 8;
constant integer pairs = VL DIV (2 * esize);
bits(VL) operand1 = Z[dn, VL];
bits(VL) operand2 = Z[m, VL];
bits(VL) result;
for p = 0 to pairs-1
integer acc_r = SInt(Elem[operand1, 2 * p + 0, esize]);
integer acc_i = SInt(Elem[operand1, 2 * p + 1, esize]);
integer elt2_r = SInt(Elem[operand2, 2 * p + 0, esize]);
integer elt2_i = SInt(Elem[operand2, 2 * p + 1, esize]);
if sub_i then
acc_r = acc_r - elt2_i;
acc_i = acc_i + elt2_r;
if sub_r then
acc_r = acc_r + elt2_i;
acc_i = acc_i - elt2_r;
Elem[result, 2 * p + 0, esize] = acc_r<esize-1:0>;
Elem[result, 2 * p + 1, esize] = acc_i<esize-1:0>;
Z[dn, VL] = result;