1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

x86inc: Enable AVX emulation in additional cases

Allows emulation to work when dst is equal to src2 as long as the
instruction is commutative, e.g. `addps m0, m1, m0`.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Anton Mitrofanov 2016-04-20 19:35:34 +02:00 committed by Anton Khirnov
parent 300fb0df84
commit 2fb1d17a5a

View File

@ -1129,14 +1129,12 @@ INIT_XMM
%if __emulate_avx %if __emulate_avx
%xdefine __src1 %7 %xdefine __src1 %7
%xdefine __src2 %8 %xdefine __src2 %8
%ifnidn %6, %7 %if %5 && %4 == 0
%if %0 >= 9 %ifnidn %6, %7
CHECK_AVX_INSTR_EMU {%1 %6, %7, %8, %9}, %6, %8, %9 %ifidn %6, %8
%else %xdefine __src1 %8
CHECK_AVX_INSTR_EMU {%1 %6, %7, %8}, %6, %8 %xdefine __src2 %7
%endif %elifnnum sizeof%8
%if %5 && %4 == 0
%ifnnum sizeof%8
; 3-operand AVX instructions with a memory arg can only have it in src2, ; 3-operand AVX instructions with a memory arg can only have it in src2,
; whereas SSE emulation prefers to have it in src1 (i.e. the mov). ; whereas SSE emulation prefers to have it in src1 (i.e. the mov).
; So, if the instruction is commutative with a memory arg, swap them. ; So, if the instruction is commutative with a memory arg, swap them.
@ -1144,6 +1142,13 @@ INIT_XMM
%xdefine __src2 %7 %xdefine __src2 %7
%endif %endif
%endif %endif
%endif
%ifnidn %6, __src1
%if %0 >= 9
CHECK_AVX_INSTR_EMU {%1 %6, %7, %8, %9}, %6, __src2, %9
%else
CHECK_AVX_INSTR_EMU {%1 %6, %7, %8}, %6, __src2
%endif
%if __sizeofreg == 8 %if __sizeofreg == 8
MOVQ %6, __src1 MOVQ %6, __src1
%elif %3 %elif %3