This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 4/5] Use movq for 64-bit operations
- From: Peter Collingbourne <pcc at google dot com>
- To: libc-alpha at sourceware dot org
- Cc: Peter Collingbourne <pcc at google dot com>
- Date: Mon, 13 May 2013 08:36:11 -0700
- Subject: [PATCH 4/5] Use movq for 64-bit operations
- References: <1368459372-2415-1-git-send-email-pcc at google dot com>
The EXTRACT_WORDS64 and INSERT_WORDS64 macros use movd for a 64-bit
operation. Somehow gcc manages to turn this into movq, but LLVM won't.
2013-05-13 Peter Collingbourne <pcc@google.com>
* sysdeps/x86_64/fpu/math_private.h (MOVQ): New macro.
(EXTRACT_WORDS64) Use where appropriate.
(INSERT_WORDS64) Likewise.
---
sysdeps/x86_64/fpu/math_private.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 63a699e..027a6a3 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -5,15 +5,17 @@
#if defined __AVX__ || defined SSE2AVX
# define MOVD "vmovd"
+# define MOVQ "vmovq"
#else
# define MOVD "movd"
+# define MOVQ "movq"
#endif
/* Direct movement of float into integer register. */
#define EXTRACT_WORDS64(i, d) \
do { \
int64_t i_; \
- asm (MOVD " %1, %0" : "=rm" (i_) : "x" ((double) (d))); \
+ asm (MOVQ " %1, %0" : "=rm" (i_) : "x" ((double) (d))); \
(i) = i_; \
} while (0)
@@ -22,7 +24,7 @@
do { \
int64_t i_ = i; \
double d__; \
- asm (MOVD " %1, %0" : "=x" (d__) : "rm" (i_)); \
+ asm (MOVQ " %1, %0" : "=x" (d__) : "rm" (i_)); \
d = d__; \
} while (0)
--
1.8.2.1