[PATCH] winebuild: On x86_64, save xmm0 - 3 during the delayed import lookup.

Huw Davies huw at codeweavers.com
Wed Feb 7 06:47:10 CST 2018


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 tools/winebuild/import.c | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 01a418f..7ed2f7d 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -943,24 +943,32 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
         output( "\tjmp *%%eax\n" );
         break;
     case CPU_x86_64:
-        output( "\tsubq $88,%%rsp\n" );
-        output_cfi( ".cfi_adjust_cfa_offset 88" );
-        output( "\tmovq %%rdx,80(%%rsp)\n" );
-        output( "\tmovq %%rcx,72(%%rsp)\n" );
-        output( "\tmovq %%r8,64(%%rsp)\n" );
-        output( "\tmovq %%r9,56(%%rsp)\n" );
-        output( "\tmovq %%r10,48(%%rsp)\n" );
-        output( "\tmovq %%r11,40(%%rsp)\n" );
+        output( "\tsubq $0x98,%%rsp\n" );
+        output_cfi( ".cfi_adjust_cfa_offset 0x98" );
+        output( "\tmovq %%rdx,0x88(%%rsp)\n" );
+        output( "\tmovq %%rcx,0x80(%%rsp)\n" );
+        output( "\tmovq %%r8,0x78(%%rsp)\n" );
+        output( "\tmovq %%r9,0x70(%%rsp)\n" );
+        output( "\tmovq %%r10,0x68(%%rsp)\n" );
+        output( "\tmovq %%r11,0x60(%%rsp)\n" );
+        output( "\tmovaps %%xmm0,0x50(%%rsp)\n" );
+        output( "\tmovaps %%xmm1,0x40(%%rsp)\n" );
+        output( "\tmovaps %%xmm2,0x30(%%rsp)\n" );
+        output( "\tmovaps %%xmm3,0x20(%%rsp)\n" );
         output( "\tmovq %%rax,%%rcx\n" );
         output( "\tcall %s\n", asm_name("__wine_spec_delay_load") );
-        output( "\tmovq 40(%%rsp),%%r11\n" );
-        output( "\tmovq 48(%%rsp),%%r10\n" );
-        output( "\tmovq 56(%%rsp),%%r9\n" );
-        output( "\tmovq 64(%%rsp),%%r8\n" );
-        output( "\tmovq 72(%%rsp),%%rcx\n" );
-        output( "\tmovq 80(%%rsp),%%rdx\n" );
-        output( "\taddq $88,%%rsp\n" );
-        output_cfi( ".cfi_adjust_cfa_offset -88" );
+        output( "\tmovaps 0x20(%%rsp),%%xmm3\n" );
+        output( "\tmovaps 0x30(%%rsp),%%xmm2\n" );
+        output( "\tmovaps 0x40(%%rsp),%%xmm1\n" );
+        output( "\tmovaps 0x50(%%rsp),%%xmm0\n" );
+        output( "\tmovq 0x60(%%rsp),%%r11\n" );
+        output( "\tmovq 0x68(%%rsp),%%r10\n" );
+        output( "\tmovq 0x70(%%rsp),%%r9\n" );
+        output( "\tmovq 0x78(%%rsp),%%r8\n" );
+        output( "\tmovq 0x80(%%rsp),%%rcx\n" );
+        output( "\tmovq 0x88(%%rsp),%%rdx\n" );
+        output( "\taddq $0x98,%%rsp\n" );
+        output_cfi( ".cfi_adjust_cfa_offset -0x98" );
         output( "\tjmp *%%rax\n" );
         break;
     case CPU_ARM:
-- 
2.7.4




More information about the wine-devel mailing list