]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
m68k: add optimized math_opt_barrier and math_force_eval
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 26 Oct 2011 09:34:30 +0000 (11:34 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Wed, 26 Oct 2011 09:34:30 +0000 (11:34 +0200)
ChangeLog.m68k
sysdeps/m68k/m680x0/fpu/math_private.h [new file with mode: 0644]

index 7b2688eed7fbe3b438970a18f1efb23c30b5ea02..09de15987b07727a8cf76d79d362e949d61f4c2f 100644 (file)
@@ -1,5 +1,7 @@
 2011-10-26  Andreas Schwab  <schwab@linux-m68k.org>
 
+       * sysdeps/m68k/m680x0/fpu/math_private.h: New file.
+
        * sysdeps/m68k/m680x0/fpu/sincostab.c: New file.
 
 2011-10-23  Andreas Schwab  <schwab@linux-m68k.org>
diff --git a/sysdeps/m68k/m680x0/fpu/math_private.h b/sysdeps/m68k/m680x0/fpu/math_private.h
new file mode 100644 (file)
index 0000000..3793cff
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _MATH_PRIVATE_H
+
+#define math_opt_barrier(x) \
+({ __typeof (x) __x;                                   \
+   __asm ("" : "=f" (__x) : "0" (x));                  \
+   __x; })
+#define math_force_eval(x) \
+do                                                     \
+  {                                                    \
+    __typeof (x) __x = (x);                            \
+    if (sizeof (x) <= sizeof (double))                 \
+      __asm __volatile ("" : : "m" (__x));             \
+    else                                               \
+      __asm __volatile ("" : : "f" (__x));             \
+  }                                                    \
+while (0)
+
+#include <math/math_private.h>
+#endif