62 lines · c
1/*===---- prfchiintrin.h - PREFETCHI intrinsic -----------------------------===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 10#ifndef __PRFCHIINTRIN_H11#define __PRFCHIINTRIN_H12 13#ifdef __x86_64__14 15/* Define the default attributes for the functions in this file. */16#define __DEFAULT_FN_ATTRS \17 __attribute__((__always_inline__, __nodebug__, __target__("prefetchi")))18 19/// Loads an instruction sequence containing the specified memory address into20/// all level cache.21///22/// Note that the effect of this intrinsic is dependent on the processor23/// implementation.24///25/// \headerfile <x86intrin.h>26///27/// This intrinsic corresponds to the \c PREFETCHIT0 instruction.28///29/// \param __P30/// A pointer specifying the memory address to be prefetched.31static __inline__ void __DEFAULT_FN_ATTRS32_m_prefetchit0(volatile const void *__P) {33#pragma clang diagnostic push34#pragma clang diagnostic ignored "-Wcast-qual"35 __builtin_ia32_prefetchi((const void *)__P, 3 /* _MM_HINT_T0 */);36#pragma clang diagnostic pop37}38 39/// Loads an instruction sequence containing the specified memory address into40/// all but the first-level cache.41///42/// Note that the effect of this intrinsic is dependent on the processor43/// implementation.44///45/// \headerfile <x86intrin.h>46///47/// This intrinsic corresponds to the \c PREFETCHIT1 instruction.48///49/// \param __P50/// A pointer specifying the memory address to be prefetched.51static __inline__ void __DEFAULT_FN_ATTRS52_m_prefetchit1(volatile const void *__P) {53#pragma clang diagnostic push54#pragma clang diagnostic ignored "-Wcast-qual"55 __builtin_ia32_prefetchi((const void *)__P, 2 /* _MM_HINT_T1 */);56#pragma clang diagnostic pop57}58#endif /* __x86_64__ */59#undef __DEFAULT_FN_ATTRS60 61#endif /* __PRFCHWINTRIN_H */62