This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[COMMITTED 3/4] alpha: Implement math_opt_barrier and math_force_eval
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Date: Thu, 3 Jul 2014 11:00:45 -0700
- Subject: [COMMITTED 3/4] alpha: Implement math_opt_barrier and math_force_eval
- Authentication-results: sourceware.org; auth=none
- References: <1404410446-30243-1-git-send-email-rth at twiddle dot net>
We need not force values to memory like i387.
---
ChangeLog | 3 +++
sysdeps/alpha/fpu/math_private.h | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 017003e..e84fbbf 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 22ab3b9..9e06e25 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__
--
1.9.3