This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PDP-10 backend for gcc
- To: law at cygnus dot com
- Subject: Re: PDP-10 backend for gcc
- From: lars brinkhoff <lars at nocrew dot org>
- Date: 01 Sep 2000 11:16:06 +0200
- Cc: Alan Lehotsky <lehotsky at tiac dot net>, gcc at gcc dot gnu dot org
- References: <9718.967737237@upchuck>
Jeffrey A Law <law@cygnus.com> writes:
> > Oh. But the back end MUST know whether it's operating on pointers or
> > integers. Byte pointer subtraction on a PDP-10 is much different from
> > integer subtraction. Basically, PDP-10 byte pointers are not are not
> > integers, at least not with respect to how arithmetic are performed on
> > them.
> You've got a significant problem then. You're most likely going to have
> to use something like PSImode or PDImode or something new to represent
> your pointers.
>
> Fundamentally GCC assumes that arithmetic on pointer types works just
> like arithmetic on integer types.
There are two kinds of pointers:
Word pointers. These are 30-bit values in 36-bit words, and are
used to point to anything at least one word in size. Integer
arithmetic works. I think PSImode will work here.
Byte[*] pointers. These are 36-bit values in 36-bit words. The
lower 30 bits is a word pointer, and the upper 6 bits is a code
to locate the byte (i.e. char or short) within the word pointed
to. Since normal ints are 36-bits, SImode can't be used for byte
pointers. Maybe a new mode will have to be invented?
[*] On a PDP-10 a "byte" is defined as any contigous bit field in a
36-bit word.