diff options
author | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2015-12-02 07:55:40 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2015-12-02 07:55:40 +0000 |
commit | b0057efd3030267c324d1019786a428fd61b5de9 (patch) | |
tree | 350f6c089d2297c2fac47e42d5c475fd621ecebd /gcc/config/s390/s390.c | |
parent | a4a443cee2ea9c2db55e2802d46a4d5b6cbe1784 (diff) | |
download | gcc-b0057efd3030267c324d1019786a428fd61b5de9.zip gcc-b0057efd3030267c324d1019786a428fd61b5de9.tar.gz gcc-b0057efd3030267c324d1019786a428fd61b5de9.tar.bz2 |
S/390: Enable vrepi constants.
gcc/testsuite/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/vector/vec-vrepi-1.c: New test.
gcc/ChangeLog:
2015-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/constraints.md ("jKK"): New constraint.
* config/s390/s390.c (tm-constrs.h): Include for
satisfies_constraint_*.
(s390_legitimate_constant_p): Allow jKK constants. Use
satisfies_constraint_* also for the others.
(legitimate_reload_vector_constant_p): Likewise.
(print_operand): Allow h output modifier on vectors.
* config/s390/vector.md ("mov<mode>"): Add vrepi.
From-SVN: r231154
Diffstat (limited to 'gcc/config/s390/s390.c')
-rw-r--r-- | gcc/config/s390/s390.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 5a7406c..73465ef 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -74,6 +74,7 @@ along with GCC; see the file COPYING3. If not see #include "builtins.h" #include "rtl-iter.h" #include "intl.h" +#include "tm-constrs.h" /* This file should be included last. */ #include "target-def.h" @@ -3643,9 +3644,11 @@ s390_legitimate_constant_p (machine_mode mode, rtx op) if (GET_MODE_SIZE (mode) != 16) return 0; - if (!const0_operand (op, mode) - && !s390_contiguous_bitmask_vector_p (op, NULL, NULL) - && !s390_bytemask_vector_p (op, NULL)) + if (!satisfies_constraint_j00 (op) + && !satisfies_constraint_jm1 (op) + && !satisfies_constraint_jKK (op) + && !satisfies_constraint_jxx (op) + && !satisfies_constraint_jyy (op)) return 0; } @@ -3826,14 +3829,12 @@ legitimate_reload_fp_constant_p (rtx op) static bool legitimate_reload_vector_constant_p (rtx op) { - /* FIXME: Support constant vectors with all the same 16 bit unsigned - operands. These can be loaded with vrepi. */ - if (TARGET_VX && GET_MODE_SIZE (GET_MODE (op)) == 16 - && (const0_operand (op, GET_MODE (op)) - || constm1_operand (op, GET_MODE (op)) - || s390_contiguous_bitmask_vector_p (op, NULL, NULL) - || s390_bytemask_vector_p (op, NULL))) + && (satisfies_constraint_j00 (op) + || satisfies_constraint_jm1 (op) + || satisfies_constraint_jKK (op) + || satisfies_constraint_jxx (op) + || satisfies_constraint_jyy (op))) return true; return false; @@ -7132,6 +7133,11 @@ print_operand (FILE *file, rtx x, int code) case CONST_VECTOR: switch (code) { + case 'h': + gcc_assert (const_vec_duplicate_p (x)); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, + ((INTVAL (XVECEXP (x, 0, 0)) & 0xffff) ^ 0x8000) - 0x8000); + break; case 'e': case 's': { |