Hello, Frank,
Here is a quick, simple example; just to make sure I understand your question:
>amode64.c compile amode64
long long foo (long long) __attribute__((amode31));
int main () {
long long a = 2147483647;
if (a = foo(a)) {
return 55;
} else {
return 66;
}
}
>amode64_32.c
long long foo (long long a) {
long long b;
__asm(" LLGF %0,%1\n":"=r"(b):"r"(a));
return b;
}
xlc -qMETAL -S -q64 amode64.c
xlc -qMETAL -S amode64_32.c
Does this example look like the kind of thing you want to do? If yes, then compiler in the "31 PROLOG" and "31 bit EPILOG" of amode64_32.s saves and restores the high halves of those registers that it clobbers via STMH and LMH instructions respectively.
Does that answer your question?
I'd like to add that if you are calling a function that is not compiled with MetalC, for example an assembler program, then you are responsible for preserving the high halves of the registers.
Please, let me know if you have more questions and/or comments.
Thanks.
Visda