Restore Xmm registers properly in StgCRun.c
authorklebinger.andreas@gmx.at <klebinger.andreas@gmx.at>
Mon, 1 Apr 2019 14:17:41 +0000 (16:17 +0200)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Thu, 4 Apr 2019 12:12:25 +0000 (08:12 -0400)
This fixes #16514: Xmm6-15 was restored based off rax instead of rsp.
The code was introduced in the fix for #14619.

rts/StgCRun.c

index 1b0a8f2..934926e 100644 (file)
@@ -494,15 +494,15 @@ StgRunIsImplementedInAssembler(void)
         "movq  48(%%rsp),%%rdi\n\t"
         "movq  56(%%rsp),%%rsi\n\t"
         "movq  64(%%rsp),%%xmm6\n\t"
-        "movq  72(%%rax),%%xmm7\n\t"
-        "movq  80(%%rax),%%xmm8\n\t"
-        "movq  88(%%rax),%%xmm9\n\t"
-        "movq  96(%%rax),%%xmm10\n\t"
-        "movq 104(%%rax),%%xmm11\n\t"
-        "movq 112(%%rax),%%xmm12\n\t"
-        "movq 120(%%rax),%%xmm13\n\t"
-        "movq 128(%%rax),%%xmm14\n\t"
-        "movq 136(%%rax),%%xmm15\n\t"
+        "movq  72(%%rsp),%%xmm7\n\t"
+        "movq  80(%%rsp),%%xmm8\n\t"
+        "movq  88(%%rsp),%%xmm9\n\t"
+        "movq  96(%%rsp),%%xmm10\n\t"
+        "movq 104(%%rsp),%%xmm11\n\t"
+        "movq 112(%%rsp),%%xmm12\n\t"
+        "movq 120(%%rsp),%%xmm13\n\t"
+        "movq 128(%%rsp),%%xmm14\n\t"
+        "movq 136(%%rsp),%%xmm15\n\t"
 #endif
         "addq %1, %%rsp\n\t"
         "retq"