13f1e851dim/*===------------------------- movdirintrin.h ------------------------------===
23f1e851dim *
35481597dim * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45481597dim * See https://llvm.org/LICENSE.txt for license information.
55481597dim * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
63f1e851dim *
73f1e851dim *===-----------------------------------------------------------------------===
83f1e851dim */
93f1e851dim#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
103f1e851dim#error "Never use <movdirintrin.h> directly; include <x86intrin.h> instead."
113f1e851dim#endif
123f1e851dim
133f1e851dim#ifndef _MOVDIRINTRIN_H
143f1e851dim#define _MOVDIRINTRIN_H
153f1e851dim
163f1e851dim/* Move doubleword as direct store */
173f1e851dimstatic __inline__ void
183f1e851dim__attribute__((__always_inline__, __nodebug__,  __target__("movdiri")))
193f1e851dim_directstoreu_u32 (void *__dst, unsigned int  __value)
203f1e851dim{
213f1e851dim  __builtin_ia32_directstore_u32((unsigned int *)__dst, (unsigned int)__value);
223f1e851dim}
233f1e851dim
243f1e851dim#ifdef __x86_64__
253f1e851dim
263f1e851dim/* Move quadword as direct store */
273f1e851dimstatic __inline__ void
283f1e851dim__attribute__((__always_inline__, __nodebug__,  __target__("movdiri")))
293f1e851dim_directstoreu_u64 (void *__dst, unsigned long __value)
303f1e851dim{
313f1e851dim  __builtin_ia32_directstore_u64((unsigned long *)__dst, __value);
323f1e851dim}
333f1e851dim
343f1e851dim#endif /* __x86_64__ */
353f1e851dim
363f1e851dim/*
373f1e851dim * movdir64b - Move 64 bytes as direct store.
383f1e851dim * The destination must be 64 byte aligned, and the store is atomic.
393f1e851dim * The source address has no alignment requirement, and the load from
403f1e851dim * the source address is not atomic.
413f1e851dim */
423f1e851dimstatic __inline__ void
433f1e851dim__attribute__((__always_inline__, __nodebug__,  __target__("movdir64b")))
443f1e851dim_movdir64b (void *__dst __attribute__((align_value(64))), const void *__src)
453f1e851dim{
463f1e851dim  __builtin_ia32_movdir64b(__dst, __src);
473f1e851dim}
483f1e851dim
493f1e851dim#endif /* _MOVDIRINTRIN_H */
50