ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
lwpintrin.h
Go to the documentation of this file.
1 /*===---- lwpintrin.h - LWP intrinsics -------------------------------------===
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-exception
6  *
7  *===-----------------------------------------------------------------------===
8  */
9 
10 #ifndef __X86INTRIN_H
11 #error "Never use <lwpintrin.h> directly; include <x86intrin.h> instead."
12 #endif
13 
14 #ifndef __LWPINTRIN_H
15 #define __LWPINTRIN_H
16 
17 /* Define the default attributes for the functions in this file. */
18 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lwp")))
19 
31 static __inline__ void __DEFAULT_FN_ATTRS
32 __llwpcb (void *__addr)
33 {
34  __builtin_ia32_llwpcb(__addr);
35 }
36 
46 static __inline__ void* __DEFAULT_FN_ATTRS
47 __slwpcb (void)
48 {
49  return __builtin_ia32_slwpcb();
50 }
51 
69 #define __lwpins32(DATA2, DATA1, FLAGS) \
70  (__builtin_ia32_lwpins32((unsigned int) (DATA2), (unsigned int) (DATA1), \
71  (unsigned int) (FLAGS)))
72 
87 #define __lwpval32(DATA2, DATA1, FLAGS) \
88  (__builtin_ia32_lwpval32((unsigned int) (DATA2), (unsigned int) (DATA1), \
89  (unsigned int) (FLAGS)))
90 
91 #ifdef __x86_64__
92 
110 #define __lwpins64(DATA2, DATA1, FLAGS) \
111  (__builtin_ia32_lwpins64((unsigned long long) (DATA2), (unsigned int) (DATA1), \
112  (unsigned int) (FLAGS)))
113 
128 #define __lwpval64(DATA2, DATA1, FLAGS) \
129  (__builtin_ia32_lwpval64((unsigned long long) (DATA2), (unsigned int) (DATA1), \
130  (unsigned int) (FLAGS)))
131 
132 #endif
133 
134 #undef __DEFAULT_FN_ATTRS
135 
136 #endif /* __LWPINTRIN_H */
static __inline__ void *__DEFAULT_FN_ATTRS __slwpcb(void)
Flushes the LWP state to memory and returns the address of the LWPCB.
Definition: lwpintrin.h:47
#define __DEFAULT_FN_ATTRS
Definition: lwpintrin.h:18
static __inline__ void __DEFAULT_FN_ATTRS __llwpcb(void *__addr)
Parses the LWPCB at the specified address and enables profiling if valid.
Definition: lwpintrin.h:32