(root)/
gcc-13.2.0/
gcc/
config/
i386/
x86gprintrin.h
       1  /* Copyright (C) 2020-2023 Free Software Foundation, Inc.
       2  
       3     This file is part of GCC.
       4  
       5     GCC is free software; you can redistribute it and/or modify
       6     it under the terms of the GNU General Public License as published by
       7     the Free Software Foundation; either version 3, or (at your option)
       8     any later version.
       9  
      10     GCC is distributed in the hope that it will be useful,
      11     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13     GNU General Public License for more details.
      14  
      15     Under Section 7 of GPL version 3, you are granted additional
      16     permissions described in the GCC Runtime Library Exception, version
      17     3.1, as published by the Free Software Foundation.
      18  
      19     You should have received a copy of the GNU General Public License and
      20     a copy of the GCC Runtime Library Exception along with this program;
      21     see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
      22     <http://www.gnu.org/licenses/>.  */
      23  
      24  #ifndef _X86GPRINTRIN_H_INCLUDED
      25  #define _X86GPRINTRIN_H_INCLUDED
      26  
      27  #if !defined _SOFT_FLOAT || defined __MMX__ || defined __SSE__
      28  #pragma GCC push_options
      29  #pragma GCC target("general-regs-only")
      30  #define __DISABLE_GENERAL_REGS_ONLY__
      31  #endif
      32  
      33  #include <ia32intrin.h>
      34  
      35  #ifndef __iamcu__
      36  
      37  #include <stddef.h>
      38  
      39  #include <adxintrin.h>
      40  
      41  #include <bmiintrin.h>
      42  
      43  #include <bmi2intrin.h>
      44  
      45  #include <cetintrin.h>
      46  
      47  #include <cldemoteintrin.h>
      48  
      49  #include <clflushoptintrin.h>
      50  
      51  #include <clwbintrin.h>
      52  
      53  #include <clzerointrin.h>
      54  
      55  #include <cmpccxaddintrin.h>
      56  
      57  #include <enqcmdintrin.h>
      58  
      59  #include <fxsrintrin.h>
      60  
      61  #include <lzcntintrin.h>
      62  
      63  #include <lwpintrin.h>
      64  
      65  #include <movdirintrin.h>
      66  
      67  #include <mwaitintrin.h>
      68  
      69  #include <mwaitxintrin.h>
      70  
      71  #include <pconfigintrin.h>
      72  
      73  #include <popcntintrin.h>
      74  
      75  #include <pkuintrin.h>
      76  
      77  #include <prfchiintrin.h>
      78  
      79  #include <raointintrin.h>
      80  
      81  #include <rdseedintrin.h>
      82  
      83  #include <rtmintrin.h>
      84  
      85  #include <serializeintrin.h>
      86  
      87  #include <sgxintrin.h>
      88  
      89  #include <tbmintrin.h>
      90  
      91  #include <tsxldtrkintrin.h>
      92  
      93  #include <uintrintrin.h>
      94  
      95  #include <waitpkgintrin.h>
      96  
      97  #include <wbnoinvdintrin.h>
      98  
      99  #include <xsaveintrin.h>
     100  
     101  #include <xsavecintrin.h>
     102  
     103  #include <xsaveoptintrin.h>
     104  
     105  #include <xsavesintrin.h>
     106  
     107  #include <xtestintrin.h>
     108  
     109  #include <hresetintrin.h>
     110  
     111  extern __inline void
     112  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     113  _wbinvd (void)
     114  {
     115    __builtin_ia32_wbinvd ();
     116  }
     117  
     118  #ifndef __RDRND__
     119  #pragma GCC push_options
     120  #pragma GCC target("rdrnd")
     121  #define __DISABLE_RDRND__
     122  #endif /* __RDRND__ */
     123  extern __inline int
     124  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     125  _rdrand16_step (unsigned short *__P)
     126  {
     127    return __builtin_ia32_rdrand16_step (__P);
     128  }
     129  
     130  extern __inline int
     131  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     132  _rdrand32_step (unsigned int *__P)
     133  {
     134    return __builtin_ia32_rdrand32_step (__P);
     135  }
     136  #ifdef __DISABLE_RDRND__
     137  #undef __DISABLE_RDRND__
     138  #pragma GCC pop_options
     139  #endif /* __DISABLE_RDRND__ */
     140  
     141  #ifndef __RDPID__
     142  #pragma GCC push_options
     143  #pragma GCC target("rdpid")
     144  #define __DISABLE_RDPID__
     145  #endif /* __RDPID__ */
     146  extern __inline unsigned int
     147  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     148  _rdpid_u32 (void)
     149  {
     150    return __builtin_ia32_rdpid ();
     151  }
     152  #ifdef __DISABLE_RDPID__
     153  #undef __DISABLE_RDPID__
     154  #pragma GCC pop_options
     155  #endif /* __DISABLE_RDPID__ */
     156  
     157  #ifdef  __x86_64__
     158  
     159  #ifndef __FSGSBASE__
     160  #pragma GCC push_options
     161  #pragma GCC target("fsgsbase")
     162  #define __DISABLE_FSGSBASE__
     163  #endif /* __FSGSBASE__ */
     164  extern __inline unsigned int
     165  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     166  _readfsbase_u32 (void)
     167  {
     168    return __builtin_ia32_rdfsbase32 ();
     169  }
     170  
     171  extern __inline unsigned long long
     172  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     173  _readfsbase_u64 (void)
     174  {
     175    return __builtin_ia32_rdfsbase64 ();
     176  }
     177  
     178  extern __inline unsigned int
     179  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     180  _readgsbase_u32 (void)
     181  {
     182    return __builtin_ia32_rdgsbase32 ();
     183  }
     184  
     185  extern __inline unsigned long long
     186  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     187  _readgsbase_u64 (void)
     188  {
     189    return __builtin_ia32_rdgsbase64 ();
     190  }
     191  
     192  extern __inline void
     193  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     194  _writefsbase_u32 (unsigned int __B)
     195  {
     196    __builtin_ia32_wrfsbase32 (__B);
     197  }
     198  
     199  extern __inline void
     200  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     201  _writefsbase_u64 (unsigned long long __B)
     202  {
     203    __builtin_ia32_wrfsbase64 (__B);
     204  }
     205  
     206  extern __inline void
     207  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     208  _writegsbase_u32 (unsigned int __B)
     209  {
     210    __builtin_ia32_wrgsbase32 (__B);
     211  }
     212  
     213  extern __inline void
     214  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     215  _writegsbase_u64 (unsigned long long __B)
     216  {
     217    __builtin_ia32_wrgsbase64 (__B);
     218  }
     219  #ifdef __DISABLE_FSGSBASE__
     220  #undef __DISABLE_FSGSBASE__
     221  #pragma GCC pop_options
     222  #endif /* __DISABLE_FSGSBASE__ */
     223  
     224  #ifndef __RDRND__
     225  #pragma GCC push_options
     226  #pragma GCC target("rdrnd")
     227  #define __DISABLE_RDRND__
     228  #endif /* __RDRND__ */
     229  extern __inline int
     230  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     231  _rdrand64_step (unsigned long long *__P)
     232  {
     233    return __builtin_ia32_rdrand64_step (__P);
     234  }
     235  #ifdef __DISABLE_RDRND__
     236  #undef __DISABLE_RDRND__
     237  #pragma GCC pop_options
     238  #endif /* __DISABLE_RDRND__ */
     239  
     240  #endif /* __x86_64__  */
     241  
     242  #ifndef __PTWRITE__
     243  #pragma GCC push_options
     244  #pragma GCC target("ptwrite")
     245  #define __DISABLE_PTWRITE__
     246  #endif
     247  
     248  #ifdef __x86_64__
     249  extern __inline void
     250  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     251  _ptwrite64 (unsigned long long __B)
     252  {
     253    __builtin_ia32_ptwrite64 (__B);
     254  }
     255  #endif /* __x86_64__ */
     256  
     257  extern __inline void
     258  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
     259  _ptwrite32 (unsigned __B)
     260  {
     261    __builtin_ia32_ptwrite32 (__B);
     262  }
     263  #ifdef __DISABLE_PTWRITE__
     264  #undef __DISABLE_PTWRITE__
     265  #pragma GCC pop_options
     266  #endif /* __DISABLE_PTWRITE__ */
     267  
     268  #endif /* __iamcu__ */
     269  
     270  #ifdef __DISABLE_GENERAL_REGS_ONLY__
     271  #undef __DISABLE_GENERAL_REGS_ONLY__
     272  #pragma GCC pop_options
     273  #endif /* __DISABLE_GENERAL_REGS_ONLY__ */
     274  
     275  #endif /* _X86GPRINTRIN_H_INCLUDED.  */