Skip to content

Commit 33b304c

Browse files
committed
Using xsave restore to restore complete FPU state
1 parent daedb79 commit 33b304c

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/libstd/sys/sgx/abi/entry.S

+1-12
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,10 @@ IMAGE_BASE:
2626
.Lxsave_clear:
2727
.org .+24
2828
.Lxsave_mxcsr:
29-
.int 0
29+
.short 0x1f80
3030

3131
/* We can store a bunch of data in the gap between MXCSR and the XSAVE header */
3232

33-
/* MXCSR initialization value for ABI */
34-
.Lmxcsr_init:
35-
.int 0x1f80
36-
37-
/* x87 FPU control word initialization value for ABI */
38-
.Lfpucw_init:
39-
.int 0x037f
40-
4133
/* The following symbols point at read-only data that will be filled in by the */
4234
/* post-linker. */
4335

@@ -188,9 +180,6 @@ sgx_entry:
188180
mov %gs:tcsls_last_rsp,%r11
189181
test %r11,%r11
190182
jnz .Lusercall_ret
191-
/* reset user state */
192-
ldmxcsr .Lmxcsr_init(%rip)
193-
fldcw .Lfpucw_init(%rip)
194183
/* setup stack */
195184
mov %gs:tcsls_tos,%rsp /* initially, RSP is not set to the correct value */
196185
/* here. This is fixed below under "adjust stack". */

0 commit comments

Comments
 (0)