lkml.org 
[lkml]   [2004]   [Jan]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 28 Jan 2004 11:15:29 -0800
From"David S. Miller" <>
SubjectRe: long long on 32-bit machines
On Wed, 28 Jan 2004 14:12:50 -0500
Timothy Miller <miller@techsource.com> wrote:

> I don't know how it is for GCC, but when using the Sun compiler, "long 
> long" for 32-bit is low-high, while "long long" (or just long) for 
> 64-bit is high-low.  This has been an annoyance to me.  :)

For 64-bit it goes into a single 64-bit register.
And for 32-bit the sequence is high 32-bits low 32-bits.
At least on Sparc.

extern void foo(long long a);
void bar(void)
{
    foo(1);
}
/* gcc -m32 -S -o bar.s bar.c */
bar:
	!#PROLOGUE# 0
	save	%sp, -104, %sp
	!#PROLOGUE# 1
	mov	0, %o0
	mov	1, %o1
	call	foo, 0
	 nop
	nop
	ret
	restore
/* gcc -m64 -S -o bar.s bar.c */
bar:
	!#PROLOGUE# 0
	save	%sp, -192, %sp
	!#PROLOGUE# 1
	mov	1, %o0
	call	foo, 0
	 nop
	nop
	return	%i7+8
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:00    [from the cache]
©2003-2008