]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end/110541 - VEC_PERM_EXPR documentation is off
authorRichard Biener <rguenther@suse.de>
Wed, 5 Jul 2023 06:53:01 +0000 (08:53 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 5 Jul 2023 07:44:24 +0000 (09:44 +0200)
The following adjusts the tree.def documentation about VEC_PERM_EXPR
which wasn't adjusted when the restrictions of permutes with constant
mask were relaxed.

PR middle-end/110541
* tree.def (VEC_PERM_EXPR): Adjust documentation to reflect
reality.

gcc/tree.def

index 1fc2ca7a7249d4767aa2448219bc21a8c650aeb4..be94b7ece0a727903b2fe06240e74e6a8dcf8427 100644 (file)
@@ -565,13 +565,18 @@ DEFTREECODE (VEC_COND_EXPR, "vec_cond_expr", tcc_expression, 3)
 
    N = length(mask)
    foreach i in N:
-     M = mask[i] % (2*N)
-     A = M < N ? v0[M] : v1[M-N]
+     M = mask[i] % (length(v0) + length(v1))
+     A[i] = M < length(v0) ? v0[M] : v1[M - length(v0)]
 
-   V0 and V1 are vectors of the same type.  MASK is an integer-typed
-   vector.  The number of MASK elements must be the same with the
-   number of elements in V0 and V1.  The size of the inner type
-   of the MASK and of the V0 and V1 must be the same.
+   V0 and V1 are vectors of the same type.
+
+   When MASK is not constant:
+     MASK is an integer-typed vector.  The number of MASK elements must
+     be the same as the number of elements in V0 and V1.  The size of
+     the inner type of the MASK and of the V0 and V1 must be the same.
+
+   When MASK is constant:
+     MASK is an integer-typed vector.
 */
 DEFTREECODE (VEC_PERM_EXPR, "vec_perm_expr", tcc_expression, 3)