mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-28 08:10:25 +08:00
Herman proposed patch seems to fix clang issue on x64 Debian
This commit is contained in:
parent
8cb3e5368f
commit
ffac4e7688
@ -3225,9 +3225,17 @@ static __inline__ void sigdelset1(unsigned int *set, int _sig)
|
|||||||
asm("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc", "flags");
|
asm("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc", "flags");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifdef __clang__
|
||||||
/* clang's inline asm is uncapable of 'xchgb %b0,%h0' */
|
/* clang's inline asm is uncapable of 'xchgb %b0,%h0' */
|
||||||
static __inline__ __const__ unsigned int swab32(unsigned int x)
|
static __inline__ __const__ unsigned int swab32(unsigned int x)
|
||||||
|
{
|
||||||
|
return ((x >> 24) & 0xff) |
|
||||||
|
((x >> 8) & 0xff00) |
|
||||||
|
((x << 8) & 0xff0000) |
|
||||||
|
((x << 24) & 0xff000000);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static __inline__ __const__ unsigned int swab32(unsigned int x)
|
||||||
{
|
{
|
||||||
__asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
|
__asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
|
||||||
"rorl $16,%0\n\t" /* swap words */
|
"rorl $16,%0\n\t" /* swap words */
|
||||||
@ -3647,9 +3655,7 @@ void asm_test(void)
|
|||||||
__asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc");
|
__asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc");
|
||||||
printf("set=0x%x\n", set);
|
printf("set=0x%x\n", set);
|
||||||
val = 0x01020304;
|
val = 0x01020304;
|
||||||
#ifndef __APPLE__
|
|
||||||
printf("swab32(0x%08x) = 0x%0x\n", val, swab32(val));
|
printf("swab32(0x%08x) = 0x%0x\n", val, swab32(val));
|
||||||
#endif
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
override_func1();
|
override_func1();
|
||||||
|
Loading…
Reference in New Issue
Block a user