Showing the changes to tests (1 of 1 file). Show all
Unified · Split
| @@ -3225,9 +3225,17 @@ static __inline__ void sigdelset1(unsigned int *set, int _sig) · 3224 unmodified lines | ||
| 3225 | 3225 | asm("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc", "flags"); |
| 3226 | 3226 | } |
| 3227 | 3227 | |
| 3228 | −#ifndef __APPLE__ | |
| 3228 | +#ifdef __clang__ | |
| 3229 | 3229 | /* clang's inline asm is uncapable of 'xchgb %b0,%h0' */ |
| 3230 | 3230 | static __inline__ __const__ unsigned int swab32(unsigned int x) |
| 3231 | +{ | |
| 3232 | + return ((x >> 24) & 0xff) | | |
| 3233 | + ((x >> 8) & 0xff00) | | |
| 3234 | + ((x << 8) & 0xff0000) | | |
| 3235 | + ((x << 24) & 0xff000000); | |
| 3236 | +} | |
| 3237 | +#else | |
| 3238 | +static __inline__ __const__ unsigned int swab32(unsigned int x) | |
| 3231 | 3239 | { |
| 3232 | 3240 | __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ |
| 3233 | 3241 | "rorl $16,%0\n\t" /* swap words */ |
| @@ -3647,9 +3655,7 @@ void asm_test(void) · 413 unmodified lines | ||
| 3647 | 3655 | __asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc"); |
| 3648 | 3656 | printf("set=0x%x\n", set); |
| 3649 | 3657 | val = 0x01020304; |
| 3650 | −#ifndef __APPLE__ | |
| 3651 | 3658 | printf("swab32(0x%08x) = 0x%0x\n", val, swab32(val)); |
| 3652 | −#endif | |
| 3653 | 3659 | #ifndef _WIN32 |
| 3654 | 3660 | #ifndef __APPLE__ |
| 3655 | 3661 | override_func1(); |