aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRasmus Munk Larsen <rmlarsen@google.com>2021-06-29 23:26:15 +0000
committerRasmus Munk Larsen <rmlarsen@google.com>2021-06-29 23:26:15 +0000
commit5aebbe9098f53f01c99eed67b52725397e955280 (patch)
tree66166ed4287cd8778d0192bf0524b14bbbb0cd3d
parent3a087ccb99b454dc34484333e608e836e7032213 (diff)
Get rid of redundant `pabs` instruction in complex square root.
-rw-r--r--Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index bb4f719a8..c9fbaf68b 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -802,9 +802,8 @@ Packet psqrt_complex(const Packet& a) {
// l0 = (min0 == 0 ? max0 : max0 * sqrt(1 + (min0/max0)**2)),
// where max0 = max(|x0|, |y0|), min0 = min(|x0|, |y0|), and similarly for l1.
- Packet a_flip = pcplxflip(a);
RealPacket a_abs = pabs(a.v); // [|x0|, |y0|, |x1|, |y1|]
- RealPacket a_abs_flip = pabs(a_flip.v); // [|y0|, |x0|, |y1|, |x1|]
+ RealPacket a_abs_flip = pcplxflip(Packet(a_abs)).v; // [|y0|, |x0|, |y1|, |x1|]
RealPacket a_max = pmax(a_abs, a_abs_flip);
RealPacket a_min = pmin(a_abs, a_abs_flip);
RealPacket a_min_zero_mask = pcmp_eq(a_min, pzero(a_min));