https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126455

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[16/17 Regression] Wrong    |[16/17 Regression] Wrong
                   |folding of (a < b) ^ (a >   |folding of (a < b) ^ (a >
                   |b) to a != b for FP vectors |b) to a != b for vector
                   |                            |(FP)
           Keywords|needs-bisection             |
      Known to work|15.2.1                      |

--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Oh I did but not for vector types:
/* Optimize (a CMP b) ^ (a CMP b)  */
/* Optimize (a CMP b) != (a CMP b)  */
(for op (bit_xor ne)
 (for cmp1 (lt lt lt le le le)
      cmp2 (gt eq ne ge eq ne)
      rcmp (ne le gt ne lt ge)
  (simplify
   (op:c (cmp1:c @0 @1) (cmp2 @0 @1))
   (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
      || POINTER_TYPE_P (TREE_TYPE (@0))
      || (VECTOR_TYPE_P (TREE_TYPE (@1))
      && expand_vec_cmp_expr_p (TREE_TYPE (@0), type, rcmp)))
    (rcmp @0 @1)))))

/* Optimize (a CMP b) == (a CMP b)  */
(for cmp1 (lt lt lt le le le)
     cmp2 (gt eq ne ge eq ne)
     rcmp (eq gt le eq ge lt)
 (simplify
  (eq:c (cmp1:c @0 @1) (cmp2 @0 @1))
  (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
                || POINTER_TYPE_P (TREE_TYPE (@0))
      || (VECTOR_TYPE_P (TREE_TYPE (@0))
      && expand_vec_cmp_expr_p (TREE_TYPE (@0), type,  rcmp)))
    (rcmp @0 @1))))


Well my patch didn't allow vector types. that was extended by
r16-2134-gf33cc3af8fd9c4 which didn't test for integral vector types.

Reply via email to