[54/77] Add explicit int checks for alternative optab implementations
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 30 Aug 2017 11:17:54 +0000 (11:17 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 30 Aug 2017 11:17:54 +0000 (11:17 +0000)
commit3c84109eae52da59c09e8a91bfb5e79bd0527809
tree62076c2966744eb351ccc7da3ed1080dad4c6f72
parent04d6ea36a7f0b2124d1a102eae3727efddeb5875
[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.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251506
gcc/ChangeLog
gcc/optabs.c