On Tue, Jan 25, 2022 at 01:28:29PM -0300, Raoni Fassina Firmino wrote:
> Below is a patch to do just that. In preliminary tests it seems to work.
> What do you think aboud it Jakub?

Ok for trunk.

> > These days the usual way of doing this is through
> > maybe_expand_insn and create_{output,input}_operand before that.
> 
> I looked into maybe_expand_insn, if I undestood correctly in my reading
> of maybe_expand_insn I could remove mostly if not all code in
> expand_builtin_feclear_feraise_except with it, even the validate_arglist
> part in the beginning?

validate_arglist should be still performed.  But maybe_expand_insn +
create_*_operand will take care of checking the predicates etc.

> --- a/gcc/builtins.cc
> +++ b/gcc/builtins.cc
> @@ -2598,6 +2598,9 @@ expand_builtin_feclear_feraise_except (tree exp, rtx 
> target,
>    if (icode == CODE_FOR_nothing)
>      return NULL_RTX;
>  
> +  if (!(*insn_data[icode].operand[1].predicate) (op0, GET_MODE(op0)))
> +    return NULL_RTX;
> +
>    if (target == 0
>        || GET_MODE (target) != target_mode
>        || !(*insn_data[icode].operand[0].predicate) (target, target_mode))
> -- 
> 2.34.1

        Jakub

Reply via email to