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]

Re: register indirect addressing in GCC


At 6:09 AM -0700 8/6/01, brahmaiah vallabhaneni wrote:
>.....
>
>  A register class containing these two regs is
>defined as  BASE_REGISTER_CLASS.
> and on my machine I can use accumulator  in register
>indirect  addressing i.e     (reg) with out
> displacement.But not in indexed addressing
>(reg+disp).
>
>  I am not able to use this register in the  register
>indirect addressing, because my BASE_REGISTER_CLASS
>does not include this register.


	I solved this problem for a port I did, but never got around to submitting a patch
	(bad boy, Alan!)

	Basically, what you have to do is

		1/ Add the accumulator to the BASE_REGISTER_CLASS
		2/ Make sure that GO_IF_LEGITIMATE_ADDRESS rejects any sums
			(except maybe CONSTs over a PLUS, as loading that into the accumulator
			may be cheap on your machine....

		3/ Fix the TWO places in reload.c that try to reload a simple pseudo-reg inside a MEM
		   to use the reg-class containing only the accumulator.

	What I did to accomplish 3/ was to do (in reload) added a LIMIT_BASE_REG_CLASS macro
	that replaced the BASE_REG_CLASS macro in TWO places.

	One is  in find_reloads that does reloads of nonoffsettable addresses, and the other is in find_reloads_address
	just a little way before the EGITIMIZE_RELOAD_ADDRESS that looks at everything else.  The reasoon
	your LRA macro doesn't solve the problem is that it NEVER gets the chance to fix the reload!.

	My LIMIT_BASE_REG_CLASS macro took the address we were reloading and just checked to see that
	it was valid as register indirect....



> Even though I am allowing this kind of addressing in
>my GO_IF_LEGITIMIZE_ADDRESS macro.
>This is my observation. Is there a way in which I can
>use my accumulator  in register indirect addressing.
>   Currently few tests give spill problems during
>reload. I think if I can take the advantage of this
>option I will be able to pass through those tests.


	Again, my apologies for not having diffs here, but I don't have access to the
	source tree any longer, and the port has not been publicly released

	- hope this helps....

	-- Alan
-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation


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