svn commit: trunk/uClibc/libc/sysdeps/linux/bfin/bits

bernds at uclibc.org bernds at uclibc.org
Fri Nov 23 17:14:20 UTC 2007


Author: bernds
Date: 2007-11-23 09:14:20 -0800 (Fri, 23 Nov 2007)
New Revision: 20506

Log:
>From Jie Zhang:
__bswap_16 could not assume that it's zero extended when an unsigned short int is loaded into the data register.


Modified:
   trunk/uClibc/libc/sysdeps/linux/bfin/bits/byteswap.h


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/bfin/bits/byteswap.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/bits/byteswap.h	2007-11-23 17:09:54 UTC (rev 20505)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/bits/byteswap.h	2007-11-23 17:14:20 UTC (rev 20506)
@@ -25,9 +25,10 @@
 	 if (__builtin_constant_p (__x))				      \
 	   __v = __bswap_constant_16 (__x);				      \
 	 else								      \
-	   __asm__ ("%0 <<= 8;"						      \
-		    "%1.L = %0.L + %0.H (NS);"				      \
-		    : "+d" (__x), "=d" (__v));				      \
+	   __asm__ ("%0 = PACK (%1.L, %1.L);"				      \
+		    "%0 >>= 8;"						      \
+		    : "=d" (__v)					      \
+		    : "d" (__x));					      \
 	 __v; }))
 #else
 static __inline unsigned short int




More information about the uClibc-cvs mailing list