diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-09-05 19:57:28 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-09-05 19:57:28 +0000 |
commit | ddc203a7b15306287792a3eed6abfe306e3d26ad (patch) | |
tree | 70d42d6bad62e909cc47a2cbfc83768e6d71f952 /gcc/config/s390/s390.c | |
parent | 61b2290a5c248efd43dd45b1b256e7f792f21f02 (diff) | |
download | gcc-ddc203a7b15306287792a3eed6abfe306e3d26ad.zip gcc-ddc203a7b15306287792a3eed6abfe306e3d26ad.tar.gz gcc-ddc203a7b15306287792a3eed6abfe306e3d26ad.tar.bz2 |
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
Diffstat (limited to 'gcc/config/s390/s390.c')
-rw-r--r-- | gcc/config/s390/s390.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 3fd1ff6..36bc67d 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -6472,10 +6472,7 @@ s390_expand_vec_compare_cc (rtx target, enum rtx_code code, case LE: cc_producer_mode = CCVFHEmode; code = GE; swap_p = true; break; default: gcc_unreachable (); } - scratch_mode = mode_for_vector - (int_mode_for_mode (GET_MODE_INNER (GET_MODE (cmp1))).require (), - GET_MODE_NUNITS (GET_MODE (cmp1))); - gcc_assert (scratch_mode != BLKmode); + scratch_mode = mode_for_int_vector (GET_MODE (cmp1)).require (); if (inv_p) all_p = !all_p; @@ -6581,9 +6578,7 @@ s390_expand_vcond (rtx target, rtx then, rtx els, /* We always use an integral type vector to hold the comparison result. */ - result_mode = mode_for_vector - (int_mode_for_mode (GET_MODE_INNER (cmp_mode)).require (), - GET_MODE_NUNITS (cmp_mode)); + result_mode = mode_for_int_vector (cmp_mode).require (); result_target = gen_reg_rtx (result_mode); /* We allow vector immediates as comparison operands that |