about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-07-03 08:56:55 -0700
committerRichard Henderson <rth@twiddle.net>2014-07-03 08:56:55 -0700
commitd5e16ade14822f1a125b6d568b1e3e1326e8868d (patch)
treed16c46b2ee3dfd84a500c710e347757f1a3eaf43
parentca7b945c7330064f494436611bd35fce6107abf6 (diff)
downloadglibc-d5e16ade14822f1a125b6d568b1e3e1326e8868d.tar.gz
glibc-d5e16ade14822f1a125b6d568b1e3e1326e8868d.tar.xz
glibc-d5e16ade14822f1a125b6d568b1e3e1326e8868d.zip
alpha: Implement math_opt_barrier and math_force_eval
-rw-r--r--ChangeLog3
-rw-r--r--sysdeps/alpha/fpu/math_private.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 017003e241..e84fbbf739 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-07-03  Richard Henderson  <rth@redhat.com>
 
+	* sysdeps/alpha/fpu/math_private.h (math_opt_barrier): New.
+	(math_force_eval): New.
+
 	* sysdeps/alpha/fpu/s_lround.c: Add 0.5 with chopped rounding.
 	* sysdeps/alpha/fpu/s_lroundf.c: Likewise.
 
diff --git a/sysdeps/alpha/fpu/math_private.h b/sysdeps/alpha/fpu/math_private.h
index 22ab3b9ab0..9e06e25dc6 100644
--- a/sysdeps/alpha/fpu/math_private.h
+++ b/sysdeps/alpha/fpu/math_private.h
@@ -13,6 +13,12 @@
 # define __isnanf __isnanf
 #endif
 
+/* Generic code forces values to memory; we don't need to do that.  */
+#define math_opt_barrier(x) \
+  ({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; })
+#define math_force_eval(x) \
+  ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); })
+
 #include_next <math_private.h>
 
 #ifdef __alpha_fix__