diff options
author | John Baldwin <jhb@FreeBSD.org> | 2001-12-18 08:54:39 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2001-12-18 08:54:39 +0000 |
commit | 3f9a462fb91c4f75b6163133abf9f91f75f039d9 (patch) | |
tree | 8cfb56c69a770ad846ddebfa04b7dd2d77e2fe9d /sys/i386 | |
parent | e4e991e117495f3d28a13490e7eef87d745a1b07 (diff) | |
download | src-3f9a462fb91c4f75b6163133abf9f91f75f039d9.tar.gz src-3f9a462fb91c4f75b6163133abf9f91f75f039d9.zip |
Various assembly fixes mostly in the form of using the "+" modifier for
output operands to mark them as both input and output rather than listing
operands twice.
Reviewed by: bde
Notes
Notes:
svn path=/head/; revision=88118
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/include/cpufunc.h | 28 | ||||
-rw-r--r-- | sys/i386/include/endian.h | 14 | ||||
-rw-r--r-- | sys/i386/include/in_cksum.h | 16 |
3 files changed, 29 insertions, 29 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index a4f57cb81070..c80c9f2e39c7 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -71,7 +71,7 @@ bsfl(u_int mask) { u_int result; - __asm __volatile("bsfl %0,%0" : "=r" (result) : "0" (mask)); + __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); return (result); } @@ -80,7 +80,7 @@ bsrl(u_int mask) { u_int result; - __asm __volatile("bsrl %0,%0" : "=r" (result) : "0" (mask)); + __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); return (result); } @@ -198,8 +198,8 @@ static __inline void insb(u_int port, void *addr, size_t cnt) { __asm __volatile("cld; rep; insb" - : "=D" (addr), "=c" (cnt) - : "0" (addr), "1" (cnt), "d" (port) + : "+D" (addr), "+c" (cnt) + : "d" (port) : "memory"); } @@ -207,8 +207,8 @@ static __inline void insw(u_int port, void *addr, size_t cnt) { __asm __volatile("cld; rep; insw" - : "=D" (addr), "=c" (cnt) - : "0" (addr), "1" (cnt), "d" (port) + : "+D" (addr), "+c" (cnt) + : "d" (port) : "memory"); } @@ -216,8 +216,8 @@ static __inline void insl(u_int port, void *addr, size_t cnt) { __asm __volatile("cld; rep; insl" - : "=D" (addr), "=c" (cnt) - : "0" (addr), "1" (cnt), "d" (port) + : "+D" (addr), "+c" (cnt) + : "d" (port) : "memory"); } @@ -321,24 +321,24 @@ static __inline void outsb(u_int port, const void *addr, size_t cnt) { __asm __volatile("cld; rep; outsb" - : "=S" (addr), "=c" (cnt) - : "0" (addr), "1" (cnt), "d" (port)); + : "+S" (addr), "+c" (cnt) + : "d" (port)); } static __inline void outsw(u_int port, const void *addr, size_t cnt) { __asm __volatile("cld; rep; outsw" - : "=S" (addr), "=c" (cnt) - : "0" (addr), "1" (cnt), "d" (port)); + : "+S" (addr), "+c" (cnt) + : "d" (port)); } static __inline void outsl(u_int port, const void *addr, size_t cnt) { __asm __volatile("cld; rep; outsl" - : "=S" (addr), "=c" (cnt) - : "0" (addr), "1" (cnt), "d" (port)); + : "+S" (addr), "+c" (cnt) + : "d" (port)); } static __inline void diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h index 3f96741c0eb6..be87af2f7c5d 100644 --- a/sys/i386/include/endian.h +++ b/sys/i386/include/endian.h @@ -72,7 +72,7 @@ __END_DECLS static __inline __uint32_t __uint16_swap_uint32(__uint32_t __x) { - __asm ("rorl $16, %1" : "=r" (__x) : "0" (__x)); + __asm ("rorl $16, %0" : "+r" (__x)); return __x; } @@ -81,12 +81,12 @@ static __inline __uint32_t __uint8_swap_uint32(__uint32_t __x) { #if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU) - __asm ("bswap %0" : "=r" (__x) : "0" (__x)); + __asm ("bswap %0" : "+r" (__x)); #else - __asm ("xchgb %h1, %b1\n\t" - "rorl $16, %1\n\t" - "xchgb %h1, %b1" - : "=q" (__x) : "0" (__x)); + __asm ("xchgb %h0, %b0\n\t" + "rorl $16, %0\n\t" + "xchgb %h0, %b0" + : "+q" (__x)); #endif return __x; } @@ -94,7 +94,7 @@ __uint8_swap_uint32(__uint32_t __x) static __inline __uint16_t __uint8_swap_uint16(__uint16_t __x) { - __asm ("xchgb %h1, %b1" : "=q" (__x) : "0" (__x)); + __asm ("xchgb %h0, %b0" : "+q" (__x)); return __x; } diff --git a/sys/i386/include/in_cksum.h b/sys/i386/include/in_cksum.h index d062015af106..22d02fab8e21 100644 --- a/sys/i386/include/in_cksum.h +++ b/sys/i386/include/in_cksum.h @@ -59,9 +59,9 @@ in_cksum_hdr(const struct ip *ip) { register u_int sum = 0; -#define ADD(n) __asm("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip)) -#define ADDC(n) __asm("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (ip)) -#define MOP __asm("adcl $0, %0" : "=r" (sum) : "0" (sum)) +#define ADD(n) __asm("addl " #n "(%1), %0" : "+r" (sum) : "r" (ip)) +#define ADDC(n) __asm("adcl " #n "(%1), %0" : "+r" (sum) : "r" (ip)) +#define MOP __asm("adcl $0, %0" : "+r" (sum)) ADD(0); ADDC(4); @@ -91,8 +91,8 @@ static __inline u_short in_addword(u_short sum, u_short b) { - __asm("addw %2, %0" : "=r" (sum) : "0" (sum), "r" (b)); - __asm("adcw $0, %0" : "=r" (sum) : "0" (sum)); + __asm("addw %1, %0" : "+r" (sum) : "r" (b)); + __asm("adcw $0, %0" : "+r" (sum)); return (sum); } @@ -101,9 +101,9 @@ static __inline u_short in_pseudo(u_int sum, u_int b, u_int c) { - __asm("addl %2, %0" : "=r" (sum) : "0" (sum), "r" (b)); - __asm("adcl %2, %0" : "=r" (sum) : "0" (sum), "r" (c)); - __asm("adcl $0, %0" : "=r" (sum) : "0" (sum)); + __asm("addl %1, %0" : "+r" (sum) : "r" (b)); + __asm("adcl %1, %0" : "+r" (sum) : "r" (c)); + __asm("adcl $0, %0" : "+r" (sum)); sum = (sum & 0xffff) + (sum >> 16); if (sum > 0xffff) |