On 07/13/2011 06:13 AM, Andreas Krebbel wrote: > + force_operand (gen_rtx_fmt_ee (code, mode, > + gen_raw_REG (mode, LAST_VIRTUAL_REGISTER + 1), > + gen_raw_REG (mode, LAST_VIRTUAL_REGISTER + 2)), > + NULL_RTX); > + break; > + case 3: > + /* FMA expressions are not handled by force_operand. */ > + expand_ternary_op (mode, fma_optab, > + gen_raw_REG (mode, LAST_VIRTUAL_REGISTER + 1), > + gen_raw_REG (mode, LAST_VIRTUAL_REGISTER + 2), > + gen_raw_REG (mode, LAST_VIRTUAL_REGISTER + 3), > + NULL_RTX, false);
Why the force_operand? You've got register inputs. Either the target is going to support the operation or it isn't. Seems to me you can check the availability of the operation in the optab and pass that gen_rtx_fmt_ee result to rtx_cost directly. > + bool speed = optimize_bb_for_speed_p (gimple_bb (mul_stmt)); > + static unsigned mul_cost[NUM_MACHINE_MODES]; > + static unsigned add_cost[NUM_MACHINE_MODES]; > + static unsigned fma_cost[NUM_MACHINE_MODES]; ... > + if (!fma_cost[mode]) > + { > + fma_cost[mode] = compute_costs (mode, FMA, speed); > + add_cost[mode] = compute_costs (mode, PLUS, speed); > + mul_cost[mode] = compute_costs (mode, MULT, speed); > + } Saving cost data dependent on speed, which is non-constant. You probably need to make this a two dimensional array. r~