This is the mail archive of the
mailing list for the GCC project.
Re: register indirect addressing in GCC
- To: brahmaiah vallabhaneni <vbrahmaiah at yahoo dot com>
- Subject: Re: register indirect addressing in GCC
- From: Alan Lehotsky <apl at alum dot mit dot edu>
- Date: Mon, 6 Aug 2001 10:23:11 -0400
- Cc: gcc at gcc dot gnu dot org
- References: <firstname.lastname@example.org>
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
> 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....
Quality Software Management
Software Process Improvement and Management Consulting
Language Design and Compiler Implementation