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

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
I think genmatch can handle calls to internal functions, the issue is with
guessing the return type. Maybe we could have a specific heuristic for these
functions in the case where the type is not explicitly specified.

(for cmp (lt ge)
     out (ne eq)
 (simplify
  (cmp (trunc_div:s integer_all_onesp @1) @0)
  (if (TYPE_UNSIGNED (TREE_TYPE (@0)) 
       && !VECTOR_TYPE_P (TREE_TYPE (@0)))
   (with { tree cpx = build_complex_type (TREE_TYPE (@0)); }
    (out 
     (imagpart (IFN_MUL_OVERFLOW:cpx @0 @1))
     { build_zero_cst (TREE_TYPE (@0)); })))))

(and the symmetric)

The approach seems fine to me.

Reply via email to