]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000: Fix loop limit for built-in constant checking
authorPeter Bergner <bergner@linux.ibm.com>
Thu, 16 Jan 2025 16:49:45 +0000 (10:49 -0600)
committerPeter Bergner <bergner@linux.ibm.com>
Fri, 24 Jan 2025 15:23:11 +0000 (09:23 -0600)
The loop checking for built-in constant operand restrictions was missing
some operands due to the loop limit being too small.  Fixing that exposed
a testsuite failure which is caused by a typo in the pmxvi4ger8pp definition
where we had made the PMASK field too small.

2025-01-16  Peter Bergner  <bergner@linux.ibm.com>

gcc/
* config/rs6000/rs6000-builtin.cc (rs6000_expand_builtin): Use correct
array size for the loop limit.
* config/rs6000/rs6000-builtins.def: Fix field size for PMASK operand.

(cherry picked from commit 1a2d63a78f99b7fdc2eff5bf9065682d5bbbaaca)

gcc/config/rs6000/rs6000-builtin.cc
gcc/config/rs6000/rs6000-builtins.def

index f01f3aded36289375e44d457e9f35f62f0b4fdad..d467db29e8e38780c7f363915c6c44d7aa691001 100644 (file)
@@ -3584,7 +3584,7 @@ rs6000_expand_builtin (tree exp, rtx target, rtx /* subtarget */,
     }
 
   /* Check for restricted constant arguments.  */
-  for (int i = 0; i < 2; i++)
+  for (size_t i = 0; i < ARRAY_SIZE (bifaddr->restr); i++)
     {
       switch (bifaddr->restr[i])
        {
index d2c0565dc62304914064ca42c0e94a76bbe7a5ab..eca7ad2f5faedd48c2d5ba545c01fbe6fd457a43 100644 (file)
     PMXVI4GER8_INTERNAL mma_pmxvi4ger8 {mma}
 
   void __builtin_mma_pmxvi4ger8pp (v512 *, vuc, vuc, const int<4>, \
-                                   const int<4>, const int<4>);
+                                   const int<4>, const int<8>);
     PMXVI4GER8PP nothing {mma,quad,mmaint}
 
   v512 __builtin_mma_pmxvi4ger8pp_internal (v512, vuc, vuc, const int<4>, \
-                                            const int<4>, const int<4>);
+                                            const int<4>, const int<8>);
     PMXVI4GER8PP_INTERNAL mma_pmxvi4ger8pp {mma,quad}
 
   void __builtin_mma_pmxvi8ger4 (v512 *, vuc, vuc, const int<4>, \