This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ARM cmpsi2_addneg fixes (PR target/89506)


On Fri, Mar 01, 2019 at 05:04:24PM +0100, Jakub Jelinek wrote:
> +  /* For 0 and INT_MIN it is essential that we use subs, as adds
> +     will result in different condition codes (like cmn rather than
> +     like cmp).  Both alternatives can match also for -1/1 with
> +     TARGET_THUMB2, prefer instruction with #1 in that case as it
> +     is shorter.  */
> +  if (which_alternative == 0 && operands[1] != const1_rtx)
				   ^^^ operands[3] != const1_rtx
				    or operands[2] != constm1_rtx.
Sorry.

> +    return "subs%?\\t%0, %1, #%n3";
> +  else
> +    return "adds%?\\t%0, %1, %3";
> +}
>    [(set_attr "conds" "set")
>     (set_attr "type" "alus_sreg")]
>  )

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]