Commit ed56837e authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Fiona Glaser

x86inc: automatically insert vzeroupper for YMM functions

Backported from libav.
parent cbb90707
......@@ -1786,5 +1786,4 @@ cglobal mbtree_propagate_cost, 7,7,8
vmovdqu [r0+r6*2], ymm1
add r6, 16
jl .loop
vzeroupper
RET
REP_RET
......@@ -368,11 +368,14 @@ DECLARE_REG 14, R15, 120
%assign xmm_regs_used 0
%endmacro
%define has_epilogue regs_used > 7 || xmm_regs_used > 6
%define has_epilogue regs_used > 7 || xmm_regs_used > 6 || mmsize == 32
%macro RET 0
WIN64_RESTORE_XMM_INTERNAL rsp
POP_IF_USED 14, 13, 12, 11, 10, 9, 8, 7
%if mmsize == 32
vzeroupper
%endif
ret
%endmacro
......@@ -404,10 +407,13 @@ DECLARE_REG 14, R15, 72
DEFINE_ARGS %4
%endmacro
%define has_epilogue regs_used > 9
%define has_epilogue regs_used > 9 || mmsize == 32
%macro RET 0
POP_IF_USED 14, 13, 12, 11, 10, 9
%if mmsize == 32
vzeroupper
%endif
ret
%endmacro
......@@ -444,10 +450,13 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
DEFINE_ARGS %4
%endmacro
%define has_epilogue regs_used > 3
%define has_epilogue regs_used > 3 || mmsize == 32
%macro RET 0
POP_IF_USED 6, 5, 4, 3
%if mmsize == 32
vzeroupper
%endif
ret
%endmacro
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment