]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/builtins.c
Add internal bitcount functions
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Nov 2015 18:40:31 +0000 (18:40 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Nov 2015 18:40:31 +0000 (18:40 +0000)
commitc9452b7c625f99aa3aebbdc5011ddd9055255670
treec711187e3ba837e0ef8dec2a8d2aafe764284d24
parent1f24b8e93a813987ee9051c5ab554ea6d48a7b13
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230475 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtins.c
gcc/internal-fn.def