1 1.1.1.12 mrg /* Copyright (C) 2012-2024 Free Software Foundation, Inc. 2 1.1 mrg 3 1.1 mrg This file is part of GCC. 4 1.1 mrg 5 1.1 mrg GCC is free software; you can redistribute it and/or modify 6 1.1 mrg it under the terms of the GNU General Public License as published by 7 1.1 mrg the Free Software Foundation; either version 3, or (at your option) 8 1.1 mrg any later version. 9 1.1 mrg 10 1.1 mrg GCC is distributed in the hope that it will be useful, 11 1.1 mrg but WITHOUT ANY WARRANTY; without even the implied warranty of 12 1.1 mrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 1.1 mrg GNU General Public License for more details. 14 1.1 mrg 15 1.1 mrg Under Section 7 of GPL version 3, you are granted additional 16 1.1 mrg permissions described in the GCC Runtime Library Exception, version 17 1.1 mrg 3.1, as published by the Free Software Foundation. 18 1.1 mrg 19 1.1 mrg You should have received a copy of the GNU General Public License and 20 1.1 mrg a copy of the GCC Runtime Library Exception along with this program; 21 1.1 mrg see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 22 1.1 mrg <http://www.gnu.org/licenses/>. */ 23 1.1 mrg 24 1.1.1.11 mrg #ifndef _X86GPRINTRIN_H_INCLUDED 25 1.1.1.11 mrg # error "Never use <rdseedintrin.h> directly; include <x86gprintrin.h> instead." 26 1.1 mrg #endif 27 1.1 mrg 28 1.1.1.2 mrg #ifndef _RDSEEDINTRIN_H_INCLUDED 29 1.1.1.2 mrg #define _RDSEEDINTRIN_H_INCLUDED 30 1.1.1.2 mrg 31 1.1 mrg #ifndef __RDSEED__ 32 1.1.1.2 mrg #pragma GCC push_options 33 1.1.1.2 mrg #pragma GCC target("rdseed") 34 1.1.1.2 mrg #define __DISABLE_RDSEED__ 35 1.1 mrg #endif /* __RDSEED__ */ 36 1.1 mrg 37 1.1 mrg 38 1.1 mrg extern __inline int 39 1.1 mrg __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 40 1.1.1.3 mrg _rdseed16_step (unsigned short *__p) 41 1.1 mrg { 42 1.1.1.5 mrg return __builtin_ia32_rdseed_hi_step (__p); 43 1.1 mrg } 44 1.1 mrg 45 1.1 mrg extern __inline int 46 1.1 mrg __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 47 1.1.1.3 mrg _rdseed32_step (unsigned int *__p) 48 1.1 mrg { 49 1.1.1.5 mrg return __builtin_ia32_rdseed_si_step (__p); 50 1.1 mrg } 51 1.1 mrg 52 1.1 mrg #ifdef __x86_64__ 53 1.1 mrg extern __inline int 54 1.1 mrg __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 55 1.1.1.3 mrg _rdseed64_step (unsigned long long *__p) 56 1.1 mrg { 57 1.1.1.5 mrg return __builtin_ia32_rdseed_di_step (__p); 58 1.1 mrg } 59 1.1 mrg #endif 60 1.1 mrg 61 1.1.1.2 mrg #ifdef __DISABLE_RDSEED__ 62 1.1.1.2 mrg #undef __DISABLE_RDSEED__ 63 1.1.1.2 mrg #pragma GCC pop_options 64 1.1.1.2 mrg #endif /* __DISABLE_RDSEED__ */ 65 1.1.1.2 mrg 66 1.1 mrg #endif /* _RDSEEDINTRIN_H_INCLUDED */ 67