/* CSINV/NEG with zero extend + const 0 (*csinv3_uxtw_insn3). */
op1 = XEXP (inner, 0);
}
+ else if (op1 == constm1_rtx || op1 == const1_rtx)
+ {
+ /* Use CSINV or CSINC. */
+ *cost += rtx_cost (op2, VOIDmode, IF_THEN_ELSE, 2, speed);
+ return true;
+ }
+ else if (op2 == constm1_rtx || op2 == const1_rtx)
+ {
+ /* Use CSINV or CSINC. */
+ *cost += rtx_cost (op1, VOIDmode, IF_THEN_ELSE, 1, speed);
+ return true;
+ }
*cost += rtx_cost (op1, VOIDmode, IF_THEN_ELSE, 1, speed);
*cost += rtx_cost (op2, VOIDmode, IF_THEN_ELSE, 2, speed);
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-vectorize" } */
+
+int f(int *a, int n, int *b, int d)
+{
+ for(int i = 0; i < n; i++)
+ b[i] = a[i] == 100 ? 1 : d;
+ /* { dg-final { scan-assembler "csinc\tw\[0-9\].*wzr" } } */
+ return 0;
+}