Add mode_for_int_vector helper functions
commit12bdf7c0dc4b943d672766a0db4e96a879b32c9f
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Sep 2017 19:57:28 +0000 (5 19:57 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Sep 2017 19:57:28 +0000 (5 19:57 +0000)
tree70d42d6bad62e909cc47a2cbfc83768e6d71f952
parentef379746656d7c1de0ac45d5d7df89f026aa396e
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251729 138bc75d-0d04-0410-961f-82ee72b054a4
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