1/* Copyright (C) 2008-2014 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 _IMMINTRIN_H_INCLUDED 25#define _IMMINTRIN_H_INCLUDED 26 27#include <mmintrin.h> 28 29#include <xmmintrin.h> 30 31#include <emmintrin.h> 32 33#include <pmmintrin.h> 34 35#include <tmmintrin.h> 36 37#include <smmintrin.h> 38 39#include <wmmintrin.h> 40 41#include <avxintrin.h> 42 43#include <avx2intrin.h> 44 45#include <avx512fintrin.h> 46 47#include <avx512erintrin.h> 48 49#include <avx512pfintrin.h> 50 51#include <avx512cdintrin.h> 52 53#include <shaintrin.h> 54 55#include <lzcntintrin.h> 56 57#include <bmiintrin.h> 58 59#include <bmi2intrin.h> 60 61#include <fmaintrin.h> 62 63#include <f16cintrin.h> 64 65#include <rtmintrin.h> 66 67#include <xtestintrin.h> 68 69#ifndef __RDRND__ 70#pragma GCC push_options 71#pragma GCC target("rdrnd") 72#define __DISABLE_RDRND__ 73#endif /* __RDRND__ */ 74extern __inline int 75__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 76_rdrand16_step (unsigned short *__P) 77{ 78 return __builtin_ia32_rdrand16_step (__P); 79} 80 81extern __inline int 82__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 83_rdrand32_step (unsigned int *__P) 84{ 85 return __builtin_ia32_rdrand32_step (__P); 86} 87#ifdef __DISABLE_RDRND__ 88#undef __DISABLE_RDRND__ 89#pragma GCC pop_options 90#endif /* __DISABLE_RDRND__ */ 91 92#ifdef __x86_64__ 93 94#ifndef __FSGSBASE__ 95#pragma GCC push_options 96#pragma GCC target("fsgsbase") 97#define __DISABLE_FSGSBASE__ 98#endif /* __FSGSBASE__ */ 99extern __inline unsigned int 100__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 101_readfsbase_u32 (void) 102{ 103 return __builtin_ia32_rdfsbase32 (); 104} 105 106extern __inline unsigned long long 107__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 108_readfsbase_u64 (void) 109{ 110 return __builtin_ia32_rdfsbase64 (); 111} 112 113extern __inline unsigned int 114__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 115_readgsbase_u32 (void) 116{ 117 return __builtin_ia32_rdgsbase32 (); 118} 119 120extern __inline unsigned long long 121__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 122_readgsbase_u64 (void) 123{ 124 return __builtin_ia32_rdgsbase64 (); 125} 126 127extern __inline void 128__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 129_writefsbase_u32 (unsigned int __B) 130{ 131 __builtin_ia32_wrfsbase32 (__B); 132} 133 134extern __inline void 135__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 136_writefsbase_u64 (unsigned long long __B) 137{ 138 __builtin_ia32_wrfsbase64 (__B); 139} 140 141extern __inline void 142__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 143_writegsbase_u32 (unsigned int __B) 144{ 145 __builtin_ia32_wrgsbase32 (__B); 146} 147 148extern __inline void 149__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 150_writegsbase_u64 (unsigned long long __B) 151{ 152 __builtin_ia32_wrgsbase64 (__B); 153} 154#ifdef __DISABLE_FSGSBASE__ 155#undef __DISABLE_FSGSBASE__ 156#pragma GCC pop_options 157#endif /* __DISABLE_FSGSBASE__ */ 158 159#ifndef __RDRND__ 160#pragma GCC push_options 161#pragma GCC target("rdrnd") 162#define __DISABLE_RDRND__ 163#endif /* __RDRND__ */ 164extern __inline int 165__attribute__((__gnu_inline__, __always_inline__, __artificial__)) 166_rdrand64_step (unsigned long long *__P) 167{ 168 return __builtin_ia32_rdrand64_step (__P); 169} 170#ifdef __DISABLE_RDRND__ 171#undef __DISABLE_RDRND__ 172#pragma GCC pop_options 173#endif /* __DISABLE_RDRND__ */ 174 175#endif /* __x86_64__ */ 176 177#endif /* _IMMINTRIN_H_INCLUDED */ 178