Skip to content

Commit

Permalink
Check availability of rbit instruction (flintlib#2245)
Browse files Browse the repository at this point in the history
Used in ulong_extras/revbin.c
  • Loading branch information
albinahlback authored Mar 6, 2025
1 parent b60b274 commit 3806e5e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ulong_extras/revbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@

#include "ulong_extras.h"

#if defined(__GNUC__) && FLINT64 && defined(__aarch64__)
/* The following checks whether the `rbit' instruction is available [1].
*
* [1]: Section 8.2.1 in https://github.com/ARM-software/acle/releases/download/r2024Q4/acle-2024Q4.pdf. */
#if (__ARM_ARCH >= 6 && __ARM_ISA_THUMB >= 2) || __ARM_ARCH >= 7
# define HAVE_RBIT 1
#endif

#if defined(__GNUC__) && FLINT64 && HAVE_RBIT
# include <arm_acle.h>
ulong
n_revbin(ulong n, ulong b)
Expand Down

0 comments on commit 3806e5e

Please sign in to comment.