• Henrik Gramner's avatar
    Fix incorrect zero-extension assumptions in x86_64 asm · 3131a19c
    Henrik Gramner authored
    Some x264 asm assumed that the high 32 bits of registers containing "int" values would be zero.
    This is almost always the case, and it seems to work with gcc, but it is *not* guaranteed by the ABI.
    As a result, it breaks with some other compilers, like Clang, that take advantage of this in optimizations.
    Accordingly, fix all x86 code by using intptr_t instead of int or using movsxd where neccessary.
    Also add checkasm hack to detect when assembly functions incorrectly assumes that 32-bit integers are zero-extended to 64-bit.
    3131a19c
mc.c 21.5 KB