50 lines · c
1/*===------------------------- movdirintrin.h ------------------------------===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#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H10#error "Never use <movdirintrin.h> directly; include <x86intrin.h> instead."11#endif12 13#ifndef _MOVDIRINTRIN_H14#define _MOVDIRINTRIN_H15 16/* Move doubleword as direct store */17static __inline__ void18__attribute__((__always_inline__, __nodebug__, __target__("movdiri")))19_directstoreu_u32 (void *__dst, unsigned int __value)20{21 __builtin_ia32_directstore_u32((unsigned int *)__dst, (unsigned int)__value);22}23 24#ifdef __x86_64__25 26/* Move quadword as direct store */27static __inline__ void28__attribute__((__always_inline__, __nodebug__, __target__("movdiri")))29_directstoreu_u64 (void *__dst, unsigned long __value)30{31 __builtin_ia32_directstore_u64((unsigned long *)__dst, __value);32}33 34#endif /* __x86_64__ */35 36/*37 * movdir64b - Move 64 bytes as direct store.38 * The destination must be 64 byte aligned, and the store is atomic.39 * The source address has no alignment requirement, and the load from40 * the source address is not atomic.41 */42static __inline__ void43__attribute__((__always_inline__, __nodebug__, __target__("movdir64b")))44_movdir64b (void *__dst __attribute__((align_value(64))), const void *__src)45{46 __builtin_ia32_movdir64b(__dst, __src);47}48 49#endif /* _MOVDIRINTRIN_H */50