diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-03-30 08:14:59 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-03-30 08:14:59 +0200 |
commit | 79b5d8bf4597048600b62b10e9508ac326db6c19 (patch) | |
tree | 841df9adf4f6eaa31074a3f4abf388bfc841a82b /src/ortho/mcode/ortho_code-x86-emits.adb | |
parent | ec6a6a6bb5bb30ca1821c9df312893ec9bd52d26 (diff) | |
download | ghdl-79b5d8bf4597048600b62b10e9508ac326db6c19.tar.gz ghdl-79b5d8bf4597048600b62b10e9508ac326db6c19.tar.bz2 ghdl-79b5d8bf4597048600b62b10e9508ac326db6c19.zip |
mcode: improve support of Win64 (allocate stack for home registers)
Diffstat (limited to 'src/ortho/mcode/ortho_code-x86-emits.adb')
-rw-r--r-- | src/ortho/mcode/ortho_code-x86-emits.adb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ortho/mcode/ortho_code-x86-emits.adb b/src/ortho/mcode/ortho_code-x86-emits.adb index 48aa745e6..70b1fb584 100644 --- a/src/ortho/mcode/ortho_code-x86-emits.adb +++ b/src/ortho/mcode/ortho_code-x86-emits.adb @@ -1641,9 +1641,13 @@ package body Ortho_Code.X86.Emits is Gen_8 (Opc2_Grp1_And or 2#11_000_000# or To_Reg32 (Reg)); Gen_32 (not (X86.Flags.Stack_Boundary - 1)); End_Insn; + -- Call chkstk if needed. + -- On windows x32, chkstk probes the stack and allocate stack. + -- On windows x64, chkstk only probes the stack. if X86.Flags.Flag_Alloca_Call then Gen_Call (Chkstk_Symbol); - else + end if; + if (not X86.Flags.Flag_Alloca_Call) or X86.Flags.Win64 then -- subl esp, reg Start_Insn; Gen_Rex_B (Reg, Sz_Ptr); |