public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Timothy Miller <miller@techsource.com>
Cc: hpa@zytor.com, klibc@zytor.com, linux-kernel@vger.kernel.org
Subject: Re: long long on 32-bit machines
Date: Wed, 28 Jan 2004 11:15:29 -0800	[thread overview]
Message-ID: <20040128111529.4debeb40.davem@redhat.com> (raw)
In-Reply-To: <401809B2.70907@techsource.com>

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

  reply	other threads:[~2004-01-28 19:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-28 18:04 long long on 32-bit machines H. Peter Anvin
2004-01-28 19:12 ` Timothy Miller
2004-01-28 19:15   ` David S. Miller [this message]
2004-01-29 11:02 ` Paul Mackerras
2004-01-31  6:08   ` H. Peter Anvin
2004-01-31 12:23     ` [klibc] " Arnd Bergmann
2004-01-31 19:41       ` H. Peter Anvin
2004-02-01  0:41     ` Paul Mackerras
  -- strict thread matches above, loose matches on Subject: below --
2004-01-28 19:22 Arnd Bergmann
2004-01-28 20:25 ` Daniel Jacobowitz
2004-01-28 20:51 Ulrich Weigand
2004-01-29  1:34 ` H. Peter Anvin
2004-01-29  9:19   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040128111529.4debeb40.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=hpa@zytor.com \
    --cc=klibc@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miller@techsource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox