Skip to content

Commit

Permalink
Using xsave restore to restore complete FPU state
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulstrackx committed Jun 19, 2020
1 parent daedb79 commit 33b304c
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/libstd/sys/sgx/abi/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -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. */

Expand Down Expand Up @@ -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". */
Expand Down

0 comments on commit 33b304c

Please sign in to comment.