This adds an implementation of the insn_cost hook to rs6000.
This implementations is very minimal (so far). It is mostly based on
how many machine instructions are generated by an RTL insn, and it also
looks at the instruction type. Floating point insns are costed as if
all machine instructions it generates are floating point; the other
insns are treated as if all but one are integer insns (and one is the
specified type). Load instructions are treated as costing twice as
much, and load locked and sync insns as three times as much (just like
the original costs), and integer div and mul are handled as well.
Each define_insn (etc.) can set a "cost" attribute to override this
general cost. With optimization for size, the cost is set equal to the
value of the "length" attribute.
With this, the majority of cost differences between old and new are
where the old was wrong. Also, benchmarks show a slight win (if
anything). Some refinements are obviously needed.
* config/rs6000/rs6000.c (TARGET_INSN_COST): New.
(rs6000_insn_cost): New function.
* config/rs6000/rs6000.md (cost): New attribute.