From: David Woodhouse <dwmw2@infradead.org>
To: Michael Neuling <mikey@neuling.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
viro@zeniv.linux.org.uk, Linux PPC dev <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] powerpc: provide __bswapdi2
Date: Tue, 14 May 2013 07:59:05 +0100 [thread overview]
Message-ID: <1368514745.3490.10.camel@shinybook.infradead.org> (raw)
In-Reply-To: <CAEjGV6yR+GSwu_CZWSLrL8q8D-AM7yi3685fq9vgjt9MN7HPTA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]
On Tue, 2013-05-14 at 11:25 +1000, Michael Neuling wrote:
>
> > So, if we are just stealing the output of gcc, why not just use the C
> > version (at least for 32 bit)?
>
> Woodhouse: can we just do this?
Sure, if you don't mind GCC optimising the contents of your C function
by turning it into a call to libgcc's __bswapdi2() :)
OK, you might be able to do some archaeology and determine that the only
compiler that emits calls to __bswapdi2() is GCC 4.4, and furthermore
that the same compiler *doesn't* have the wit to notice that the
contents of the function are a 64-bit byteswap, so it's never going to
happen. But I don't like that approach. I'd feel I have to sacrifice a
goat *anyway*, and I don't have a spare goat.
Although now I come to explicitly explain why I did it that way... it
occurs to me that the libgcc version is just written in C, and the
compiler evidently trusts itself not to optimise that into a recursive
call. Is there a compiler switch which guarantees that, which we could
use without other unwanted side-effects?
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5745 bytes --]
prev parent reply other threads:[~2013-05-14 6:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 21:18 [PATCH] powerpc: provide __bswapdi2 David Woodhouse
2013-05-13 6:48 ` Anton Blanchard
2013-05-13 7:20 ` Alan Modra
2013-05-13 10:27 ` David Woodhouse
2013-05-13 16:47 ` Segher Boessenkool
2013-05-13 7:09 ` Michael Neuling
2013-05-13 7:20 ` [PATCH v2] " Michael Neuling
2013-05-13 7:33 ` [PATCH] " Gabriel Paubert
2013-05-13 10:23 ` [PATCH v3] " Michael Neuling
2013-05-13 10:33 ` [PATCH] " David Woodhouse
2013-05-13 10:38 ` David Woodhouse
2013-05-13 10:51 ` Joakim Tjernlund
2013-05-13 11:12 ` Joakim Tjernlund
2013-05-13 13:12 ` Gabriel Paubert
2013-05-13 16:55 ` Segher Boessenkool
2013-05-14 1:09 ` Stephen Rothwell
2013-05-14 1:25 ` Michael Neuling
2013-05-14 6:59 ` David Woodhouse [this message]
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=1368514745.3490.10.camel@shinybook.infradead.org \
--to=dwmw2@infradead.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=sfr@canb.auug.org.au \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).