x86-64 fixes: Part 1
Andreas Jaeger
aj@suse.de
Thu, 24 Oct 2002 14:36:10 +0200
Ok, here's my current version of patches for AMD's x86-64
architecture. I'll send the patches via separate emails.
The appended patch fixes gmp-impl.h for x86-64:
- Adds BSWAP_LIMP implementation
- Defines _GMP_IEEE_FLOATS
Andreas
diff -ur gmp-4.1/gmp-impl.h /suse/aj/gmp-4.1/gmp-impl.h
--- gmp-4.1/gmp-impl.h Wed May 8 23:50:17 2002
+++ /suse/aj/gmp-4.1/gmp-impl.h Sun Sep 29 16:09:44 2002
@@ -2230,6 +2230,14 @@
} while (0)
#endif
+#if defined (__GNUC__) && ! defined (NO_ASM) \
+ && defined (__x86_64__) && BITS_PER_MP_LIMB == 64
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ asm ("bswapq %0" : "=r" (dst) : "0" (src)); \
+ } while (0)
+#endif /* x86_64 */
+
#if ! defined (BSWAP_LIMB)
#if BITS_PER_MP_LIMB == 8
#define BSWAP_LIMB(dst, src) \
@@ -2478,6 +2486,7 @@
|| defined (__clipper__) \
|| defined (__cris) \
|| defined (__i386__) \
+ || defined (__x86_64__) \
|| defined (__i860__) \
|| defined (__i960__) \
|| defined (__ia64) \
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj