This is the mail archive of the gcc@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: A case where PHI-OPT pessimizes the code


On Mon, Apr 23, 2012 at 4:43 PM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Apr 23, 2012 at 02:50:13PM +0200, Steven Bosscher wrote:
>>   csui = (ONEUL << a);
>>   b = ((csui & cst) != 0);
>>   if (b)
>>     return 1;
>>   else
>>     return 0;
>
> We (powerpc) would be much better if this were
>
>   csui = (ONEUL << a);
>   return (csui & cst) >> a;
>
> Other targets would probably benefit too.

Yes, this has been discussed before. See here:

  http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01791.html
  http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01950.html

However, like Roger, I would prefer to not implement this right now. I
only want to port the code from stmt.c to GIMPLE, at least initially.
Later on, we could look at different code generation approaches for
this kind of switch() statement.

Ciao!
Steven


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