1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

X86: modify PreserveAll CC to save full AVX-512 state

This commit is contained in:
Nekotekina 2021-05-13 11:24:49 +03:00
parent 2e65b3a418
commit c36b21c023
2 changed files with 7 additions and 0 deletions

View File

@ -1129,6 +1129,9 @@ def CSR_64_RT_AllRegs : CalleeSavedRegs<(add CSR_64_RT_MostRegs,
(sequence "XMM%u", 0, 15))>;
def CSR_64_RT_AllRegs_AVX : CalleeSavedRegs<(add CSR_64_RT_MostRegs,
(sequence "YMM%u", 0, 15))>;
def CSR_64_RT_AllRegs_512 : CalleeSavedRegs<(add CSR_64_RT_MostRegs,
(sequence "K%u", 0, 7),
(sequence "ZMM%u", 0, 31))>;
def CSR_64_MostRegs : CalleeSavedRegs<(add RBX, RCX, RDX, RSI, RDI, R8, R9, R10,
R11, R12, R13, R14, R15, RBP,

View File

@ -306,6 +306,8 @@ X86RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
case CallingConv::PreserveMost:
return CSR_64_RT_MostRegs_SaveList;
case CallingConv::PreserveAll:
if (HasAVX512)
return CSR_64_RT_AllRegs_512_SaveList;
if (HasAVX)
return CSR_64_RT_AllRegs_AVX_SaveList;
return CSR_64_RT_AllRegs_SaveList;
@ -429,6 +431,8 @@ X86RegisterInfo::getCallPreservedMask(const MachineFunction &MF,
case CallingConv::PreserveMost:
return CSR_64_RT_MostRegs_RegMask;
case CallingConv::PreserveAll:
if (HasAVX512)
return CSR_64_RT_AllRegs_512_RegMask;
if (HasAVX)
return CSR_64_RT_AllRegs_AVX_RegMask;
return CSR_64_RT_AllRegs_RegMask;