if (!get_gather_index_mode (d).exists (&sel_mode))
return false;
+ rtx sel = vec_perm_indices_to_rtx (sel_mode, d->perm);
+ poly_uint64 nunits = GET_MODE_NUNITS (sel_mode);
+ rtx elt;
+
+ bool is_simple = d->one_vector_p
+ || const_vec_duplicate_p (sel, &elt)
+ || (nunits.is_constant ()
+ && const_vec_all_in_range_p (sel, 0, nunits - 1));
+
+ if (!is_simple && !riscv_two_source_permutes)
+ return false;
+
/* Success! */
if (d->testing_p)
return true;
- rtx sel = vec_perm_indices_to_rtx (sel_mode, d->perm);
/* Some FIXED-VLMAX/VLS vector permutation situations call targethook
instead of expand vec_perm<mode>, we handle it directly. */
expand_vec_perm (d->target, d->op0, d->op1, sel);
Target Undocumented RejectNegative Joined Enum(vsetvl_strategy) Var(vsetvl_strategy) Init(VSETVL_OPT)
-param=vsetvl-strategy=<string> Set the optimization level of VSETVL insert pass.
+-param=riscv-two-source-permutes
+Target Undocumented Uinteger Var(riscv_two_source_permutes) Init(0)
+-param=riscv-two-source-permutes Enable permutes with two source vectors.
+
Enum
Name(stringop_strategy) Type(enum stringop_strategy_enum)
Valid arguments to -mstringop-strategy=:
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-fre1" } */
+/* { dg-additional-options "--param=riscv-two-source-permutes" { target riscv*-*-* } } */
typedef int veci __attribute__ ((vector_size (4 * sizeof (int))));
typedef unsigned int vecu __attribute__ ((vector_size (4 * sizeof (unsigned int))));
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-dse1 -Wno-psabi" } */
+/* { dg-additional-options "--param=riscv-two-source-permutes" { target riscv*-*-* } } */
typedef int veci __attribute__ ((vector_size (4 * sizeof (int))));