This is the mail archive of the gcc-cvs@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]

r253624 - in /trunk/gcc: ChangeLog config/rs600...


Author: segher
Date: Wed Oct 11 00:11:23 2017
New Revision: 253624

URL: https://gcc.gnu.org/viewcvs?rev=253624&root=gcc&view=rev
Log:
rs6000: insn_cost

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.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/config/rs6000/rs6000.md


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