[54/77] Add explicit int checks for alternative optab implementations
commit4c9e65ea19b29933df522694c46d7f6be545b6dc
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:17:54 +0000 (30 11:17 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:17:54 +0000 (30 11:17 +0000)
tree62076c2966744eb351ccc7da3ed1080dad4c6f72
parent5e7463c2e3e63f6f8db3e5b53f33f467ad69dfe3
[54/77] Add explicit int checks for alternative optab implementations

expand_unop can expand narrow clz, clrsb, ctz, bswap, parity and
ffs operations using optabs for wider modes.  These expansions
apply only to scalar integer modes (and not for example to vectors),
so the patch adds explicit checks for that.

2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* optabs.c (widen_leading): Change the type of the mode argument
to scalar_int_mode.  Use opt_scalar_int_mode for the mode iterator.
(widen_bswap): Likewise.
(expand_parity): Likewise.
(expand_ctz): Change the type of the mode argument to scalar_int_mode.
(expand_ffs): Likewise.
(epand_unop): Check for scalar integer modes before calling the
above routines.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251506 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/optabs.c