From: Matthew Wilcox <matthew@wil.cx>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org, Alexander Viro <viro@math.psu.edu>
Subject: [PATCH] Use optimised byteswap again
Date: Mon, 1 Nov 2004 03:08:10 +0000 [thread overview]
Message-ID: <20041101030810.GH8958@parcelfarce.linux.theplanet.co.uk> (raw)
Looks like Al's patch to sparsify the byteorder code prevented use of the
assembler-optimised code. Not that I can blame him -- three underscores
are C-coded and two underscores are assembly-optimised.
Index: linux-2.6/include/linux/byteorder/big_endian.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/byteorder/big_endian.h,v
retrieving revision 1.3
diff -u -p -r1.3 big_endian.h
--- linux-2.6/include/linux/byteorder/big_endian.h 11 Oct 2004 21:41:36 -0000 1.3
+++ linux-2.6/include/linux/byteorder/big_endian.h 1 Nov 2004 02:59:17 -0000
@@ -27,12 +27,12 @@
#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)___swab64((x)))
-#define __le64_to_cpu(x) ___swab64((__force __u64)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)___swab32((x)))
-#define __le32_to_cpu(x) ___swab32((__force __u32)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)___swab16((x)))
-#define __le16_to_cpu(x) ___swab16((__force __u16)(__le16)(x))
+#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
+#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
+#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
+#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
+#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
+#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
Index: linux-2.6/include/linux/byteorder/little_endian.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/byteorder/little_endian.h,v
retrieving revision 1.3
diff -u -p -r1.3 little_endian.h
--- linux-2.6/include/linux/byteorder/little_endian.h 11 Oct 2004 21:41:36 -0000 1.3
+++ linux-2.6/include/linux/byteorder/little_endian.h 1 Nov 2004 02:59:17 -0000
@@ -33,12 +33,12 @@
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
-#define __cpu_to_be64(x) ((__force __be64)___swab64((x)))
-#define __be64_to_cpu(x) ___swab64((__force __u64)(__be64)(x))
-#define __cpu_to_be32(x) ((__force __be32)___swab32((x)))
-#define __be32_to_cpu(x) ___swab32((__force __u32)(__be32)(x))
-#define __cpu_to_be16(x) ((__force __be16)___swab16((x)))
-#define __be16_to_cpu(x) ___swab16((__force __u16)(__be16)(x))
+#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
+#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
+#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
+#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
+#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
+#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
static inline __le64 __cpu_to_le64p(const __u64 *p)
{
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
reply other threads:[~2004-11-01 3:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20041101030810.GH8958@parcelfarce.linux.theplanet.co.uk \
--to=matthew@wil.cx \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=viro@math.psu.edu \
/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
all inboxes | Powered by JetHome®