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] Tweak signed division by power of two


On Tue, Jul 13, 2004 at 04:56:11PM -0600, Roger Sayle wrote:
> Given that the Pentium4
> has a shift cost of COSTS_N_INSNS(4), would you be happy changing
> the above test to:
> 
>    if (shift_cost[mode][ushift] >= COSTS_N_INSNS (2))

Not really, since "and $1, 7, $1" is COSTS_N_INSNS (1).

We *really do* want to know the cost of the immediate;
it can be up to COSTS_N_INSNS (3).

> With the proposed ammendment above, this patch should now generate
> alpha/x86 code atleast as good as originally, and in the case of EV4
> and Pentium4 even better than we were doing before.
> 
> Ok for mainline with the above change?

I'm ok with committing the patch as-is and iterating.


r~


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