From: Henrik Gramner Date: Sun, 20 Feb 2022 13:21:34 +0000 (+0100) Subject: x86inc: Fix edge case in forced VEX-encoding X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f52e5e11aabe1429c2e5a7c4fddc42cf7acba8d3;p=libx264 x86inc: Fix edge case in forced VEX-encoding Correctly handle emulation of 4-operand instructions (e.g. 'shufps') where src1 is a memory operand. --- diff --git a/common/x86/x86inc.asm b/common/x86/x86inc.asm index 6cc73405..0750b0a4 100644 --- a/common/x86/x86inc.asm +++ b/common/x86/x86inc.asm @@ -1342,7 +1342,20 @@ INIT_XMM %1 %6, __src2 %endif %elif %0 >= 9 - __instr %6, %7, %8, %9 + %if avx_enabled && __sizeofreg >= 16 && %4 == 1 + %ifnnum regnumof%7 + %if %3 + vmovaps %6, %7 + %else + vmovdqa %6, %7 + %endif + __instr %6, %6, %8, %9 + %else + __instr %6, %7, %8, %9 + %endif + %else + __instr %6, %7, %8, %9 + %endif %elif %0 == 8 %if avx_enabled && __sizeofreg >= 16 && %4 == 0 %xdefine __src1 %7 @@ -1379,7 +1392,7 @@ INIT_XMM %else vmovdqa %6, %7 %endif - __instr %6, %8 + __instr %6, %6, %8 %else __instr %6, __src1, __src2 %endif