fxsrintrin.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* Copyright (C) 2012-2019 Free Software Foundation, Inc.
  2. This file is part of GCC.
  3. GCC is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3, or (at your option)
  6. any later version.
  7. GCC is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. Under Section 7 of GPL version 3, you are granted additional
  12. permissions described in the GCC Runtime Library Exception, version
  13. 3.1, as published by the Free Software Foundation.
  14. You should have received a copy of the GNU General Public License and
  15. a copy of the GCC Runtime Library Exception along with this program;
  16. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  17. <http://www.gnu.org/licenses/>. */
  18. #if !defined _IMMINTRIN_H_INCLUDED
  19. # error "Never use <fxsrintrin.h> directly; include <immintrin.h> instead."
  20. #endif
  21. #ifndef _FXSRINTRIN_H_INCLUDED
  22. #define _FXSRINTRIN_H_INCLUDED
  23. #ifndef __FXSR__
  24. #pragma GCC push_options
  25. #pragma GCC target("fxsr")
  26. #define __DISABLE_FXSR__
  27. #endif /* __FXSR__ */
  28. extern __inline void
  29. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  30. _fxsave (void *__P)
  31. {
  32. __builtin_ia32_fxsave (__P);
  33. }
  34. extern __inline void
  35. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  36. _fxrstor (void *__P)
  37. {
  38. __builtin_ia32_fxrstor (__P);
  39. }
  40. #ifdef __x86_64__
  41. extern __inline void
  42. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  43. _fxsave64 (void *__P)
  44. {
  45. __builtin_ia32_fxsave64 (__P);
  46. }
  47. extern __inline void
  48. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  49. _fxrstor64 (void *__P)
  50. {
  51. __builtin_ia32_fxrstor64 (__P);
  52. }
  53. #endif
  54. #ifdef __DISABLE_FXSR__
  55. #undef __DISABLE_FXSR__
  56. #pragma GCC pop_options
  57. #endif /* __DISABLE_FXSR__ */
  58. #endif /* _FXSRINTRIN_H_INCLUDED */