mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-03 19:57:39 +01:00
UC_MCONTEXT_FPREGS_PTR is made optional
This commit is contained in:
parent
42a6f57c19
commit
ee32be6651
2 changed files with 7 additions and 0 deletions
|
@ -58,7 +58,9 @@ _Ux86_64_getcontext:
|
||||||
/* Save fp state (not needed, except for setcontext not
|
/* Save fp state (not needed, except for setcontext not
|
||||||
restoring garbage). */
|
restoring garbage). */
|
||||||
leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8
|
leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8
|
||||||
|
#ifdef UC_MCONTEXT_FPREGS_PTR
|
||||||
movq %r8, UC_MCONTEXT_FPREGS_PTR(%rdi)
|
movq %r8, UC_MCONTEXT_FPREGS_PTR(%rdi)
|
||||||
|
#endif // UC_MCONTEXT_FPREGS_PTR
|
||||||
fnstenv (%r8)
|
fnstenv (%r8)
|
||||||
stmxcsr FPREGS_OFFSET_MXCSR(%r8)
|
stmxcsr FPREGS_OFFSET_MXCSR(%r8)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
_Ux86_64_setcontext:
|
_Ux86_64_setcontext:
|
||||||
|
|
||||||
/* restore fp state */
|
/* restore fp state */
|
||||||
|
// TODO: why not just use leaq?
|
||||||
|
#ifdef UC_MCONTEXT_FPREGS_PTR
|
||||||
mov UC_MCONTEXT_FPREGS_PTR(%rdi),%r8
|
mov UC_MCONTEXT_FPREGS_PTR(%rdi),%r8
|
||||||
|
#else // UC_MCONTEXT_FPREGS_PTR
|
||||||
|
leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8
|
||||||
|
#endif // UC_MCONTEXT_FPREGS_PTR
|
||||||
fldenv (%r8)
|
fldenv (%r8)
|
||||||
ldmxcsr FPREGS_OFFSET_MXCSR(%r8)
|
ldmxcsr FPREGS_OFFSET_MXCSR(%r8)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue