50 lines · c
1/*===---------------- hresetintrin.h - HRESET intrinsics -------------------===2 *3 * 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-exception6 *7 *===-----------------------------------------------------------------------===8 */9#ifndef __X86GPRINTRIN_H10#error "Never use <hresetintrin.h> directly; include <x86gprintrin.h> instead."11#endif12 13#ifndef __HRESETINTRIN_H14#define __HRESETINTRIN_H15 16#if __has_extension(gnu_asm)17 18/* Define the default attributes for the functions in this file. */19#define __DEFAULT_FN_ATTRS \20 __attribute__((__always_inline__, __nodebug__, __target__("hreset")))21 22/// Provides a hint to the processor to selectively reset the prediction23/// history of the current logical processor specified by a 32-bit integer24/// value \a __eax.25///26/// This intrinsic corresponds to the <c> HRESET </c> instruction.27///28/// \code{.operation}29/// IF __eax == 030/// // nop31/// ELSE32/// FOR i := 0 to 3133/// IF __eax[i]34/// ResetPredictionFeature(i)35/// FI36/// ENDFOR37/// FI38/// \endcode39static __inline void __DEFAULT_FN_ATTRS40_hreset(int __eax)41{42 __asm__ ("hreset $0" :: "a"(__eax));43}44 45#undef __DEFAULT_FN_ATTRS46 47#endif /* __has_extension(gnu_asm) */48 49#endif /* __HRESETINTRIN_H */50