[prev in list] [next in list] [prev in thread] [next in thread]
List: pcc-list
Subject: Re: Porting problems
From: Anders Magnusson <ragge () ludd ! ltu ! se>
Date: 2009-07-24 8:09:14
Message-ID: 4A696C2A.6050404 () ludd ! ltu ! se
[Download RAW message or body]
Peter Kuschnerus wrote:
> Hello,
>
Good morning!
> I have in my ISA several different sized immediate constants,
> I have several different sized offsets for regs (OREG),
> I have several different sized jump-offsets.
>
> The immediate constants I solved by defining some special shapes.
>
> To handle OREGs I would like to do similar as with constants,
> but I found only the routines notoff and myormake in order.c
> This routine checks only one size of OREG,
> but I would like to choose one of several as I do with constants.
>
Just so I understand the problem: You need to emit different OREG
instructions depending on the offset? I would do that just by
using a Z selection in the table entry, and then check the size
when it's time to emit the instruction (in zzzcode()).
> Is there any way to do so ?
> Can shapes be applied to OREGs,
> or can there be severeal different OREGs ?
>
> Finaly jump-offsets.
> Jump-offsets are for the position of the jump-target
> relative to the current position.
> As the position and the distance is not yet known
> at the time of choosing the jump-instruction,
> I think this can only be optimized afterwards.
>
> Is there any concept for this issue in pcc ?
>
Usually all of this is done in the assembler later on,
when all sizes are known. pcc relies on this, as most
unix c compiler does.
If you, by some reason must do it this way, I would write
a small post-processor for the assembler that can take care
of the size calculations. Could probably be done in awk for
simplicity.
pcc has traditionally had a peephole optimizer (c2) that
could be used for this kind of things. It would be possible
to plug-in the post-processor as c2.
-- Ragge
> Regards,
> Peter Kuschnerus
>
>
>
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic