RE: Double word left shift optimisation

2012-07-30 Thread Jon Beniston
This is interesting. I've quickly tried it out on the SH port. It can be accomplished with the combine pass, although there are a few things that should be taken care of: - an extendsidi2 pattern is required (so that the extension is not performed before expand) ... One potential

Re: Double word left shift optimisation

2012-07-27 Thread Segher Boessenkool
Hi Jon, I'd like to try to optimise double word left shifts of sign/zero extended operands if a widening multiply instruction is available. For the following code: long long f(long a, long b) { return (long long)a b; } I'd like to optimise this to something like: (long long) a * (1

Double word left shift optimisation

2012-07-26 Thread Jon Beniston
Hi, I'd like to try to optimise double word left shifts of sign/zero extended operands if a widening multiply instruction is available. For the following code: long long f(long a, long b) { return (long long)a b; } ARM, MIPS etc expand to a fairly long sequence

Re: Double word left shift optimisation

2012-07-26 Thread Ian Lance Taylor
On Thu, Jul 26, 2012 at 8:57 AM, Jon Beniston jon.benis...@ensilica.com wrote: I'd like to try to optimise double word left shifts of sign/zero extended operands if a widening multiply instruction is available. For the following code: long long f(long a, long b) { return (long long)a b;

Re: Double word left shift optimisation

2012-07-26 Thread Oleg Endo
On Thu, 2012-07-26 at 10:51 -0700, Ian Lance Taylor wrote: On Thu, Jul 26, 2012 at 8:57 AM, Jon Beniston jon.benis...@ensilica.com wrote: I'd like to try to optimise double word left shifts of sign/zero extended operands if a widening multiply instruction is available. For the following