From b3ace38d1f7a2a9e71067af284a3ff38cfe26a35 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Fri, 23 Nov 2007 17:14:20 +0000 Subject: From Jie Zhang: __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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps/linux/bfin/bits') diff --git a/libc/sysdeps/linux/bfin/bits/byteswap.h b/libc/sysdeps/linux/bfin/bits/byteswap.h index de6862236..74b87d94c 100644 --- a/libc/sysdeps/linux/bfin/bits/byteswap.h +++ b/libc/sysdeps/linux/bfin/bits/byteswap.h @@ -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 -- cgit v1.2.3