__lsx_vfmaxa_d
LSX intrinsic · group: Floating Point Computation
Synopsis
__m128d __lsx_vfmaxa_d (__m128d a, __m128d b)
#include <lsxintrin.h>
Instruction: vfmaxa.d vr, vr, vr
CPU Flags: LSX
Description
Compute the maximum (maxNumMag) of double precision floating point elements in a and b, selecting the element with the larger absolute value.
Operation
for (int i = 0; i < 2; i++) {
if (abs(a.fp64[i]) > abs(b.fp64[i])) {
dst.fp64[i] = a.fp64[i];
} else if (abs(b.fp64[i]) > abs(a.fp64[i])) {
dst.fp64[i] = b.fp64[i];
} else {
dst.fp64[i] = fmax(a.fp64[i], b.fp64[i]);
}
}
Tested on real machine.
Latency and Throughput
| CPU | µarch | Latency | Throughput (IPC) |
|---|---|---|---|
| 3C5000 | LA464 | 2 | 2 |
| 3A6000 | LA664 | 2 | 4 |
| 3C6000 | LA664 | 2 | 4 |
| 2K1000LA | LA264 | 2 | 1 |
| 2K3000 | LA364E | 2 | 1 |