summaryrefslogtreecommitdiff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-08-24 18:05:48 -0700
committerUlrich Drepper <drepper@redhat.com>2009-08-24 18:05:48 -0700
commitcf00cc00bc53ab26b23b810b4bfbdfb43262538a (patch)
tree3d09caa3ecb83249ccaa5e0f874b9128c1de78e7 /sysdeps/x86_64
parentb42a214c1807dc596cf3647fc35a0eb42ccc7e68 (diff)
Add ceil implementation for 64-bit machines.
On 64-bit machines we should not split doubles into two 32 bit integer and handle the words separately. We have wide registers. This patch implements a 64-bit ceil version. Ideally all other functions will be converted over time.
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/fpu/math_private.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 8f4b792e77..4be753654a 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -22,6 +22,23 @@ while (0)
/* We can do a few things better on x86-64. */
/* Direct movement of float into integer register. */
+#undef EXTRACT_WORDS64
+#define EXTRACT_WORDS64(i,d) \
+do { \
+ long int i_; \
+ asm ("movd %1, %0" : "=rm" (i_) : "x" (d)); \
+ (i) = i_; \
+} while (0)
+
+/* And the reverse. */
+#undef INSERT_WORDS64
+#define INSERT_WORDS64(d,i) \
+do { \
+ long int i_ = i; \
+ asm ("movd %1, %0" : "=x" (d) : "rm" (i_)); \
+} while (0)
+
+/* Direct movement of float into integer register. */
#undef GET_FLOAT_WORD
#define GET_FLOAT_WORD(i,d) \
do { \