logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

fenv.patch (1269B)


  1. SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
  2. SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
  3. SPDX-License-Identifier: MIT
  4. tcc does not seem to support stmxcsr and ldmxcsr.
  5. Remove those. This might break float exception handling but we
  6. are unlikely to need it.
  7. diff -U3 -r src/fenv/i386/fenv.s src/fenv/i386/fenv.s
  8. --- musl-1.1.24/src/fenv/i386/fenv.s 2019-10-13 22:58:27.000000000 +0100
  9. +++ musl-1.1.24/src/fenv/i386/fenv.s 2021-02-01 00:27:04.924135707 +0000
  10. @@ -17,7 +17,6 @@
  11. jz 1f
  12. fnclex
  13. 1: push %edx
  14. - stmxcsr (%esp)
  15. pop %edx
  16. and $0x3f,%eax
  17. or %eax,%edx
  18. @@ -26,7 +25,6 @@
  19. not %ecx
  20. and %ecx,%edx
  21. push %edx
  22. - ldmxcsr (%esp)
  23. pop %edx
  24. 1: xor %eax,%eax
  25. ret
  26. @@ -77,11 +75,9 @@
  27. pop %edx
  28. testl $0x02000000,(%edx)
  29. jz 1f
  30. - stmxcsr (%esp)
  31. shl $3,%ch
  32. andb $0x9f,1(%esp)
  33. or %ch,1(%esp)
  34. - ldmxcsr (%esp)
  35. 1: pop %ecx
  36. ret
  37. @@ -107,7 +103,6 @@
  38. testl $0x02000000,(%edx)
  39. jz 1f
  40. push %eax
  41. - stmxcsr (%esp)
  42. pop %edx
  43. and $0x3f,%edx
  44. or %edx,4(%ecx)
  45. @@ -143,7 +138,6 @@
  46. shl $3,%ecx
  47. or $0x1f80,%ecx
  48. mov %ecx,4(%esp)
  49. - ldmxcsr 4(%esp)
  50. 1: ret
  51. .global fetestexcept
  52. @@ -158,7 +152,6 @@
  53. pop %edx
  54. testl $0x02000000,(%edx)
  55. jz 1f
  56. - stmxcsr 4(%esp)
  57. or 4(%esp),%eax
  58. 1: and %ecx,%eax
  59. ret