35#ifndef EIGEN_INVERSE_SIZE_4_H
36#define EIGEN_INVERSE_SIZE_4_H
42template <
typename MatrixType,
typename ResultType>
53 static void run(
const MatrixType &mat, ResultType &
result)
57 const float*
data = matrix.data();
58 const Index stride = matrix.innerStride();
60 Packet4f _L2 = ploadt<Packet4f,MatrixAlignment>(
data + stride*4);
61 Packet4f _L3 = ploadt<Packet4f,MatrixAlignment>(
data + stride*8);
62 Packet4f _L4 = ploadt<Packet4f,MatrixAlignment>(
data + stride*12);
69 if (!StorageOrdersMatch)
88 AB =
psub(AB,
pmul(
vec4f_swizzle2(A, A, 1, 1, 2, 2),
vec4f_swizzle2(B, B, 2, 3, 0, 1)));
92 DC =
psub(DC,
pmul(
vec4f_swizzle2(D, D, 1, 1, 2, 2),
vec4f_swizzle2(C, C, 2, 3, 0, 1)));
138 iB =
psub(iB,
pmul(
vec4f_swizzle2(D, D, 1, 0, 3, 2),
vec4f_swizzle2(AB, AB, 2, 1, 2, 1)));
143 iC =
psub(iC,
pmul(
vec4f_swizzle2(A, A, 1, 0, 3, 2),
vec4f_swizzle2(DC, DC, 2, 1, 2, 1)));
146 const float sign_mask[4] = {0.0f, numext::bit_cast<float>(0x80000000u), numext::bit_cast<float>(0x80000000u), 0.0f};
155 float *res =
result.data();
157 pstoret<float, Packet4f, ResultAlignment>(res + 0,
vec4f_swizzle2(iA, iB, 3, 1, 3, 1));
158 pstoret<float, Packet4f, ResultAlignment>(res + res_stride,
vec4f_swizzle2(iA, iB, 2, 0, 2, 0));
159 pstoret<float, Packet4f, ResultAlignment>(res + 2 * res_stride,
vec4f_swizzle2(iC, iD, 3, 1, 3, 1));
160 pstoret<float, Packet4f, ResultAlignment>(res + 3 * res_stride,
vec4f_swizzle2(iC, iD, 2, 0, 2, 0));
164#if !(defined EIGEN_VECTORIZE_NEON && !(EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG))
167template <
typename MatrixType,
typename ResultType>
178 typename MatrixType::PlainObject>
::type
181 static void run(
const MatrixType &mat, ResultType &
result)
192 Packet2d A1, A2, B1, B2, C1, C2, D1, D2;
194 const double*
data = matrix.data();
195 const Index stride = matrix.innerStride();
196 if (StorageOrdersMatch)
198 A1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*0);
199 B1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*2);
200 A2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*4);
201 B2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*6);
202 C1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*8);
203 D1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*10);
204 C2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*12);
205 D2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*14);
210 A1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*0);
211 C1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*2);
212 A2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*4);
213 C2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*6);
222 B1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*8);
223 D1 = ploadt<Packet2d,MatrixAlignment>(
data + stride*10);
224 B2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*12);
225 D2 = ploadt<Packet2d,MatrixAlignment>(
data + stride*14);
291 Packet2d iA1, iA2, iB1, iB2, iC1, iC2, iD1, iD2;
329 const double sign_mask1[2] = {0.0, numext::bit_cast<double>(0x8000000000000000ull)};
330 const double sign_mask2[2] = {numext::bit_cast<double>(0x8000000000000000ull), 0.0};
337 double *res =
result.data();
338 pstoret<double, Packet2d, ResultAlignment>(res + 0,
pmul(
vec2d_swizzle2(iA2, iA1, 3), d1));
339 pstoret<double, Packet2d, ResultAlignment>(res + res_stride,
pmul(
vec2d_swizzle2(iA2, iA1, 0), d2));
340 pstoret<double, Packet2d, ResultAlignment>(res + 2,
pmul(
vec2d_swizzle2(iB2, iB1, 3), d1));
341 pstoret<double, Packet2d, ResultAlignment>(res + res_stride + 2,
pmul(
vec2d_swizzle2(iB2, iB1, 0), d2));
342 pstoret<double, Packet2d, ResultAlignment>(res + 2 * res_stride,
pmul(
vec2d_swizzle2(iC2, iC1, 3), d1));
343 pstoret<double, Packet2d, ResultAlignment>(res + 3 * res_stride,
pmul(
vec2d_swizzle2(iC2, iC1, 0), d2));
344 pstoret<double, Packet2d, ResultAlignment>(res + 2 * res_stride + 2,
pmul(
vec2d_swizzle2(iD2, iD1, 3), d1));
345 pstoret<double, Packet2d, ResultAlignment>(res + 3 * res_stride + 2,
pmul(
vec2d_swizzle2(iD2, iD1, 0), d2));
#define vec4f_duplane(a, p)
Definition: PacketMath.h:92
#define vec2d_duplane(a, p)
Definition: PacketMath.h:106
#define vec2d_swizzle2(a, b, mask)
Definition: PacketMath.h:95
type
Definition: core.h:575
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition: Constants.h:130
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:66
@ Target
Definition: Constants.h:492
__m128d Packet2d
Definition: PacketMath.h:43
EIGEN_STRONG_INLINE Packet4f vec4f_movelh(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:76
__m128 Packet4f
Definition: PacketMath.h:42
EIGEN_STRONG_INLINE Packet4f vec4f_swizzle2(const Packet4f &a, const Packet4f &b, int p, int q, int r, int s)
Definition: PacketMath.h:117
EIGEN_STRONG_INLINE Packet2d vec2d_unpackhi(const Packet2d &a, const Packet2d &b)
Definition: PacketMath.h:102
EIGEN_STRONG_INLINE Packet4bf pxor(const Packet4bf &a, const Packet4bf &b)
Definition: PacketMath.h:3503
EIGEN_STRONG_INLINE Packet4f vec4f_movehl(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:80
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:244
EIGEN_STRONG_INLINE Packet2d pset1< Packet2d >(const double &from)
Definition: PacketMath.h:258
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:237
EIGEN_STRONG_INLINE Packet4f pset1< Packet4f >(const float &from)
Definition: PacketMath.h:257
EIGEN_STRONG_INLINE Packet2d ploadu< Packet2d >(const double *from)
Definition: PacketMath.h:743
EIGEN_STRONG_INLINE Packet4f vec4f_unpackhi(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:88
EIGEN_STRONG_INLINE Packet4f vec4f_unpacklo(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:84
EIGEN_STRONG_INLINE Packet2d vec2d_unpacklo(const Packet2d &a, const Packet2d &b)
Definition: PacketMath.h:98
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
Definition: PacketMath.h:736
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:222
DoublePacket< Packet > padd(const DoublePacket< Packet > &a, const DoublePacket< Packet > &b)
Definition: GeneralBlockPanelKernel.h:689
Namespace containing all symbols from the Eigen library.
Definition: MatrixExponential.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
result
Definition: format.h:2556
Definition: Eigen_Colamd.h:50
compound_unit< energy::joules, inverse< mass::kilogram > > rd
Definition: radiation.h:61
static void run(const MatrixType &mat, ResultType &result)
Definition: InverseSize4.h:181
static void run(const MatrixType &mat, ResultType &result)
Definition: InverseSize4.h:53
Definition: InverseImpl.h:235
Definition: ForwardDeclarations.h:17
Definition: format.h:1544