From: Shachar Shemesh <lkml@shemesh.biz>
To: Jamie Lokier <jamie@shareable.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] new system call mknod64
Date: Tue, 22 Apr 2003 11:24:54 +0300 [thread overview]
Message-ID: <3EA4FC56.3070407@shemesh.biz> (raw)
In-Reply-To: <20030421235009.GC17595@mail.jlokier.co.uk>
Jamie Lokier wrote:
>It varies very much between architectures.
>
>I just checked, and simple copies of this structure are absolutely
>atrocious in GCC 3.2 (I tried Alpha, Mips64 and Sparc64). The code
>was approx. 3 times longer to copy the 32:32 struct than to copy a 64
>bit scalar.
>
>
Last time I had access to gcc on sparc, copying a struct where the
compiler guessed that non-aligned access may occure produced code that
was guarenteed not to crash the program. This was tested in user mode,
in 32 bit, but still...
Copying a struct with two 32 bit values does not prove to the compiler
that it will be 64bit aligned. It is therefor reasonable for the
compiler to assume it needs two 32 bit transfers, rather than one 64 bit
transfer. Try adding "#pragme align 8", or whatever it is called, and
seeing if this inefficiency goes away.
>On x86_64, the struct produces the same code as the scalar.
>The same is true on s390x.
>
>
I don't know how x86_64 is doing, but x86 does not issue a bus error
when unaligned value is being accessed. It is therefor reasonable for
the compiler not to worry about it. If x86_64 is the same, the results
you report seem like a reasonable feature of gcc, rather than a bug.
Shachar
--
Shachar Shemesh
Open Source integration consultant
Home page & resume - http://www.shemesh.biz/
next prev parent reply other threads:[~2003-04-22 8:13 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-21 21:43 [PATCH] new system call mknod64 Andries.Brouwer
2003-04-21 23:02 ` H. Peter Anvin
2003-04-21 23:50 ` Jamie Lokier
2003-04-22 8:24 ` Shachar Shemesh [this message]
[not found] <20030421215009$2052@gated-at.bofh.it>
[not found] ` <20030421231010$7ee3@gated-at.bofh.it>
[not found] ` <20030422000016$17e3@gated-at.bofh.it>
[not found] ` <20030422083014$0fe2@gated-at.bofh.it>
2003-04-22 20:02 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2003-04-22 1:02 Andries.Brouwer
2003-04-22 1:32 ` H. Peter Anvin
2003-04-22 2:01 ` Jamie Lokier
2003-04-22 2:52 ` H. Peter Anvin
2003-04-22 6:00 ` jw schultz
2003-04-22 17:17 ` H. Peter Anvin
2003-04-21 21:48 Andries.Brouwer
2003-04-21 22:07 ` Linus Torvalds
2003-04-20 22:12 Andries.Brouwer
2003-04-21 6:31 ` H. Peter Anvin
2003-04-20 21:26 Andries.Brouwer
2003-04-20 21:43 ` David S. Miller
2003-04-20 21:56 ` Linus Torvalds
2003-04-21 11:59 ` Roman Zippel
2003-04-21 18:01 ` Linus Torvalds
2003-04-21 18:10 ` Christoph Hellwig
2003-04-21 18:21 ` viro
2003-04-21 18:22 ` Linus Torvalds
2003-04-21 18:27 ` viro
2003-04-21 18:35 ` Linus Torvalds
2003-04-21 18:54 ` viro
2003-04-21 19:16 ` Jörn Engel
2003-04-21 18:35 ` Christoph Hellwig
2003-04-21 18:42 ` H. Peter Anvin
2003-04-21 18:44 ` Linus Torvalds
2003-04-21 18:47 ` Christoph Hellwig
2003-04-21 18:58 ` viro
2003-04-21 19:05 ` Linus Torvalds
2003-04-21 19:35 ` viro
2003-04-21 20:02 ` Linus Torvalds
2003-04-21 19:04 ` Linus Torvalds
2003-04-21 19:59 ` H. Peter Anvin
2003-04-21 18:51 ` H. Peter Anvin
2003-04-21 23:49 ` Roman Zippel
2003-04-20 20:34 Andries.Brouwer
2003-04-20 21:12 ` David S. Miller
2003-04-20 18:39 Andries.Brouwer
2003-04-20 18:52 ` Christoph Hellwig
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=3EA4FC56.3070407@shemesh.biz \
--to=lkml@shemesh.biz \
--cc=hpa@zytor.com \
--cc=jamie@shareable.org \
--cc=linux-kernel@vger.kernel.org \
/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