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

Re: Calculating instruction costs


Michael Matz wrote:
[...]
> As you didn't adjust any cost I would guess the high value comes from the 
> default implementation of address_cost, which simply uses arithmetic cost, 
> and the MULT in there is quite expensive by default.
> 
> See TARGET_ADDRESS_COST in several ports.

Oddly, TARGET_ADDRESS_COST is never being called for my port, but yes,
my not having implemented any costing appears to be fundamentally the issue.

After having done a bunch of reading up on how costing works, and
deciphering the rather cryptic other ports, my understanding is:

Costing is based entirely on analysis of the RTL, and is completely
irrelevant of what insns are selected. Therefore if my backend wants to
support certain optimised addressing modes, I need to insert code into
my TARGET_RTX_COSTS hook that looks for mem constructions which can be
represented by such addressing modes, and encourages the compiler to
select them by giving them a low cost. I don't get any assistance from
the patterns in the .md file.

Have I got that right?

-- 
ââââ ïïïïïïïïïïïïïï âââââ http://www.cowlark.com âââââ
â "USER'S MANUAL VERSION 1.0:  The information presented in this
â publication has been carefully for reliability." --- anonymous
â computer hardware manual

Attachment: signature.asc
Description: OpenPGP digital signature


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