blob: d2b39cd58327012543ba998cbd68218ef2b36ead [file] [log] [blame]
Gabor Buellab0f310d2018-05-08 06:49:41 +00001/*===---- pconfigintrin.h - X86 platform configuration ---------------------===
2 *
Chandler Carruth4cf57432019-04-08 20:51:30 +00003 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Gabor Buellab0f310d2018-05-08 06:49:41 +00006 *
7 *===-----------------------------------------------------------------------===
8 */
9
Craig Topper664af9b2018-05-23 18:32:58 +000010#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
Gabor Buellab0f310d2018-05-08 06:49:41 +000011#error "Never use <pconfigintrin.h> directly; include <x86intrin.h> instead."
12#endif
13
14#ifndef __PCONFIGINTRIN_H
15#define __PCONFIGINTRIN_H
16
17#define __PCONFIG_KEY_PROGRAM 0x00000001
18
19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS \
21 __attribute__((__always_inline__, __nodebug__, __target__("pconfig")))
22
23static __inline unsigned int __DEFAULT_FN_ATTRS
24_pconfig_u32(unsigned int __leaf, __SIZE_TYPE__ __d[])
25{
26 unsigned int __result;
27 __asm__ ("pconfig"
28 : "=a" (__result), "=b" (__d[0]), "=c" (__d[1]), "=d" (__d[2])
29 : "a" (__leaf), "b" (__d[0]), "c" (__d[1]), "d" (__d[2])
30 : "cc");
31 return __result;
32}
33
34#undef __DEFAULT_FN_ATTRS
35
36#endif