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]

Re: Abstracting pointer arithmetic


    I'm writing a back end for a word-adressed machine.  For this machine,
    pointer arithmetic doesn't quite work like integer arithmetic.
    Pointers to sub-word objects have a word address in the low bits, and
    a byte selector in the top bits, and are incremented using a special
    instruction.  Subtracting or comparing these pointers takes several
    instructions.  Pointers to words are incremented by adding 1*<number
    of words>, not 4*<number of words>, but otherwise behave as integers.

    It seems to be that the back end would have to handle or provide
    information about a few pointer operations.

For *those* machines you can define Pmode as a different class.  I thought
you were proposing doing it for *all* machines in order to support those.

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