Fix EIGEN_OPTIMIZATION_BARRIER for arm-clang.

Clang doesn't like !621, needs the "g" constraint back.
The "g" constraint also works for GCC >= 5.

This fixes our gitlab CI.
This commit is contained in:
Antonio Sanchez 2021-09-01 09:17:46 -07:00
parent a443a2373f
commit 3a6296d4f1

View File

@ -1131,7 +1131,16 @@ namespace Eigen {
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+r,v,wa" (X));
#elif EIGEN_ARCH_ARM_OR_ARM64
// General, NEON.
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+r,w" (X));
// Clang doesn't like "r",
// error: non-trivial scalar-to-vector conversion, possible invalid
// constraint for vector type
// GCC < 5 doesn't like "g",
// error: 'asm' operand requires impossible reload
#if EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_AT_MOST(5, 0)
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+r,w" (X));
#else
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+g,w" (X));
#endif
#elif EIGEN_ARCH_i386_OR_x86_64
// General, SSE.
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+g,x" (X));