l64fpu.S 904 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * SIMD Floating Point.
  3. * Note: for x87 instructions which have both a 'wait' and 'nowait' version,
  4. * 8a only knows the 'wait' mnemonic but does NOT insertthe WAIT prefix byte
  5. * (i.e. they act like their FNxxx variations) so WAIT instructions must be
  6. * explicitly placed in the code if necessary.
  7. */
  8. .globl _clts
  9. _clts:
  10. CLTS
  11. ret
  12. .globl _fldcw
  13. _fldcw:
  14. fldcw (%rdi)
  15. ret
  16. .globl _fnclex
  17. _fnclex:
  18. FCLEX
  19. ret
  20. .globl _fninit
  21. _fninit:
  22. FINIT /* no WAIT */
  23. ret
  24. .globl _fxrstor
  25. _fxrstor:
  26. // Damn. clang lags on assembly, badly.
  27. //FXRSTOR64 0(%rdi)
  28. .byte 0x48, 0x0f, 0xae, 0x0f // fxrstor64 (%rdi)
  29. ret
  30. .globl _fxsave
  31. _fxsave:
  32. //FXSAVE64 0(%rdi)
  33. .byte 0x48, 0x0f, 0xae, 0x07 // fxsave64 (%rdi)
  34. ret
  35. .globl _fwait
  36. _fwait:
  37. WAIT
  38. ret
  39. .globl _ldmxcsr
  40. _ldmxcsr:
  41. LDMXCSR (%rdi)
  42. ret
  43. .globl _stts
  44. _stts:
  45. MOVQ %CR0, %rax
  46. ORQ $8, %rax /* Ts */
  47. MOVQ %rax, %CR0
  48. ret