Description: fix build on x32 https://wiki.debian.org/X32Port Author: Sébastien Noel Forwarded: TODO Last-Update: 2026-05-13 --- a/include/dr_libs/dr_flac.h +++ b/include/dr_libs/dr_flac.h @@ -2716,17 +2716,9 @@ static DRFLAC_INLINE drflac_uint32 drfla #if defined(__GNUC__) || defined(__clang__) #if defined(DRFLAC_X64) { - /* - A note on lzcnt. - - We check for the presence of the lzcnt instruction at runtime before calling this function, but we still generate this code. I have had - a report where the assembler does not recognize the lzcnt instruction. To work around this we are going to use `rep; bsr` instead which - has an identical byte encoding as lzcnt, and should hopefully improve compatibility with older assemblers. - */ - drflac_uint64 r; + drflac_cache_t r; __asm__ __volatile__ ( - "rep; bsr{q %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc" - /*"lzcnt{ %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc"*/ + "lzcnt{ %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc" ); return (drflac_uint32)r; @@ -2735,8 +2727,7 @@ static DRFLAC_INLINE drflac_uint32 drfla { drflac_uint32 r; __asm__ __volatile__ ( - "rep; bsr{l %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc" - /*"lzcnt{l %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc"*/ + "lzcnt{l %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc" ); return r;