register parameter passing and library calls
apl@alum.mit.edu
apl@alum.mit.edu
Tue Sep 18 06:34:00 GMT 2001
I'm working with a machine that has separate address and data registers
and evaluating changing the calling conventions to pass pointers
directly in the pointer registers instead of moving them into the
normal data-registers and then moving them back into address
registers in the callee.
This is kinda like some calling conventions on the Motorola
68k, which had A and D registers. Unfortunately, gcc doesn't
seem to support these conventions.
The problem I've run into is that memcpy() is called for block moves
and emit_library_call() ends up without the parameter type information
needed to know that the first two parameters are "void *" and should
be passed in ptr1 and ptr2. Of course, when the function is compiled,
it has a function-prototype that tells the compiler to expect the
source and destination addresses to be passed in the pointer
registers.
Anybody else have a solution to this?
I suppose I could replace ALL the library functions with hand-compiled
assembler language (and change the names of the library functions),
but that would not be a very palatable strategy IMHO.
Al Lehotsky
More information about the Gcc
mailing list