Re: long long on 32-bit machines

From: Ulrich Weigand
Date: Wed Jan 28 2004 - 15:51:56 EST


Arnd Bergmann wrote:

>Some architectures require long long arguments to be passed as an
>even/odd register pair. For example on s390,
>
> void f(int a, int b, long long x)
>
>uses registers 2, 3, 4 and 5, while
>
> void f(int a, long long x, int b)
>
>uses registers 2, 4, 5 and 6.

Actually, this isn't quite true -- the second case will also
use registers 2, 3, 4, and 5.

However, there is still a case where a single long long is
passed differently from a pair of longs: when there is only
a single register remaining for parameters.

This means that
void f(int a, int b, int c, int d, long e, long f)
is passed as
a-d in register 2-5
e in register 6
f on the stack (4 bytes)

while
void f(int a, int b, int c, int d, long long e)
is passed as
a-d in register 2-5
nothing in register 6
e on the stack (8 bytes)

Bye,
Ulrich

--
Dr. Ulrich Weigand
weigand@xxxxxxxxxxxxxxxxxxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/