15481597dim/*===------------------ enqcmdintrin.h - enqcmd intrinsics -----------------===
25481597dim *
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
65481597dim *
75481597dim *===-----------------------------------------------------------------------===
85481597dim */
95481597dim
105481597dim#ifndef __IMMINTRIN_H
115481597dim#error "Never use <enqcmdintrin.h> directly; include <immintrin.h> instead."
125481597dim#endif
135481597dim
145481597dim#ifndef __ENQCMDINTRIN_H
155481597dim#define __ENQCMDINTRIN_H
165481597dim
175481597dim/* Define the default attributes for the functions in this file */
185481597dim#define _DEFAULT_FN_ATTRS \
195481597dim  __attribute__((__always_inline__, __nodebug__, __target__("enqcmd")))
205481597dim
215481597dim/// Reads 64-byte command pointed by \a __src, formats 64-byte enqueue store
225481597dim///    data, and performs 64-byte enqueue store to memory pointed by \a __dst.
235481597dim///    This intrinsics may only be used in User mode.
245481597dim///
255481597dim/// \headerfile <x86intrin.h>
265481597dim///
275481597dim/// This intrinsics corresponds to the <c> ENQCMD </c> instruction.
285481597dim///
295481597dim/// \param __dst
305481597dim///    Pointer to the destination of the enqueue store.
315481597dim/// \param __src
325481597dim///    Pointer to 64-byte command data.
335481597dim/// \returns If the command data is successfully written to \a __dst then 0 is
345481597dim///    returned. Otherwise 1 is returned.
355481597dimstatic __inline__ int _DEFAULT_FN_ATTRS
365481597dim_enqcmd (void *__dst, const void *__src)
375481597dim{
385481597dim  return __builtin_ia32_enqcmd(__dst, __src);
395481597dim}
405481597dim
415481597dim/// Reads 64-byte command pointed by \a __src, formats 64-byte enqueue store
425481597dim///    data, and performs 64-byte enqueue store to memory pointed by \a __dst
435481597dim///    This intrinsic may only be used in Privileged mode.
445481597dim///
455481597dim/// \headerfile <x86intrin.h>
465481597dim///
475481597dim/// This intrinsics corresponds to the <c> ENQCMDS </c> instruction.
485481597dim///
495481597dim/// \param __dst
505481597dim///    Pointer to the destination of the enqueue store.
515481597dim/// \param __src
525481597dim///    Pointer to 64-byte command data.
535481597dim/// \returns If the command data is successfully written to \a __dst then 0 is
545481597dim///    returned. Otherwise 1 is returned.
555481597dimstatic __inline__ int _DEFAULT_FN_ATTRS
565481597dim_enqcmds (void *__dst, const void *__src)
575481597dim{
585481597dim  return __builtin_ia32_enqcmds(__dst, __src);
595481597dim}
605481597dim
615481597dim#undef _DEFAULT_FN_ATTRS
625481597dim
635481597dim#endif /* __ENQCMDINTRIN_H */
64