OSDN Git Service

From Jie Zhang:
authorBernd Schmidt <bernds_cb1@t-online.de>
Fri, 23 Nov 2007 17:14:20 +0000 (17:14 -0000)
committerBernd Schmidt <bernds_cb1@t-online.de>
Fri, 23 Nov 2007 17:14:20 +0000 (17:14 -0000)
__bswap_16 could not assume that it's zero extended when an unsigned short int is loaded into the data register.

libc/sysdeps/linux/bfin/bits/byteswap.h

index de68622..74b87d9 100644 (file)
         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