Using registers as a queue
James E Wilson
wilson@specifixinc.com
Wed Sep 1 20:16:00 GMT 2004
Pavel Boytchev wrote:
> IÂ’m porting GCC to a new processor. IÂ’m looking for ideas how to force
> registers act like a queue.
You can get consecutive registers by using larger modes, and then using
subregs. Assuming you have 32-bit registers, you can allocate a TImode
(128-bit) pseudo-reg, which will give you 4 consecutive registers, and
then use subregs to get the individual registers. However, I seriously
doubt that this helps you.
Otherwise, if you have a special register file with special accessing
needs, then you just have to write a machine dependent pass that fixes
what the register allocator gave you. The reg-stack.c file for instance
does this for the x86 FP register stack. It rewrites the
flat-register-file allocation that we get from the register allocator
into a stack-register-file allocation. You could try doing something
similar for your target, though this is likely quite a bit of work.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list