1*bed243d3SAndroid Build Coastguard Worker /*===------------------ enqcmdintrin.h - enqcmd intrinsics -----------------===
2*bed243d3SAndroid Build Coastguard Worker *
3*bed243d3SAndroid Build Coastguard Worker * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*bed243d3SAndroid Build Coastguard Worker * See https://llvm.org/LICENSE.txt for license information.
5*bed243d3SAndroid Build Coastguard Worker * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*bed243d3SAndroid Build Coastguard Worker *
7*bed243d3SAndroid Build Coastguard Worker *===-----------------------------------------------------------------------===
8*bed243d3SAndroid Build Coastguard Worker */
9*bed243d3SAndroid Build Coastguard Worker
10*bed243d3SAndroid Build Coastguard Worker #ifndef __IMMINTRIN_H
11*bed243d3SAndroid Build Coastguard Worker #error "Never use <enqcmdintrin.h> directly; include <immintrin.h> instead."
12*bed243d3SAndroid Build Coastguard Worker #endif
13*bed243d3SAndroid Build Coastguard Worker
14*bed243d3SAndroid Build Coastguard Worker #ifndef __ENQCMDINTRIN_H
15*bed243d3SAndroid Build Coastguard Worker #define __ENQCMDINTRIN_H
16*bed243d3SAndroid Build Coastguard Worker
17*bed243d3SAndroid Build Coastguard Worker /* Define the default attributes for the functions in this file */
18*bed243d3SAndroid Build Coastguard Worker #define _DEFAULT_FN_ATTRS \
19*bed243d3SAndroid Build Coastguard Worker __attribute__((__always_inline__, __nodebug__, __target__("enqcmd")))
20*bed243d3SAndroid Build Coastguard Worker
21*bed243d3SAndroid Build Coastguard Worker /// Reads 64-byte command pointed by \a __src, formats 64-byte enqueue store
22*bed243d3SAndroid Build Coastguard Worker /// data, and performs 64-byte enqueue store to memory pointed by \a __dst.
23*bed243d3SAndroid Build Coastguard Worker /// This intrinsics may only be used in User mode.
24*bed243d3SAndroid Build Coastguard Worker ///
25*bed243d3SAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
26*bed243d3SAndroid Build Coastguard Worker ///
27*bed243d3SAndroid Build Coastguard Worker /// This intrinsics corresponds to the <c> ENQCMD </c> instruction.
28*bed243d3SAndroid Build Coastguard Worker ///
29*bed243d3SAndroid Build Coastguard Worker /// \param __dst
30*bed243d3SAndroid Build Coastguard Worker /// Pointer to the destination of the enqueue store.
31*bed243d3SAndroid Build Coastguard Worker /// \param __src
32*bed243d3SAndroid Build Coastguard Worker /// Pointer to 64-byte command data.
33*bed243d3SAndroid Build Coastguard Worker /// \returns If the command data is successfully written to \a __dst then 0 is
34*bed243d3SAndroid Build Coastguard Worker /// returned. Otherwise 1 is returned.
35*bed243d3SAndroid Build Coastguard Worker static __inline__ int _DEFAULT_FN_ATTRS
_enqcmd(void * __dst,const void * __src)36*bed243d3SAndroid Build Coastguard Worker _enqcmd (void *__dst, const void *__src)
37*bed243d3SAndroid Build Coastguard Worker {
38*bed243d3SAndroid Build Coastguard Worker return __builtin_ia32_enqcmd(__dst, __src);
39*bed243d3SAndroid Build Coastguard Worker }
40*bed243d3SAndroid Build Coastguard Worker
41*bed243d3SAndroid Build Coastguard Worker /// Reads 64-byte command pointed by \a __src, formats 64-byte enqueue store
42*bed243d3SAndroid Build Coastguard Worker /// data, and performs 64-byte enqueue store to memory pointed by \a __dst
43*bed243d3SAndroid Build Coastguard Worker /// This intrinsic may only be used in Privileged mode.
44*bed243d3SAndroid Build Coastguard Worker ///
45*bed243d3SAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
46*bed243d3SAndroid Build Coastguard Worker ///
47*bed243d3SAndroid Build Coastguard Worker /// This intrinsics corresponds to the <c> ENQCMDS </c> instruction.
48*bed243d3SAndroid Build Coastguard Worker ///
49*bed243d3SAndroid Build Coastguard Worker /// \param __dst
50*bed243d3SAndroid Build Coastguard Worker /// Pointer to the destination of the enqueue store.
51*bed243d3SAndroid Build Coastguard Worker /// \param __src
52*bed243d3SAndroid Build Coastguard Worker /// Pointer to 64-byte command data.
53*bed243d3SAndroid Build Coastguard Worker /// \returns If the command data is successfully written to \a __dst then 0 is
54*bed243d3SAndroid Build Coastguard Worker /// returned. Otherwise 1 is returned.
55*bed243d3SAndroid Build Coastguard Worker static __inline__ int _DEFAULT_FN_ATTRS
_enqcmds(void * __dst,const void * __src)56*bed243d3SAndroid Build Coastguard Worker _enqcmds (void *__dst, const void *__src)
57*bed243d3SAndroid Build Coastguard Worker {
58*bed243d3SAndroid Build Coastguard Worker return __builtin_ia32_enqcmds(__dst, __src);
59*bed243d3SAndroid Build Coastguard Worker }
60*bed243d3SAndroid Build Coastguard Worker
61*bed243d3SAndroid Build Coastguard Worker #undef _DEFAULT_FN_ATTRS
62*bed243d3SAndroid Build Coastguard Worker
63*bed243d3SAndroid Build Coastguard Worker #endif /* __ENQCMDINTRIN_H */
64