This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, FT32] initial support
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Andrew Pinski <pinskia at gmail dot com>, James Bowman <james dot bowman at ftdichip dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 03 Feb 2015 15:44:49 +0100
- Subject: Re: [PATCH, FT32] initial support
- Authentication-results: sourceware.org; auth=none
- References: <CA9BBF0458F83C4F9051448B941B57D117152C33 at glaexch1> <CA+=Sn1mQwV22HfYrX2fC-RuhS0-e+u+wZ8NZoH33CFnmsGOmtQ at mail dot gmail dot com>
On 03/02/2015 07:05, Andrew Pinski wrote:
> Likewise of:
> +(define_insn "abssi2"
> + [(set (match_operand:SI 0 "register_operand" "=r")
> + (abs:SI (match_operand:SI 1 "register_operand" "r")))
> + (clobber (match_scratch:SI 2 "=&r"))]
> + ""
> + "ashr.l\t%2,%1,31\;xor.l\t%0,%1,%2\;sub.l\t%0,%0,%2")
>
optabs.c's expand_abs_nojump already knows this trick:
/* If this machine has expensive jumps, we can do integer absolute
value of X as (((signed) x >> (W-1)) ^ x) - ((signed) x >> (W-1)),
where W is the width of MODE. */
So if you define BRANCH_COST to be 2 or more there should be no need for
this pattern at all.
Paolo