mwaitxintrin.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #ifndef _MWAITXINTRIN_H_INCLUDED
  19. #define _MWAITXINTRIN_H_INCLUDED
  20. #ifndef __MWAITX__
  21. #pragma GCC push_options
  22. #pragma GCC target("mwaitx")
  23. #define __DISABLE_MWAITX__
  24. #endif /* __MWAITX__ */
  25. extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  26. _mm_monitorx (void const * __P, unsigned int __E, unsigned int __H)
  27. {
  28. __builtin_ia32_monitorx (__P, __E, __H);
  29. }
  30. extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  31. _mm_mwaitx (unsigned int __E, unsigned int __H, unsigned int __C)
  32. {
  33. __builtin_ia32_mwaitx (__E, __H, __C);
  34. }
  35. #ifdef __DISABLE_MWAITX__
  36. #undef __DISABLE_MWAITX__
  37. #pragma GCC pop_options
  38. #endif /* __DISABLE_MWAITX__ */
  39. #endif /* _MWAITXINTRIN_H_INCLUDED */