mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-02 08:44:12 +08:00
Replace asm by __asm__ (bug #873)
This commit is contained in:
parent
60314beb38
commit
25bceefb4e
@ -141,7 +141,7 @@ template<> EIGEN_STRONG_INLINE Packet8f pmadd(const Packet8f& a, const Packet8f&
|
|||||||
// so let's enforce it to generate a vfmadd231ps instruction since the most common use case is to accumulate
|
// so let's enforce it to generate a vfmadd231ps instruction since the most common use case is to accumulate
|
||||||
// the result of the product.
|
// the result of the product.
|
||||||
Packet8f res = c;
|
Packet8f res = c;
|
||||||
asm("vfmadd231ps %[a], %[b], %[c]" : [c] "+x" (res) : [a] "x" (a), [b] "x" (b));
|
__asm__("vfmadd231ps %[a], %[b], %[c]" : [c] "+x" (res) : [a] "x" (a), [b] "x" (b));
|
||||||
return res;
|
return res;
|
||||||
#else
|
#else
|
||||||
return _mm256_fmadd_ps(a,b,c);
|
return _mm256_fmadd_ps(a,b,c);
|
||||||
@ -151,7 +151,7 @@ template<> EIGEN_STRONG_INLINE Packet4d pmadd(const Packet4d& a, const Packet4d&
|
|||||||
#if defined(__clang__) || defined(__GNUC__)
|
#if defined(__clang__) || defined(__GNUC__)
|
||||||
// see above
|
// see above
|
||||||
Packet4d res = c;
|
Packet4d res = c;
|
||||||
asm("vfmadd231pd %[a], %[b], %[c]" : [c] "+x" (res) : [a] "x" (a), [b] "x" (b));
|
__asm__("vfmadd231pd %[a], %[b], %[c]" : [c] "+x" (res) : [a] "x" (a), [b] "x" (b));
|
||||||
return res;
|
return res;
|
||||||
#else
|
#else
|
||||||
return _mm256_fmadd_pd(a,b,c);
|
return _mm256_fmadd_pd(a,b,c);
|
||||||
|
@ -57,7 +57,7 @@ typedef uint32x4_t Packet4ui;
|
|||||||
#elif defined __pld
|
#elif defined __pld
|
||||||
#define EIGEN_ARM_PREFETCH(ADDR) __pld(ADDR)
|
#define EIGEN_ARM_PREFETCH(ADDR) __pld(ADDR)
|
||||||
#elif !defined(__aarch64__)
|
#elif !defined(__aarch64__)
|
||||||
#define EIGEN_ARM_PREFETCH(ADDR) asm volatile ( " pld [%[addr]]\n" :: [addr] "r" (ADDR) : "cc" );
|
#define EIGEN_ARM_PREFETCH(ADDR) __asm__ __volatile__ ( " pld [%[addr]]\n" :: [addr] "r" (ADDR) : "cc" );
|
||||||
#else
|
#else
|
||||||
// by default no explicit prefetching
|
// by default no explicit prefetching
|
||||||
#define EIGEN_ARM_PREFETCH(ADDR)
|
#define EIGEN_ARM_PREFETCH(ADDR)
|
||||||
|
@ -279,7 +279,7 @@ namespace Eigen {
|
|||||||
|
|
||||||
#if !defined(EIGEN_ASM_COMMENT)
|
#if !defined(EIGEN_ASM_COMMENT)
|
||||||
#if (defined __GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
|
#if (defined __GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
|
||||||
#define EIGEN_ASM_COMMENT(X) asm("#" X)
|
#define EIGEN_ASM_COMMENT(X) __asm__("#" X)
|
||||||
#else
|
#else
|
||||||
#define EIGEN_ASM_COMMENT(X)
|
#define EIGEN_ASM_COMMENT(X)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user