+ x86: track use of full ymm registers and generate vzeroupper if needed

git-svn-id: trunk@45484 -
This commit is contained in:
florian 2020-05-24 17:52:05 +00:00
parent 78381bd1ae
commit 82a3877126
4 changed files with 13 additions and 2 deletions

View File

@ -748,7 +748,9 @@ interface
{ subroutine needs to load and maintain a tls register }
pi_needs_tls,
{ subroutine uses get_frame }
pi_uses_get_frame
pi_uses_get_frame,
{ x86 only: subroutine uses ymm registers, requires vzeroupper call }
pi_uses_ymm
);
tprocinfoflags=set of tprocinfoflag;

View File

@ -338,6 +338,9 @@ unit cgcpu;
list.concat(tai_regalloc.dealloc(current_procinfo.framepointer,nil));
end;
if pi_uses_ymm in current_procinfo.flags then
list.Concat(taicpu.op_none(A_VZEROUPPER));
{ return from proc }
if po_interrupt in current_procinfo.procdef.procoptions then
begin

View File

@ -1641,7 +1641,9 @@ const
(mask:pi_needs_tls;
str:' uses TLS data pointer '),
(mask:pi_uses_get_frame;
str:' uses get_frame')
str:' uses get_frame'),
(mask:pi_uses_ymm;
str:' uses ymm register (x86 only)')
);
var
procinfooptions : tprocinfoflags;

View File

@ -423,7 +423,11 @@ unit cgcpu;
list.concat(tai_regalloc.dealloc(current_procinfo.framepointer,nil));
end;
if pi_uses_ymm in current_procinfo.flags then
list.Concat(taicpu.op_none(A_VZEROUPPER));
list.concat(Taicpu.Op_none(A_RET,S_NO));
if (pi_has_unwind_info in current_procinfo.flags) then
begin
tcpuprocinfo(current_procinfo).dump_scopes(list);