On Mon, Jun 20, 2011 at 8:43 PM, Andrew Pinski <pins...@gmail.com> wrote: > On Mon, Jun 20, 2011 at 7:19 AM, William J. Schmidt > <wschm...@linux.vnet.ibm.com> wrote: >> On Thu, 2011-06-16 at 09:49 -0700, Richard Henderson wrote: >>> On 06/16/2011 04:35 AM, Richard Guenther wrote: >>> > >>> > + /* Bit-field insertion needs several shift and mask operations. */ >>> > + case BIT_FIELD_EXPR: >>> > + return 3; >>> >>> ... depending on the target, of course. >>> >> >> Agreed -- this is a single-instruction operation on PowerPC. Probably >> need some target-specific weights here. > > It is also a single instruction on MIPS32R2 and MIPS64R2. So a target > hook is the best here rather than a constant number in the target hook > field.
Yeah, well. We have mostly no target dependency in those gimple statement speed/size cost metric, so the above 3 is matching how the expansion to gimple shift/mask stmts would measure. Richard. > Thanks, > Andrew Pinski >