]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s390: Fix s390_constant_via_vgbm_p() [PR118362]
authorStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
Thu, 9 Jan 2025 16:49:02 +0000 (17:49 +0100)
committerStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
Thu, 9 Jan 2025 16:49:02 +0000 (17:49 +0100)
Optimization s390_constant_via_vgbm_p() should only apply to constant
vectors which can be expressed by the hardware, i.e., which have a size
of at most 16-bytes, similar as it is done for s390_constant_via_vgm_p()
and s390_constant_via_vrepi_p().

gcc/ChangeLog:

PR target/118362
* config/s390/s390.cc (s390_constant_via_vgbm_p): Allow at most
16-byte vectors.

gcc/config/s390/s390.cc

index 918a2cd6c6dfa994902c3ff49be08c9fc569d575..08acb69de3e88398332b333d25f3ec85bf707cbc 100644 (file)
@@ -2818,7 +2818,7 @@ s390_constant_via_vgbm_p (rtx op, unsigned *mask)
   unsigned tmp_mask = 0;
   int nunit, unit_size;
 
-  if (GET_CODE (op) == CONST_VECTOR)
+  if (GET_CODE (op) == CONST_VECTOR && GET_MODE_SIZE (GET_MODE (op)) <= 16)
     {
       if (GET_MODE_INNER (GET_MODE (op)) == TImode
          || GET_MODE_INNER (GET_MODE (op)) == TFmode)