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: Porting GCC to Zilog z80


Alexander Aganichev wrote:
I'm playing with the gcc patches made by Brahmaiah Vallabhane. I have ported them to gcc 3.2.3 and cleaned up. I'm aware of copyright problem, but this is not currently
an issue since I plan to rewrite them once the GCC architecture will be clear to me.

If you are basing your port on an earlier one, then your port will be a derivitive work, and we would still need copyright assignments for the earlier port. Rewriting the port helps, but you need to be careful not to copy anything from the earlier port. You need to start from scratch with your own port.


So, the question: should BC, DE, and HL registers be defined for the compiler as
16-bit or as splitted 8-bit?

I think they need to be 8-bit registers, accessed as pairs for 16-bit values. gen_highpart will give you a subreg that refers to the high part of a register, but it is uncommon to use this as an operand. There is also the problem that gen_highpart is allowed to emit RTL. It isn't a function for accessing the high part of a register. It is a function for emitting code to access the value in the high part of a register which is not quite the same thing. If you must have the B register, then gen_highpart (BC) isn't safe. gen_highpart might move the value someplace else before returning it to you.


Jim


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