Add mode_for_int_vector helper functions
authorRichard Sandiford <richard.sandiford@linaro.org>
Tue, 5 Sep 2017 19:57:28 +0000 (19:57 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 5 Sep 2017 19:57:28 +0000 (19:57 +0000)
commitddc203a7b15306287792a3eed6abfe306e3d26ad
tree70d42d6bad62e909cc47a2cbfc83768e6d71f952
parent61b2290a5c248efd43dd45b1b256e7f792f21f02
Add mode_for_int_vector helper functions

There are at least a few places that want to create an integer vector
with a specified element size and element count, or to create the
integer equivalent of an existing mode.  This patch adds helpers
for doing that.

The require ()s are all used in functions that go on to emit
instructions that use the result as a vector mode.

2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* machmode.h (mode_for_int_vector): New function.
* stor-layout.c (mode_for_int_vector): Likewise.
* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Use it.
* config/powerpcspe/powerpcspe.c (rs6000_do_expand_vec_perm): Likewise.
* config/rs6000/rs6000.c (rs6000_do_expand_vec_perm): Likewise.
* config/s390/s390.c (s390_expand_vec_compare_cc): Likewise.
(s390_expand_vcond): Likewise.

From-SVN: r251729
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/powerpcspe/powerpcspe.c
gcc/config/rs6000/rs6000.c
gcc/config/s390/s390.c
gcc/machmode.h
gcc/stor-layout.c