brintos

brintos / llvm-project-archived public Read only

0
0
Text · 934 B · c62080b Raw
35 lines · c
1/*===---- pkuintrin.h - PKU intrinsics -------------------------------------===2 *3 *4 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5 * See https://llvm.org/LICENSE.txt for license information.6 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7 *8 *===-----------------------------------------------------------------------===9 */10#ifndef __IMMINTRIN_H11#error "Never use <pkuintrin.h> directly; include <immintrin.h> instead."12#endif13 14#ifndef __PKUINTRIN_H15#define __PKUINTRIN_H16 17/* Define the default attributes for the functions in this file. */18#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("pku")))19 20static __inline__ unsigned int __DEFAULT_FN_ATTRS21_rdpkru_u32(void)22{23  return __builtin_ia32_rdpkru();24}25 26static __inline__ void __DEFAULT_FN_ATTRS27_wrpkru(unsigned int __val)28{29  __builtin_ia32_wrpkru(__val);30}31 32#undef __DEFAULT_FN_ATTRS33 34#endif35