8-bit processors back-end optimizations
Christian Iseli
chris@lslsun.epfl.ch
Mon Sep 1 02:29:00 GMT 1997
Hi folks,
I'm currently porting GCC (and other GNU tools) to an 8-bit processor and
I was wondering about a few things:
- Are there a lot of ports of GCC to 8-bit back-ends and where can I find them?
- Are there people working on optimizing things for 8-bit processors?
There is at least one area for which I'll try to come up with a specific optimization,
provided it's not been done already: namely size extension. As you probably know,
ANSI C specifies that the char (usually 8-bit) type be extended to int before being
used to do computations. This often leads to constructs of the form:
(set (reg:HI ExtA) (sign_extend:HI (reg:QI A)))
(set (reg:HI ExtB) (sign_extend:HI (reg:QI B)))
(set (reg:HI ExtC) (some_operation:HI (reg:HI ExtA) (reg:HI ExtB)))
(set (reg:QI C) (subreg:QI (reg:HI ExtC) 1))
which can usually be rewritten:
(set (reg:QI C) (some_operation:QI (reg:QI A) (reg:QI B)))
So, has somebody else gone to the trouble already?
I have another question, while I'm at it... When GCC notices that it has to spill
things and puts stuff in stack slots: does it do any kind of effort to minimize the
number of stack slots used (or in other words, does a stack slot get reused for
multiple spills)? I must admit the reload pass is rather obscure to me...
In case there is currently no attempt to minimize stack space: some sort of
stack slot allocation similar to register allocation might be nice for small
targets with very limited amount of memory.
More information about the Gcc
mailing list