public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Is it possible to port GCC backend to a architecture with very   limited hard registers?
@ 2010-03-17 14:01 redriver jiang
  2010-03-17 18:31 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: redriver jiang @ 2010-03-17 14:01 UTC (permalink / raw)
  To: gcc

Hi all,

Right now I attempts to port the GCC backend to a MCU with very
limited hard registers: only one 8 bit ACC reg, one 16 bit base reg
for addressing, one stats reg.
I searched the GCC backend porting, and seems 68HC1X has the similar
scene, but it use many "ram simulated" register. I wonder that if it
is possbile to provided thislimited 3 register to GCC bankend, and let
all 16bit(HImode), 32bit(SImode) operands spilled to stack.

Thanks!

Redriver

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is it possible to port GCC backend to a architecture with very   limited hard registers?
  2010-03-17 14:01 Is it possible to port GCC backend to a architecture with very limited hard registers? redriver jiang
@ 2010-03-17 18:31 ` Ian Lance Taylor
  2010-03-18 13:43   ` redriver jiang
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2010-03-17 18:31 UTC (permalink / raw)
  To: redriver jiang; +Cc: gcc

redriver jiang <jiang.redriver@gmail.com> writes:

> Right now I attempts to port the GCC backend to a MCU with very
> limited hard registers: only one 8 bit ACC reg, one 16 bit base reg
> for addressing, one stats reg.
> I searched the GCC backend porting, and seems 68HC1X has the similar
> scene, but it use many "ram simulated" register. I wonder that if it
> is possbile to provided thislimited 3 register to GCC bankend, and let
> all 16bit(HImode), 32bit(SImode) operands spilled to stack.

It should be possible, though it owuld not be easy to resolve all the
reload issues.  gcc will not generate particularly good code for such
a processor; you will see an awful lot of register shuffling.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is it possible to port GCC backend to a architecture with very   limited hard registers?
  2010-03-17 18:31 ` Ian Lance Taylor
@ 2010-03-18 13:43   ` redriver jiang
  0 siblings, 0 replies; 5+ messages in thread
From: redriver jiang @ 2010-03-18 13:43 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc

Ok. Thanks!

Then I will persuade the guys who develop the MCU to add one or more
base registers to ease the reload problem, and besides, I will add
some virtual registers( who are static "memory".) to hold 16,32 bit
mode variables.Hope these 2 solutions can make better codes. Now I
just begin to build a prototype porting.

2010/3/18 Ian Lance Taylor <iant@google.com>:
> redriver jiang <jiang.redriver@gmail.com> writes:
>
>> Right now I attempts to port the GCC backend to a MCU with very
>> limited hard registers: only one 8 bit ACC reg, one 16 bit base reg
>> for addressing, one stats reg.
>> I searched the GCC backend porting, and seems 68HC1X has the similar
>> scene, but it use many "ram simulated" register. I wonder that if it
>> is possbile to provided thislimited 3 register to GCC bankend, and let
>> all 16bit(HImode), 32bit(SImode) operands spilled to stack.
>
> It should be possible, though it owuld not be easy to resolve all the
> reload issues.  gcc will not generate particularly good code for such
> a processor; you will see an awful lot of register shuffling.
>
> Ian
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is it possible to port GCC backend to a architecture with very    limited hard registers?
  2010-03-17 14:10 Alan Lehotsky
@ 2010-03-17 15:01 ` Dave Hudson
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Hudson @ 2010-03-17 15:01 UTC (permalink / raw)
  To: Alan Lehotsky; +Cc: redriver jiang, gcc

We only had one real 8-bit accumulator on that port (the W register) which we did not expose the RA, instead exposing 32 "virtual" 8-bit registers from which we could construct 8, 16, 32 and 64-bit pairs.  The key to really good code generation was to aggresively split the larger pseudo-operations after reload and eliminate all possible redundancy.

The IP2k did have 2 offsettable address pointers though, one as a stack pointer and one as a data pointer which made the code much easier to manage (there was also one that wasn't offsettable and wasn't anywhere near as useful).  I can imagine that any code where there's only one address register is going to be very messy because it will be permenantly swapping  things in and out of it as things like register spills happen.


Cheers,
Dave


On 17 Mar 2010, at 14:01, Alan Lehotsky wrote:

> Almost certainly you will run into severe problems in the reload phase.
> 
> You might also profitably study the ip2k port.  This is a ALU machine, but it does have multiple
> address registers.
> 
> 
> -----Original Message-----
>> From: redriver jiang <jiang.redriver@gmail.com>
>> Sent: Mar 17, 2010 8:55 AM
>> To: gcc@gcc.gnu.org
>> Subject: Is it possible to port GCC backend to a architecture with very  	limited hard registers?
>> 
>> Hi all,
>> 
>> Right now I attempts to port the GCC backend to a MCU with very
>> limited hard registers: only one 8 bit ACC reg, one 16 bit base reg
>> for addressing, one stats reg.
>> I searched the GCC backend porting, and seems 68HC1X has the similar
>> scene, but it use many "ram simulated" register. I wonder that if it
>> is possbile to provided thislimited 3 register to GCC bankend, and let
>> all 16bit(HImode), 32bit(SImode) operands spilled to stack.
>> 
>> Thanks!
>> 
>> Redriver
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is it possible to port GCC backend to a architecture with very    limited hard registers?
@ 2010-03-17 14:10 Alan Lehotsky
  2010-03-17 15:01 ` Dave Hudson
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Lehotsky @ 2010-03-17 14:10 UTC (permalink / raw)
  To: redriver jiang, gcc

Almost certainly you will run into severe problems in the reload phase.

You might also profitably study the ip2k port.  This is a ALU machine, but it does have multiple
address registers.


-----Original Message-----
>From: redriver jiang <jiang.redriver@gmail.com>
>Sent: Mar 17, 2010 8:55 AM
>To: gcc@gcc.gnu.org
>Subject: Is it possible to port GCC backend to a architecture with very  	limited hard registers?
>
>Hi all,
>
>Right now I attempts to port the GCC backend to a MCU with very
>limited hard registers: only one 8 bit ACC reg, one 16 bit base reg
>for addressing, one stats reg.
>I searched the GCC backend porting, and seems 68HC1X has the similar
>scene, but it use many "ram simulated" register. I wonder that if it
>is possbile to provided thislimited 3 register to GCC bankend, and let
>all 16bit(HImode), 32bit(SImode) operands spilled to stack.
>
>Thanks!
>
>Redriver

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-18 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-17 14:01 Is it possible to port GCC backend to a architecture with very limited hard registers? redriver jiang
2010-03-17 18:31 ` Ian Lance Taylor
2010-03-18 13:43   ` redriver jiang
2010-03-17 14:10 Alan Lehotsky
2010-03-17 15:01 ` Dave Hudson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).