1336815Sdim/*===---- pconfigintrin.h - X86 platform configuration ---------------------=== 2336815Sdim * 3353358Sdim * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim * See https://llvm.org/LICENSE.txt for license information. 5353358Sdim * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6336815Sdim * 7336815Sdim *===-----------------------------------------------------------------------=== 8336815Sdim */ 9336815Sdim 10336815Sdim#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H 11336815Sdim#error "Never use <pconfigintrin.h> directly; include <x86intrin.h> instead." 12336815Sdim#endif 13336815Sdim 14336815Sdim#ifndef __PCONFIGINTRIN_H 15336815Sdim#define __PCONFIGINTRIN_H 16336815Sdim 17336815Sdim#define __PCONFIG_KEY_PROGRAM 0x00000001 18336815Sdim 19353358Sdim#if __has_extension(gnu_asm) 20353358Sdim 21336815Sdim/* Define the default attributes for the functions in this file. */ 22336815Sdim#define __DEFAULT_FN_ATTRS \ 23336815Sdim __attribute__((__always_inline__, __nodebug__, __target__("pconfig"))) 24336815Sdim 25336815Sdimstatic __inline unsigned int __DEFAULT_FN_ATTRS 26336815Sdim_pconfig_u32(unsigned int __leaf, __SIZE_TYPE__ __d[]) 27336815Sdim{ 28336815Sdim unsigned int __result; 29336815Sdim __asm__ ("pconfig" 30336815Sdim : "=a" (__result), "=b" (__d[0]), "=c" (__d[1]), "=d" (__d[2]) 31336815Sdim : "a" (__leaf), "b" (__d[0]), "c" (__d[1]), "d" (__d[2]) 32336815Sdim : "cc"); 33336815Sdim return __result; 34336815Sdim} 35336815Sdim 36336815Sdim#undef __DEFAULT_FN_ATTRS 37336815Sdim 38353358Sdim#endif /* __has_extension(gnu_asm) */ 39353358Sdim 40336815Sdim#endif 41