From: Josh Triplett <josh@joshtriplett.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Add GCC's byteswap intrinsics
Date: Thu, 13 Dec 2012 08:11:19 -0800 [thread overview]
Message-ID: <20121213161119.GA8149@leaf> (raw)
In-Reply-To: <1355406304.19560.39.camel@shinybook.infradead.org>
On Thu, Dec 13, 2012 at 01:45:04PM +0000, David Woodhouse wrote:
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
> ---
> I'm about to make the kernel use these:
> http://git.infradead.org/users/dwmw2/byteswap.git
>
> lib.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/lib.c b/lib.c
> index 396e9f1..d747a3e 100644
> --- a/lib.c
> +++ b/lib.c
> @@ -698,6 +698,11 @@ void declare_builtin_functions(void)
> add_pre_buffer("extern int __builtin_popcountl(unsigned long);\n");
> add_pre_buffer("extern int __builtin_popcountll(unsigned long long);\n");
>
> + /* And byte-swapping operations.. */
> + add_pre_buffer("extern short __builtin_bswap16(short);\n");
> + add_pre_buffer("extern int __builtin_bswap32(int);\n");
> + add_pre_buffer("extern long long __builtin_bswap64(long long);\n");
GCC defines these to use int16_t, int32_t, and int64_t, respectively.
The first two of those should match up to "short" and "int" without any
issue, but on 64-bit platforms, stdint.h defines int64_t as "long", not
"long long". That could lead to some type incompatibilities.
- Josh Triplett
next prev parent reply other threads:[~2012-12-13 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-13 13:45 [PATCH] Add GCC's byteswap intrinsics David Woodhouse
2012-12-13 16:11 ` Josh Triplett [this message]
2012-12-13 16:29 ` David Woodhouse
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=20121213161119.GA8149@leaf \
--to=josh@joshtriplett.org \
--cc=dwmw2@infradead.org \
--cc=linux-sparse@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;
as well as URLs for NNTP newsgroup(s).