STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
intrin0.h
Go to the documentation of this file.
1 /***
2 * intrin0.h - declarations of compiler intrinsics used by the C++ Standard Library.
3 *
4 * Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 * This header file declares compiler intrinsics that are used by the
8 * C++ Standard Library, especially <atomic>. Compiler throughput is
9 * the only reason that intrin0.h is separate from intrin.h.
10 *
11 ****/
12 
13 #pragma once
14 #define __INTRIN0_H_
15 #ifndef RC_INVOKED
16 #ifndef __midl
17 
18 #if defined (__cplusplus)
19 extern "C" {
20 #endif /* defined (__cplusplus) */
21 
22 /*
23 ** __MACHINE : everything
24 ** __MACHINEX86 : x86 only
25 ** __MACHINEX64 : x64 only
26 ** __MACHINEX86_X64 : x86 and x64 only
27 ** __MACHINEARM : ARM only
28 ** __MACHINEARM64 : ARM64 only
29 ** __MACHINEARM_ARM64 : ARM and ARM64 only
30 ** __MACHINEARM_ARM64_X64 : ARM and 64-bit Arch only
31 ** __MACHINEARM64_X64 : ARM64 and x64 only
32 ** __MACHINEWVMPURE : /clr:pure only
33 ** __MACHINEZ : nothing
34 */
35 
36 #define __MACHINEX86 __MACHINE
37 #define __MACHINEX64 __MACHINE
38 #define __MACHINEX86_X64 __MACHINE
39 #define __MACHINEARM __MACHINE
40 #define __MACHINEARM64 __MACHINE
41 #define __MACHINEARM_ARM64 __MACHINE
42 #define __MACHINEARM_ARM64_X64 __MACHINE
43 #define __MACHINEARM64_X64 __MACHINE
44 
45 /* Most intrinsics not available to pure managed code */
46 #if defined (_M_CEE_PURE)
47 #define __MACHINE(X) __MACHINEZ(X)
48 #define __MACHINEWVMPURE(X) X;
49 #else /* defined (_M_CEE_PURE) */
50 #define __MACHINE(X) X;
51 #define __MACHINEWVMPURE(X) __MACHINEZ(X)
52 #endif /* defined (_M_CEE_PURE) */
53 
54 #define __MACHINEZ(X) /* NOTHING */
55 
56 #if !defined (_M_IX86)
57 #undef __MACHINEX86
58 #define __MACHINEX86 __MACHINEZ
59 #endif /* !defined (_M_IX86) */
60 
61 #if !defined (_M_X64)
62 #undef __MACHINEX64
63 #define __MACHINEX64 __MACHINEZ
64 #endif /* !defined (_M_X64) */
65 
66 #if !(defined (_M_IX86) || defined (_M_X64))
67 #undef __MACHINEX86_X64
68 #define __MACHINEX86_X64 __MACHINEZ
69 #endif /* !(defined (_M_IX86) || defined (_M_X64)) */
70 
71 #if !defined (_M_ARM)
72 #undef __MACHINEARM
73 #define __MACHINEARM __MACHINEZ
74 #endif /* !defined (_M_ARM) */
75 
76 /* For compatibility with <winnt.h>, some intrinsics are __cdecl except on x64 */
77 #if defined (_M_X64)
78 #define __MACHINECALL_CDECL_OR_DEFAULT
79 #else
80 #define __MACHINECALL_CDECL_OR_DEFAULT __cdecl
81 #endif
82 
83 #if !defined(_M_ARM64)
84 #undef __MACHINEARM64
85 #define __MACHINEARM64 __MACHINEZ
86 #endif
87 
88 #if !(defined(_M_ARM) || defined(_M_ARM64))
89 #undef __MACHINEARM_ARM64
90 #define __MACHINEARM_ARM64 __MACHINEZ
91 #endif
92 
93 #if !(defined(_M_ARM) || defined(_M_X64) || defined(_M_ARM64))
94 #undef __MACHINEARM_ARM64_X64
95 #define __MACHINEARM_ARM64_X64 __MACHINEZ
96 #endif
97 
98 #if !(defined(_M_X64) || defined(_M_ARM64))
99 #undef __MACHINEARM64_X64
100 #define __MACHINEARM64_X64 __MACHINEZ
101 #endif
102 
103 /*******************************************************************
104 * Note: New intrinsics should be added here IF AND ONLY IF they're *
105 * being used by the C++ Standard Library. *
106 * OTHERWISE, new intrinsics should be added to intrin.h. *
107 *******************************************************************/
108 
109 __MACHINEARM_ARM64(void __dmb(unsigned int _Type))
110 
111 __MACHINE(long _InterlockedAnd(long volatile * _Value, long _Mask))
112 __MACHINE(short _InterlockedAnd16(short volatile * _Value, short _Mask))
113 __MACHINEARM_ARM64(short _InterlockedAnd16_acq(short volatile * _Value, short _Mask))
114 __MACHINEARM_ARM64(short _InterlockedAnd16_nf(short volatile * _Value, short _Mask))
115 __MACHINEARM_ARM64(short _InterlockedAnd16_rel(short volatile * _Value, short _Mask))
116 __MACHINEARM_ARM64_X64(__int64 _InterlockedAnd64(__int64 volatile * _Value, __int64 _Mask))
117 __MACHINEARM_ARM64(__int64 _InterlockedAnd64_acq(__int64 volatile * _Value, __int64 _Mask))
118 __MACHINEARM_ARM64(__int64 _InterlockedAnd64_nf(__int64 volatile * _Value, __int64 _Mask))
119 __MACHINEARM_ARM64(__int64 _InterlockedAnd64_rel(__int64 volatile * _Value, __int64 _Mask))
120 __MACHINE(char _InterlockedAnd8(char volatile * _Value, char _Mask))
121 __MACHINEARM_ARM64(char _InterlockedAnd8_acq(char volatile * _Value, char _Mask))
122 __MACHINEARM_ARM64(char _InterlockedAnd8_nf(char volatile * _Value, char _Mask))
123 __MACHINEARM_ARM64(char _InterlockedAnd8_rel(char volatile * _Value, char _Mask))
124 __MACHINEARM_ARM64(long _InterlockedAnd_acq(long volatile * _Value, long _Mask))
125 __MACHINEARM_ARM64(long _InterlockedAnd_nf(long volatile * _Value, long _Mask))
126 __MACHINEARM_ARM64(long _InterlockedAnd_rel(long volatile * _Value, long _Mask))
127 __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedCompareExchange(long volatile * _Destination, long _Exchange, long _Comparand))
128 __MACHINEWVMPURE(long _InterlockedCompareExchange(long volatile * _Destination, long _Exchange, long _Comparand))
129 __MACHINE(short _InterlockedCompareExchange16(short volatile * _Destination, short _Exchange, short _Comparand))
130 __MACHINEARM_ARM64(short _InterlockedCompareExchange16_acq(short volatile * _Destination, short _Exchange, short _Comparand))
131 __MACHINEARM_ARM64(short _InterlockedCompareExchange16_nf(short volatile * _Destination, short _Exchange, short _Comparand))
132 __MACHINEARM_ARM64(short _InterlockedCompareExchange16_rel(short volatile * _Destination, short _Exchange, short _Comparand))
133 __MACHINE(__int64 _InterlockedCompareExchange64(__int64 volatile * _Destination, __int64 _Exchange, __int64 _Comparand))
134 __MACHINEARM_ARM64(__int64 _InterlockedCompareExchange64_acq(__int64 volatile * _Destination, __int64 _Exchange, __int64 _Comparand))
135 __MACHINEARM_ARM64(__int64 _InterlockedCompareExchange64_nf(__int64 volatile * _Destination, __int64 _Exchange, __int64 _Comparand))
136 __MACHINEARM_ARM64(__int64 _InterlockedCompareExchange64_rel(__int64 volatile * _Destination, __int64 _Exchange, __int64 _Comparand))
137 __MACHINE(char _InterlockedCompareExchange8(char volatile * _Destination, char _Exchange, char _Comparand))
138 __MACHINEARM_ARM64(char _InterlockedCompareExchange8_acq(char volatile * _Destination, char _Exchange, char _Comparand))
139 __MACHINEARM_ARM64(char _InterlockedCompareExchange8_nf(char volatile * _Destination, char _Exchange, char _Comparand))
140 __MACHINEARM_ARM64(char _InterlockedCompareExchange8_rel(char volatile * _Destination, char _Exchange, char _Comparand))
141 __MACHINEARM_ARM64(long _InterlockedCompareExchange_acq(long volatile * _Destination, long _Exchange, long _Comparand))
142 __MACHINEARM_ARM64(long _InterlockedCompareExchange_nf(long volatile * _Destination, long _Exchange, long _Comparand))
143 __MACHINEARM_ARM64(long _InterlockedCompareExchange_rel(long volatile * _Destination, long _Exchange, long _Comparand))
145 __MACHINEWVMPURE(long _InterlockedDecrement(long volatile * _Addend))
146 __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedExchange(long volatile * _Target, long _Value))
147 __MACHINEWVMPURE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedExchange(long volatile * _Target, long _Value))
148 __MACHINE(short _InterlockedExchange16(short volatile * _Target, short _Value))
149 __MACHINEARM_ARM64(short _InterlockedExchange16_acq(short volatile * _Target, short _Value))
150 __MACHINEARM_ARM64(short _InterlockedExchange16_nf(short volatile * _Target, short _Value))
151 __MACHINEARM_ARM64(short _InterlockedExchange16_rel(short volatile * _Target, short _Value))
152 __MACHINEARM_ARM64_X64(__int64 _InterlockedExchange64(__int64 volatile * _Target, __int64 _Value))
153 __MACHINEARM_ARM64(__int64 _InterlockedExchange64_acq(__int64 volatile * _Target, __int64 _Value))
154 __MACHINEARM_ARM64(__int64 _InterlockedExchange64_nf(__int64 volatile * _Target, __int64 _Value))
155 __MACHINEARM_ARM64(__int64 _InterlockedExchange64_rel(__int64 volatile * _Target, __int64 _Value))
156 __MACHINE(char _InterlockedExchange8(char volatile * _Target, char _Value))
157 __MACHINEARM_ARM64(char _InterlockedExchange8_acq(char volatile * _Target, char _Value))
158 __MACHINEARM_ARM64(char _InterlockedExchange8_nf(char volatile * _Target, char _Value))
159 __MACHINEARM_ARM64(char _InterlockedExchange8_rel(char volatile * _Target, char _Value))
160 __MACHINE(long __MACHINECALL_CDECL_OR_DEFAULT _InterlockedExchangeAdd(long volatile * _Addend, long _Value))
161 __MACHINE(short _InterlockedExchangeAdd16(short volatile * _Addend, short _Value))
162 __MACHINEARM_ARM64(short _InterlockedExchangeAdd16_acq(short volatile * _Addend, short _Value))
163 __MACHINEARM_ARM64(short _InterlockedExchangeAdd16_nf(short volatile * _Addend, short _Value))
164 __MACHINEARM_ARM64(short _InterlockedExchangeAdd16_rel(short volatile * _Addend, short _Value))
165 __MACHINEARM_ARM64_X64(__int64 _InterlockedExchangeAdd64(__int64 volatile * _Addend, __int64 _Value))
166 __MACHINEARM_ARM64(__int64 _InterlockedExchangeAdd64_acq(__int64 volatile * _Addend, __int64 _Value))
167 __MACHINEARM_ARM64(__int64 _InterlockedExchangeAdd64_nf(__int64 volatile * _Addend, __int64 _Value))
168 __MACHINEARM_ARM64(__int64 _InterlockedExchangeAdd64_rel(__int64 volatile * _Addend, __int64 _Value))
169 __MACHINE(char _InterlockedExchangeAdd8(char volatile * _Addend, char _Value))
170 __MACHINEARM_ARM64(char _InterlockedExchangeAdd8_acq(char volatile * _Addend, char _Value))
171 __MACHINEARM_ARM64(char _InterlockedExchangeAdd8_nf(char volatile * _Addend, char _Value))
172 __MACHINEARM_ARM64(char _InterlockedExchangeAdd8_rel(char volatile * _Addend, char _Value))
173 __MACHINEARM_ARM64(long _InterlockedExchangeAdd_acq(long volatile * _Addend, long _Value))
174 __MACHINEARM_ARM64(long _InterlockedExchangeAdd_nf(long volatile * _Addend, long _Value))
175 __MACHINEARM_ARM64(long _InterlockedExchangeAdd_rel(long volatile * _Addend, long _Value))
176 __MACHINEARM_ARM64(long _InterlockedExchange_acq(long volatile * _Target, long _Value))
177 __MACHINEARM_ARM64(long _InterlockedExchange_nf(long volatile * _Target, long _Value))
178 __MACHINEARM_ARM64(long _InterlockedExchange_rel(long volatile * _Target, long _Value))
180 __MACHINEWVMPURE(long _InterlockedIncrement(long volatile * _Addend))
181 __MACHINE(long _InterlockedOr(long volatile * _Value, long _Mask))
182 __MACHINE(short _InterlockedOr16(short volatile * _Value, short _Mask))
183 __MACHINEARM_ARM64(short _InterlockedOr16_acq(short volatile * _Value, short _Mask))
184 __MACHINEARM_ARM64(short _InterlockedOr16_nf(short volatile * _Value, short _Mask))
185 __MACHINEARM_ARM64(short _InterlockedOr16_rel(short volatile * _Value, short _Mask))
186 __MACHINEARM_ARM64_X64(__int64 _InterlockedOr64(__int64 volatile * _Value, __int64 _Mask))
187 __MACHINEARM_ARM64(__int64 _InterlockedOr64_acq(__int64 volatile * _Value, __int64 _Mask))
188 __MACHINEARM_ARM64(__int64 _InterlockedOr64_nf(__int64 volatile * _Value, __int64 _Mask))
189 __MACHINEARM_ARM64(__int64 _InterlockedOr64_rel(__int64 volatile * _Value, __int64 _Mask))
190 __MACHINE(char _InterlockedOr8(char volatile * _Value, char _Mask))
191 __MACHINEARM_ARM64(char _InterlockedOr8_acq(char volatile * _Value, char _Mask))
192 __MACHINEARM_ARM64(char _InterlockedOr8_nf(char volatile * _Value, char _Mask))
193 __MACHINEARM_ARM64(char _InterlockedOr8_rel(char volatile * _Value, char _Mask))
194 __MACHINEARM_ARM64(long _InterlockedOr_acq(long volatile * _Value, long _Mask))
195 __MACHINEARM_ARM64(long _InterlockedOr_nf(long volatile * _Value, long _Mask))
196 __MACHINEARM_ARM64(long _InterlockedOr_rel(long volatile * _Value, long _Mask))
197 __MACHINE(long _InterlockedXor(long volatile * _Value, long _Mask))
198 __MACHINE(short _InterlockedXor16(short volatile * _Value, short _Mask))
199 __MACHINEARM_ARM64(short _InterlockedXor16_acq(short volatile * _Value, short _Mask))
200 __MACHINEARM_ARM64(short _InterlockedXor16_nf(short volatile * _Value, short _Mask))
201 __MACHINEARM_ARM64(short _InterlockedXor16_rel(short volatile * _Value, short _Mask))
202 __MACHINEARM_ARM64_X64(__int64 _InterlockedXor64(__int64 volatile * _Value, __int64 _Mask))
203 __MACHINEARM_ARM64(__int64 _InterlockedXor64_acq(__int64 volatile * _Value, __int64 _Mask))
204 __MACHINEARM_ARM64(__int64 _InterlockedXor64_nf(__int64 volatile * _Value, __int64 _Mask))
205 __MACHINEARM_ARM64(__int64 _InterlockedXor64_rel(__int64 volatile * _Value, __int64 _Mask))
206 __MACHINE(char _InterlockedXor8(char volatile * _Value, char _Mask))
207 __MACHINEARM_ARM64(char _InterlockedXor8_acq(char volatile * _Value, char _Mask))
208 __MACHINEARM_ARM64(char _InterlockedXor8_nf(char volatile * _Value, char _Mask))
209 __MACHINEARM_ARM64(char _InterlockedXor8_rel(char volatile * _Value, char _Mask))
210 __MACHINEARM_ARM64(long _InterlockedXor_acq(long volatile * _Value, long _Mask))
211 __MACHINEARM_ARM64(long _InterlockedXor_nf(long volatile * _Value, long _Mask))
212 __MACHINEARM_ARM64(long _InterlockedXor_rel(long volatile * _Value, long _Mask))
213 __MACHINE(void _ReadWriteBarrier(void))
214 __MACHINEARM_ARM64(__int16 __iso_volatile_load16(const volatile __int16 *))
215 __MACHINEARM_ARM64(__int32 __iso_volatile_load32(const volatile __int32 *))
216 __MACHINEARM_ARM64(__int64 __iso_volatile_load64(const volatile __int64 *))
217 __MACHINEARM_ARM64(__int8 __iso_volatile_load8(const volatile __int8 *))
218 __MACHINEARM_ARM64(void __iso_volatile_store16(volatile __int16 *, __int16))
219 __MACHINEARM_ARM64(void __iso_volatile_store32(volatile __int32 *, __int32))
220 __MACHINEARM_ARM64(void __iso_volatile_store64(volatile __int64 *, __int64))
221 __MACHINEARM_ARM64(void __iso_volatile_store8(volatile __int8 *, __int8))
222 __MACHINEARM(__int64 __ldrexd(const volatile __int64 *))
223 __MACHINEARM_ARM64(void __yield(void))
224 __MACHINE(unsigned char _interlockedbittestandset(long volatile *, long))
225 __MACHINEARM_ARM64(unsigned char _interlockedbittestandset_acq(long volatile *, long))
226 __MACHINEARM_ARM64(unsigned char _interlockedbittestandset_nf(long volatile *, long))
227 __MACHINEARM_ARM64(unsigned char _interlockedbittestandset_rel(long volatile *, long))
228 
229 /*******************************************************************
230 * Note: New intrinsics should be added here IF AND ONLY IF they're *
231 * being used by the C++ Standard Library. *
232 * OTHERWISE, new intrinsics should be added to intrin.h. *
233 *******************************************************************/
234 
235 #if defined (__cplusplus)
236 }
237 #endif /* defined (__cplusplus) */
238 #endif /* __midl */
239 #endif /* RC_INVOKED */
_SourceSize void *const _Destination
Definition: corecrt_memcpy_s.h:36
#define __MACHINE(X)
Definition: intrin0.h:50
_In_ wctype_t _Type
Definition: corecrt_wctype.h:111
#define __MACHINECALL_CDECL_OR_DEFAULT
Definition: intrin0.h:80
#define __MACHINEARM_ARM64
Definition: intrin0.h:90
void __dmb(unsigned int _Type)
_In_ _Value
Definition: corecrt_wstdlib.h:65
#define __MACHINEARM_ARM64_X64
Definition: intrin0.h:95
long __cdecl _InterlockedDecrement(long volatile *)
_CRT_MANAGED_FP_DEPRECATE _In_ unsigned int _Mask
Definition: float.h:235
long __cdecl _InterlockedIncrement(long volatile *)
const void * _Target(const type_info &_Info) const _NOEXCEPT
Definition: functional:408
long __cdecl _InterlockedCompareExchange(long volatile *, long, long)
#define __MACHINEARM
Definition: intrin0.h:73
#define __MACHINEWVMPURE(X)
Definition: intrin0.h:51