]> git.lizzy.rs Git - rust.git/commitdiff
Using xsave restore to restore complete FPU state
authorRaoul Strackx <raoul.strackx@fortanix.com>
Fri, 19 Jun 2020 12:20:35 +0000 (14:20 +0200)
committerRaoul Strackx <raoul.strackx@fortanix.com>
Fri, 19 Jun 2020 16:39:07 +0000 (18:39 +0200)
src/libstd/sys/sgx/abi/entry.S

index 0c3afa77a60f3155015d34e237f1abc125f7c1d8..fc6ce5770338e6453ac0c64732dfed4f8a3c52f4 100644 (file)
@@ -26,18 +26,10 @@ IMAGE_BASE:
 .Lxsave_clear:
 .org .+24
 .Lxsave_mxcsr:
-    .int 0
+    .short 0x1f80
 
 /*  We can store a bunch of data in the gap between MXCSR and the XSAVE header */
 
-/* MXCSR initialization value for ABI */
-.Lmxcsr_init:
-    .int 0x1f80
-
-/* x87 FPU control word initialization value for ABI */
-.Lfpucw_init:
-    .int 0x037f
-
 /*  The following symbols point at read-only data that will be filled in by the */
 /*  post-linker. */
 
@@ -188,9 +180,6 @@ sgx_entry:
     mov %gs:tcsls_last_rsp,%r11
     test %r11,%r11
     jnz .Lusercall_ret
-/*  reset user state */
-    ldmxcsr .Lmxcsr_init(%rip)
-    fldcw .Lfpucw_init(%rip)
 /*  setup stack */
     mov %gs:tcsls_tos,%rsp /*  initially, RSP is not set to the correct value */
                            /*  here. This is fixed below under "adjust stack". */