History

Herman proposed patch seems to fix clang issue on x64 Debian

Christian Jullien committed 6 years ago

Commit ffac4e71 parent 8cb3e531 file · +9 −3Browse files

Unified · Split

tests/tcctest.c+9−3
@@ -3225,9 +3225,17 @@ static __inline__ void sigdelset1(unsigned int *set, int _sig) · 3224 unmodified lines
3225 asm("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc", "flags");3225 asm("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc", "flags");
3226}3226}
3227 3227
3228#ifndef __APPLE__3228#ifdef __clang__
3229/* clang's inline asm is uncapable of 'xchgb %b0,%h0' */3229/* clang's inline asm is uncapable of 'xchgb %b0,%h0' */
3230static __inline__ __const__ unsigned int swab32(unsigned int x)3230static __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
3238static __inline__ __const__ unsigned int swab32(unsigned int x)
3231{3239{
3232 __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */3240 __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
3233 "rorl $16,%0\n\t" /* swap words */3241 "rorl $16,%0\n\t" /* swap words */
@@ -3647,9 +3655,7 @@ void asm_test(void) · 413 unmodified lines
3647 __asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc");3655 __asm__("btsl %1,%0" : "=m"(set) : "Ir"(20) : "cc");
3648 printf("set=0x%x\n", set);3656 printf("set=0x%x\n", set);
3649 val = 0x01020304;3657 val = 0x01020304;
3650#ifndef __APPLE__
3651 printf("swab32(0x%08x) = 0x%0x\n", val, swab32(val));3658 printf("swab32(0x%08x) = 0x%0x\n", val, swab32(val));
3652#endif
3653#ifndef _WIN323659#ifndef _WIN32
3654#ifndef __APPLE__3660#ifndef __APPLE__
3655 override_func1();3661 override_func1();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t