Module: xenomai-forge
Branch: master
Commit: 030ccfcca6d4fdf4655b8e89801c64ceca488d60
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=030ccfcca6d4fdf4655b8e89801c64ceca488d60

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Tue Jun  4 00:12:48 2013 +0200

cobalt/x86: fix SSE/AVX fpu tests

The movupd instruction requires SSE2.

---

 include/asm-x86/fptest.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/asm-x86/fptest.h b/include/asm-x86/fptest.h
index c2dabdb..6c98027 100644
--- a/include/asm-x86/fptest.h
+++ b/include/asm-x86/fptest.h
@@ -44,10 +44,10 @@ static inline void fp_linux_end(void)
 #define printk printf
 #endif /* !__KERNEL__ */
 
-#define FP_FEATURE_SSE                 0x01
+#define FP_FEATURE_SSE2                        0x01
 #define FP_FEATURE_AVX                 0x02
 
-#define FP_CPUID_SSE_MASK              (1 << 25)
+#define FP_CPUID_SSE2_MASK             (1 << 26)
 #define FP_CPUID_AVX_MASK              ((1 << 27) | (1 << 28))
 
 static unsigned long fp_features;
@@ -65,8 +65,8 @@ static inline void fp_features_init(void)
                : "0" (eax)
                : "memory");
 
-       if (edx & FP_CPUID_SSE_MASK)
-               fp_features |= FP_FEATURE_SSE;
+       if (edx & FP_CPUID_SSE2_MASK)
+               fp_features |= FP_FEATURE_SSE2;
        /* check for both xsave and avx */
        if ((ecx & FP_CPUID_AVX_MASK) == FP_CPUID_AVX_MASK)
                fp_features |= FP_FEATURE_AVX;
@@ -90,7 +90,7 @@ static inline void fp_regs_set(unsigned val)
                        "vmovupd %0,%%ymm6;"
                        "vmovupd %0,%%ymm7;"
                        : : "m" (vec[0]));
-       else if (fp_features & FP_FEATURE_SSE)
+       else if (fp_features & FP_FEATURE_SSE2)
                __asm__ __volatile__(
                        "movupd %0,%%xmm0;"
                        "movupd %0,%%xmm1;"
@@ -125,7 +125,7 @@ static inline unsigned fp_regs_check(unsigned val)
                          "=m" (vec[2][0]), "=m" (vec[3][0]),
                          "=m" (vec[4][0]), "=m" (vec[5][0]),
                          "=m" (vec[6][0]), "=m" (vec[7][0]));
-       } else if (fp_features & FP_FEATURE_SSE) {
+       } else if (fp_features & FP_FEATURE_SSE2) {
                __asm__ __volatile__(
                        "movupd %%xmm0,%0;"
                        "movupd %%xmm1,%1;"
@@ -164,7 +164,7 @@ static inline unsigned fp_regs_check(unsigned val)
                                       (unsigned long long)vec[i][2],
                                       val, val);
                }
-       } else if (fp_features & FP_FEATURE_SSE) {
+       } else if (fp_features & FP_FEATURE_SSE2) {
                for (i = 0; i < 8; i++)
                        if (vec[i][0] != val) {
                                printk("xmm%d: %llu != %u\n",


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to