On Mon, Apr 23, 2012 at 4:43 PM, Alan Modra <amo...@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