This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: m68k reloc types


On Tue, Aug 17, 2004 at 10:54:05PM +0200, Andreas Schwab wrote:
> Well, there is a trade between using a addressing mode that wastes 4 bytes
> for every use and spilling a register here and there.

Hmm.  Well, perhaps what you want is

	(set (reg:SI tmp) (symbol_ref:SI "x"))
	(set (mem:SI (reg:SI tmp)) ...)

The address gets cse'd, if possible, but reload knows the value is
constant and so does not spill it -- merely regenerates it when 
needed.  In your assembly output routines you can render this as

	lea x(%pc), tmp

While the question of whether x@gotoff(%a5) would be better is a 
matter for some debate, only to be resolved by actual benchmarks,
the fact of the matter is that this relocation doesn't currently
exist, whereas the pc-relative one does.  And both forms are
unquestionably better than what we're currently generating.


r~


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