public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org
Subject: Re: long long on 32-bit machines
Date: Wed, 28 Jan 2004 17:34:48 -0800	[thread overview]
Message-ID: <40186338.3010005@zytor.com> (raw)
In-Reply-To: <200401282051.VAA07809@faui1d.informatik.uni-erlangen.de>

Ulrich Weigand wrote:
> 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)
>  

If I remember correctly, a 6-argument system call on s390 will put a
pointer to the last two arguments as the effective 5th argument, so this
would not affect the system call calling convention, correct?

	-hpa


  reply	other threads:[~2004-01-29  1:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-28 20:51 long long on 32-bit machines Ulrich Weigand
2004-01-29  1:34 ` H. Peter Anvin [this message]
2004-01-29  9:19   ` Arnd Bergmann
  -- 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 18:04 H. Peter Anvin
2004-01-28 19:12 ` Timothy Miller
2004-01-28 19:15   ` David S. Miller
2004-01-29 11:02 ` Paul Mackerras
2004-01-31  6:08   ` H. Peter Anvin
2004-02-01  0:41     ` Paul Mackerras

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=40186338.3010005@zytor.com \
    --to=hpa@zytor.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weigand@i1.informatik.uni-erlangen.de \
    /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