m68k: prevent gcc from CSEing mathinline asms
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 23 Mar 2012 12:42:08 +0000 (13:42 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Fri, 23 Mar 2012 12:42:08 +0000 (13:42 +0100)
ChangeLog.m68k
sysdeps/m68k/m680x0/fpu/bits/mathinline.h

index 50a5e45..160fb16 100644 (file)
@@ -1,3 +1,11 @@
+2012-03-23  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__inline_mathop1):
+       Mark asm as volatile.
+       (__scalbn): Likewise.
+       (__lrint): Likewise.
+       (__sincos): Likewise.
+
 2012-03-22  Andreas Schwab  <schwab@linux-m68k.org>
 
        * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.
index 8d4e30a..ffcc39e 100644 (file)
@@ -146,7 +146,8 @@ __NTH (__signbitl (long double __x))
   __m81_defun (float_type, func, (float_type __mathop_x))                    \
   {                                                                          \
     float_type __result;                                                     \
-    __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\
+    __asm __volatile__ ("f" __STRING(op) "%.x %1, %0"                        \
+                       : "=f" (__result) : "f" (__mathop_x));                \
     return __result;                                                         \
   }
 
@@ -243,8 +244,8 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value))                  \
   /* There is no branch-condition for infinity,                                  \
      so we must extract and examine the condition codes manually.  */    \
   unsigned long int __fpsr;                                              \
-  __asm("ftst%.x %1\n"                                                   \
-       "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value));          \
+  __asm ("ftst%.x %1\n"                                                          \
+        "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value));         \
   return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0;       \
 }                                                                        \
                                                                          \
@@ -262,7 +263,8 @@ __m81_defun (float_type, __CONCAT(__scalbn,s),                                \
             (float_type __x, int __n))                                   \
 {                                                                        \
   float_type __result;                                                   \
-  __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x));  \
+  __asm __volatile__  ("fscale%.l %1, %0" : "=f" (__result)              \
+                      : "dmi" (__n), "0" (__x));                         \
   return __result;                                                       \
 }
 
@@ -279,8 +281,8 @@ __inline_functions(long double,l)
 __m81_defun (int, __CONCAT(__isnan,s), (float_type __value))             \
 {                                                                        \
   char __result;                                                         \
-  __asm("ftst%.x %1\n"                                                   \
-       "fsun %0" : "=dm" (__result) : "f" (__value));                    \
+  __asm ("ftst%.x %1\n"                                                          \
+        "fsun %0" : "=dm" (__result) : "f" (__value));                   \
   return __result;                                                       \
 }
 
@@ -319,7 +321,7 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))   \
 __m81_defun (long int, __CONCAT(__lrint,s), (float_type __x))            \
 {                                                                        \
   long int __result;                                                     \
-  __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));              \
+  __asm __volatile__ ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));  \
   return __result;                                                       \
 }
 
@@ -337,8 +339,8 @@ __m81_inline void                                                   \
 __NTH (__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
                                     float_type *__cosx))               \
 {                                                                      \
-  __asm ("fsincos%.x %2,%1:%0"                                         \
-        : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));                 \
+  __asm __volatile__ ("fsincos%.x %2,%1:%0"                            \
+                     : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));    \
 }
 
 __inline_functions (double,)