This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] powerpc: Avoid putting floating point values in memory
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: dje dot gcc at gmail dot com
- Date: Fri, 22 Sep 2017 15:19:55 -0300
- Subject: [PATCH] powerpc: Avoid putting floating point values in memory
- Authentication-results: sourceware.org; auth=none
2017-09-22 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* sysdeps/powerpc/fpu/math_private.h (math_opt_barrier):
(math_force_eval): Add powerpc version.
---
sysdeps/powerpc/fpu/math_private.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index 396fd05..472182d 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -23,6 +23,13 @@
#include <ldsodefs.h>
#include <dl-procinfo.h>
#include <fenv_private.h>
+
+/* Avoid putting floating point values in memory. */
+# define math_opt_barrier(x) \
+ ({ __typeof (x) __x = (x); __asm ("" : "+dwa" (__x)); __x; })
+# define math_force_eval(x) \
+ ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "dwa" (__x)); })
+
#include_next <math_private.h>
#if defined _ARCH_PWR9 && __HAVE_DISTINCT_FLOAT128
--
2.9.5