aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-11-17 18:40:31 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-11-17 18:40:31 +0000
commit4959a752881b69064fb988df23c10e14827099e9 (patch)
treec711187e3ba837e0ef8dec2a8d2aafe764284d24 /gcc/builtins.c
parent686ee9719a4dc70619da0a69a4357007406c9fbd (diff)
downloadgcc-4959a752881b69064fb988df23c10e14827099e9.zip
gcc-4959a752881b69064fb988df23c10e14827099e9.tar.gz
gcc-4959a752881b69064fb988df23c10e14827099e9.tar.bz2
Add internal bitcount functions
This patch adds internal function equivalents of all the INT_FN functions. Unlike the math functions, these functions never set errno and the internal functions should be exactly equivalent to the built-in ones. The reason for defining the internal functions is so that we can extend the functionality to other modes, in particular vector modes. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. gcc/ * internal-fn.def (DEF_INTERNAL_INT_FN): New macro. (CLRSB, CLZ, CTZ, FFS, PARITY, POPCOUNT): New functions. * builtins.c (associated_internal_fn): Handle them. From-SVN: r230475
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 0eef112..303a5b0 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1916,6 +1916,8 @@ associated_internal_fn (tree fndecl)
{
#define DEF_INTERNAL_FLT_FN(NAME, FLAGS, OPTAB, TYPE) \
CASE_FLT_FN (BUILT_IN_##NAME): return IFN_##NAME;
+#define DEF_INTERNAL_INT_FN(NAME, FLAGS, OPTAB, TYPE) \
+ CASE_INT_FN (BUILT_IN_##NAME): return IFN_##NAME;
#include "internal-fn.def"
CASE_FLT_FN (BUILT_IN_POW10):