summaryrefslogtreecommitdiff
path: root/longlong.h
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2003-08-19 03:06:31 +0200
committerKevin Ryde <user42@zip.com.au>2003-08-19 03:06:31 +0200
commit528f80d0b72a908df43fc9bbe89f05ffec6936d3 (patch)
tree0e810cc4ede5ac901839d2c69bc879261e677a78 /longlong.h
parent0955b47bc04d485b91b5699318f6ab594bbda1e1 (diff)
downloadgmp-528f80d0b72a908df43fc9bbe89f05ffec6936d3.tar.gz
Amend comments associated with:
* longlong.h (count_trailing_zeros) [x86_64]: Use "%q0" to force 64-bit register destination. Pointed out by Torbjorn.
Diffstat (limited to 'longlong.h')
-rw-r--r--longlong.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/longlong.h b/longlong.h
index c4d0b3005..8baa08c11 100644
--- a/longlong.h
+++ b/longlong.h
@@ -702,10 +702,7 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO ((UWtype *, UWtype, UWtype, UWtype));
__asm__ ("divq %4" /* stringification in K&R C */ \
: "=a" (q), "=d" (r) \
: "0" ((UDItype)(n0)), "1" ((UDItype)(n1)), "rm" ((UDItype)(dx)))
-/* The destination for bsrq and bsfq must be a 64-bit register, hence
- UDItype for __cbtmp. And for count_trailing_zeros, the final "count"
- variable might be only a 32-bit "int", hence the use of the temporary
- there. */
+/* bsrq destination must be a 64-bit register, hence UDItype for __cbtmp. */
#define count_leading_zeros(count, x) \
do { \
UDItype __cbtmp; \
@@ -713,6 +710,8 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO ((UWtype *, UWtype, UWtype, UWtype));
__asm__ ("bsrq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(x))); \
(count) = __cbtmp ^ 63; \
} while (0)
+/* bsfq destination must be a 64-bit register, "%q0" forces this in case
+ count is only an int. */
#define count_trailing_zeros(count, x) \
do { \
ASSERT ((x) != 0); \