diff mbox series

[SPARC] Fix PR target/105292

Message ID 4710281.GXAFRqVoOG@fomalhaut
State New
Headers show
Series [SPARC] Fix PR target/105292 | expand

Commit Message

Eric Botcazou May 10, 2022, 7:49 a.m. UTC
This is a regression present since the 10.x series, but the underlying issue 
has been there since the TARGET_VEC_PERM_CONST hook was implemented, in the 
form of an ICE when expanding a constant VEC_PERM_EXPR in V4QI, while the 
back-end only supports V8QI constant VEC_PERM_EXPRs.

Tested on SPARC/Solaris, applied to all active branches.


2022-05-10  Eric Botcazou  <ebotcazou@adacore.com>

	PR target/105292
	* config/sparc/sparc.cc (sparc_vectorize_vec_perm_const): Return
	true only for 8-byte vector modes.


2022-05-10  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.target/sparc/20220510-1.c: New test.
diff mbox series

Patch

diff --git a/gcc/config/sparc/sparc.cc b/gcc/config/sparc/sparc.cc
index 467a9f171d2..aca925befe1 100644
--- a/gcc/config/sparc/sparc.cc
+++ b/gcc/config/sparc/sparc.cc
@@ -13041,9 +13041,9 @@  sparc_vectorize_vec_perm_const (machine_mode vmode, rtx target, rtx op0,
   if (!TARGET_VIS2)
     return false;
 
-  /* All permutes are supported.  */
+  /* All 8-byte permutes are supported.  */
   if (!target)
-    return true;
+    return GET_MODE_SIZE (vmode) == 8;
 
   /* Force target-independent code to convert constant permutations on other
      modes down to V8QI.  Rely on this to avoid the complexity of the byte