This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RTL for stackmachines


I've found this in the docs, reg-stack.c comments seems like this is what
I'm looking for, RTL needs registers some way and the output is just a
distance from the top of the stack. Hope this will know push/pop implicitly
https://gcc.gnu.org/onlinedocs/gccint/Stack-Registers.html#Stack-Registers


2017-11-15 17:03 GMT+01:00 Ábrahám Endre <abrahamendre9@gmail.com>:

> So I set up fake registers in target.h, and implement their behaviour with
> a stack logic?
> My binutils is already ported, how will this work with GAS not knowing
> whether i use registers or not?
>
> 2017-11-15 16:38 GMT+01:00 Jeff Law <law@redhat.com>:
>
>> On 11/15/2017 08:33 AM, Ábrahám Endre wrote:
>> > Hi,
>> > I'm trying to make a gcc backend for a stack machine, is there a way to
>> > disable register specific behaviour required by target.h, target.c? also
>> > all preserved names in the RTL language assume usages of operands (addm3
>> > mulm3 etc) which is not an option in my target, do I have to manually
>> set
>> > up new stack-based behaviour in the def?
>> I suspect the best way to go is to pretend you have a normal register
>> file up through the register allocator.  After register allocation
>> you'll want to convert to a stacked file.
>>
>> GCC already does this for the x87 floating point unit, so you could
>> probably generalize and build on top of that existing code (reg-stack.c).
>>
>> jeff
>>
>>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]