summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gmplib.org>2013-04-17 17:04:54 +0200
committerTorbjorn Granlund <tege@gmplib.org>2013-04-17 17:04:54 +0200
commit137dc553d86b1ccf94388e48efaf17609dfcd28f (patch)
tree59006b8347cbcbb5ba6b823bd6b699a8decd7562
parent68046acc39deecb3edece6e2653d632f39c1c366 (diff)
downloadgmp-137dc553d86b1ccf94388e48efaf17609dfcd28f.tar.gz
(arm64 count_trailing_zeros): New.
-rw-r--r--longlong.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/longlong.h b/longlong.h
index a7a853253..d969c7470 100644
--- a/longlong.h
+++ b/longlong.h
@@ -548,6 +548,8 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
} while (0)
#define count_leading_zeros(count, x) \
__asm__ ("clz\t%0, %1" : "=r" (count) : "r" (x))
+#define count_trailing_zeros(count, x) \
+ __asm__ ("rbit\t%0, %1\n\tclz\t%0, %0" : "=r" (count) : "r" (x))
#define COUNT_LEADING_ZEROS_0 64
#endif /* __aarch64__ */