IBM Z: Fix error checking for immediate builtin operands
authorAndreas Krebbel <krebbel@linux.ibm.com>
Wed, 14 Apr 2021 14:07:17 +0000 (16:07 +0200)
committerAndreas Krebbel <krebbel@linux.ibm.com>
Wed, 14 Apr 2021 14:14:16 +0000 (16:14 +0200)
commit3191c1f4488d1f7563b563d7ae2a102a26f16d82
treeb036944acf535a80c79c4b6034736feaafe47fc8
parent527bc0181d3ea36f11dcaa8aea7704466bd0f01b
IBM Z: Fix error checking for immediate builtin operands

This fixes the error checking for two of the vector builtins which
accept irregular (e.g. non-contigiuous) ranges of values.

gcc/ChangeLog:

* config/s390/s390-builtins.def (O_M5, O_M12, ...): Add new macros
for mask operand types.
(s390_vec_permi_s64, s390_vec_permi_b64, s390_vec_permi_u64)
(s390_vec_permi_dbl, s390_vpdi): Use the M5 type for the immediate
operand.
(s390_vec_msum_u128, s390_vmslg): Use the M12 type for the
immediate operand.
* config/s390/s390.c (s390_const_operand_ok): Check the new
operand types and generate a list of valid values.

gcc/testsuite/ChangeLog:

* gcc.target/s390/zvector/imm-range-error-1.c: New test.
* gcc.target/s390/zvector/vec_msum_u128-1.c: New test.
gcc/config/s390/s390-builtins.def
gcc/config/s390/s390.c
gcc/testsuite/gcc.target/s390/zvector/imm-range-error-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/zvector/vec_msum_u128-1.c [new file with mode: 0644]