Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax
In directory usw-pr-cvs1:/tmp/cvs-serv24081/include/asm-vax
Modified Files:
byteorder.h
Log Message:
check in fixed swab32 algorithm.. inline is still wrong..
#define switch to turn VAX specific one on/off
Index: byteorder.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/byteorder.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- byteorder.h 2001/01/20 13:51:05 1.3
+++ byteorder.h 2001/03/03 18:54:31 1.4
@@ -4,25 +4,27 @@
/* FIXME: arch byte swapping in assembly
*/
#include <asm/types.h>
+#define VAX_USE_ARCH_SWAB32 0
#ifdef __GNUC__
/*
* ragge has a 1 insn shorter sequence which will probably replace this one
* later, depending on the relative instruction costs.
*/
+#if VAX_USE_ARCH_SWAB32
static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
{
__u32 t1; /* assume input is aabbccdd in x*/
- __asm__("rotl $8, %1, r1\n\t" /* r1 = bbccddaa */
- "bisl3 $0xff00ff, r1, %0\n\t" /* %0 = 00cc00aa */
+ __asm__ volatile ("rotl $8, %1, r1\n\t" /* r1 = bbccddaa */
+ "bicl3 $0xff00ff00, r1, %0\n\t" /* %0 = 00cc00aa */
"rotl $-8, %1, r1\n\t" /* r1 = ddaabbcc */
"bicl2 $0xff00ff, r1\n\t" /* r1 = dd00bb00 */
"bisl2 r1, %0\n\t" /* %0 = ddccbbaa */
: "=g" (t1) : "g" (x) : "r1" );
- return t1;
+ return t1;
}
-
+#endif
/*
* according to the resident expert, this is as fast as assembly
*/
@@ -31,8 +33,9 @@
register __u16 __x = (x);
return (u_int16_t)(__x << 8 | __x >> 8);
}
-
+#if VAX_USE_ARCH_SWAB32
#define __arch__swab32(x) ___arch__swab32(x)
+#endif
#define __arch__swab16(x) ___arch__swab16(x)
#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
|