implementing bswap_16 to avoid incorrect result from cygwin 1.7 gcc 3.4.4 built dyngen for lhz

This commit is contained in:
rakslice 2020-03-17 18:46:40 -07:00
parent 12f8469172
commit 40cb4bf236
1 changed files with 13 additions and 0 deletions

View File

@ -149,6 +149,19 @@ static inline uint32 do_opt_bswap_32(uint32 x)
__asm__ __volatile__ ("bswap %0" : "=r" (v) : "0" (x));
return v;
}
#if defined(__CYGWIN__) || defined(__MINGW32__)
#define opt_bswap_16 do_opt_bswap_16
static inline uint16 do_opt_bswap_16(uint16 x)
{
uint16 v;
__asm__ __volatile__ ("rolw $8, %0" : "=r" (v) : "0" (x));
return v;
}
#endif
#endif
#endif