On 5 Jul 2004, Geoffrey Keating wrote:
At the moment, however, such optimization is premature;
the rs6000 backend still thinks that "nand" and "nor" require
two instructions, ...
Here's a thought. The .md file already contains all the information
needed to get a nearly-perfect RTX_COSTS macro in the -Os case. So
does the .md file for most other ports. Would it be possible to use
that information?
In theory, it might be possible to write a genrtxcosts.c that looked
at both the define_insn's length attribute and even the DFA pipeline
description's latency for an insn's "type" attribute and generated
a default TARGET_RTX_COST for a backend. However, this approach
would require all backends to be updated to the new DFA pipeline
descriptions, all of them to use the "length" attribute consistently,
and all of the pipeline timings to be at least as accurate as the
currently hand-crafted rtx_cost functions.