Mercurial > projects > ldc
comparison runtime/import/ldc/intrinsics.di @ 1076:39b7c32cd010
Reformat intrinsics.di a bit.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Mon, 09 Mar 2009 21:38:24 +0100 |
parents | 34bc1945bc85 |
children | 4e388d9d0e25 |
comparison
equal
deleted
inserted
replaced
1075:34bc1945bc85 | 1076:39b7c32cd010 |
---|---|
27 // | 27 // |
28 // CODE GENERATOR INTRINSICS | 28 // CODE GENERATOR INTRINSICS |
29 // | 29 // |
30 | 30 |
31 | 31 |
32 // The 'llvm.returnaddress' intrinsic attempts to compute a target-specific value indicating the return address of the current function or one of its callers. | 32 // The 'llvm.returnaddress' intrinsic attempts to compute a target-specific |
33 // value indicating the return address of the current function or one of its | |
34 // callers. | |
33 | 35 |
34 pragma(intrinsic, "llvm.returnaddress") | 36 pragma(intrinsic, "llvm.returnaddress") |
35 void* llvm_returnaddress(uint level); | 37 void* llvm_returnaddress(uint level); |
36 | 38 |
37 | 39 |
38 // The 'llvm.frameaddress' intrinsic attempts to return the target-specific frame pointer value for the specified stack frame. | 40 // The 'llvm.frameaddress' intrinsic attempts to return the target-specific |
41 // frame pointer value for the specified stack frame. | |
39 | 42 |
40 pragma(intrinsic, "llvm.frameaddress") | 43 pragma(intrinsic, "llvm.frameaddress") |
41 void* llvm_frameaddress(uint level); | 44 void* llvm_frameaddress(uint level); |
42 | 45 |
43 | 46 |
44 // The 'llvm.stacksave' intrinsic is used to remember the current state of the function stack, for use with llvm.stackrestore. This is useful for implementing language features like scoped automatic variable sized arrays in C99. | 47 // The 'llvm.stacksave' intrinsic is used to remember the current state of the |
48 // function stack, for use with llvm.stackrestore. This is useful for | |
49 // implementing language features like scoped automatic variable sized arrays | |
50 // in C99. | |
45 | 51 |
46 pragma(intrinsic, "llvm.stacksave") | 52 pragma(intrinsic, "llvm.stacksave") |
47 void* llvm_stacksave(); | 53 void* llvm_stacksave(); |
48 | 54 |
49 | 55 |
50 // The 'llvm.stackrestore' intrinsic is used to restore the state of the function stack to the state it was in when the corresponding llvm.stacksave intrinsic executed. This is useful for implementing language features like scoped automatic variable sized arrays in C99. | 56 // The 'llvm.stackrestore' intrinsic is used to restore the state of the |
57 // function stack to the state it was in when the corresponding llvm.stacksave | |
58 // intrinsic executed. This is useful for implementing language features like | |
59 // scoped automatic variable sized arrays in C99. | |
51 | 60 |
52 pragma(intrinsic, "llvm.stackrestore") | 61 pragma(intrinsic, "llvm.stackrestore") |
53 void llvm_stackrestore(void* ptr); | 62 void llvm_stackrestore(void* ptr); |
54 | 63 |
55 | 64 |
56 // The 'llvm.prefetch' intrinsic is a hint to the code generator to insert a prefetch instruction if supported; otherwise, it is a noop. Prefetches have no effect on the behavior of the program but can change its performance characteristics. | 65 // The 'llvm.prefetch' intrinsic is a hint to the code generator to insert a |
66 // prefetch instruction if supported; otherwise, it is a noop. Prefetches have | |
67 // no effect on the behavior of the program but can change its performance | |
68 // characteristics. | |
57 | 69 |
58 pragma(intrinsic, "llvm.prefetch") | 70 pragma(intrinsic, "llvm.prefetch") |
59 void llvm_prefetch(void* ptr, uint rw, uint locality); | 71 void llvm_prefetch(void* ptr, uint rw, uint locality); |
60 | 72 |
61 | 73 |
62 // The 'llvm.pcmarker' intrinsic is a method to export a Program Counter (PC) in a region of code to simulators and other tools. The method is target specific, but it is expected that the marker will use exported symbols to transmit the PC of the marker. The marker makes no guarantees that it will remain with any specific instruction after optimizations. It is possible that the presence of a marker will inhibit optimizations. The intended use is to be inserted after optimizations to allow correlations of simulation runs. | 74 // The 'llvm.pcmarker' intrinsic is a method to export a Program Counter (PC) |
75 // in a region of code to simulators and other tools. The method is target | |
76 // specific, but it is expected that the marker will use exported symbols to | |
77 // transmit the PC of the marker. The marker makes no guarantees that it will | |
78 // remain with any specific instruction after optimizations. It is possible | |
79 // that the presence of a marker will inhibit optimizations. The intended use | |
80 // is to be inserted after optimizations to allow correlations of simulation | |
81 // runs. | |
63 | 82 |
64 pragma(intrinsic, "llvm.pcmarker") | 83 pragma(intrinsic, "llvm.pcmarker") |
65 void llvm_pcmarker(uint id); | 84 void llvm_pcmarker(uint id); |
66 | 85 |
67 | 86 |
68 // The 'llvm.readcyclecounter' intrinsic provides access to the cycle counter register (or similar low latency, high accuracy clocks) on those targets that support it. On X86, it should map to RDTSC. On Alpha, it should map to RPCC. As the backing counters overflow quickly (on the order of 9 seconds on alpha), this should only be used for small timings. | 87 // The 'llvm.readcyclecounter' intrinsic provides access to the cycle counter |
88 // register (or similar low latency, high accuracy clocks) on those targets that | |
89 // support it. On X86, it should map to RDTSC. On Alpha, it should map to RPCC. | |
90 // As the backing counters overflow quickly (on the order of 9 seconds on | |
91 // alpha), this should only be used for small timings. | |
69 | 92 |
70 pragma(intrinsic, "llvm.readcyclecounter") | 93 pragma(intrinsic, "llvm.readcyclecounter") |
71 ulong readcyclecounter(); | 94 ulong readcyclecounter(); |
72 | 95 |
73 | 96 |
76 // | 99 // |
77 // STANDARD C LIBRARY INTRINSICS | 100 // STANDARD C LIBRARY INTRINSICS |
78 // | 101 // |
79 | 102 |
80 | 103 |
81 // The 'llvm.memcpy.*' intrinsics copy a block of memory from the source location to the destination location. | 104 // The 'llvm.memcpy.*' intrinsics copy a block of memory from the source |
82 // Note that, unlike the standard libc function, the llvm.memcpy.* intrinsics do not return a value, and takes an extra alignment argument. | 105 // location to the destination location. |
106 // Note that, unlike the standard libc function, the llvm.memcpy.* intrinsics do | |
107 // not return a value, and takes an extra alignment argument. | |
83 | 108 |
84 pragma(intrinsic, "llvm.memcpy.i32") | 109 pragma(intrinsic, "llvm.memcpy.i32") |
85 void llvm_memcpy_i32(void* dst, void* src, uint len, uint alignment); | 110 void llvm_memcpy_i32(void* dst, void* src, uint len, uint alignment); |
111 | |
86 pragma(intrinsic, "llvm.memcpy.i64") | 112 pragma(intrinsic, "llvm.memcpy.i64") |
87 void llvm_memcpy_i64(void* dst, void* src, ulong len, uint alignment); | 113 void llvm_memcpy_i64(void* dst, void* src, ulong len, uint alignment); |
88 | 114 |
89 | 115 |
90 // The 'llvm.memmove.*' intrinsics move a block of memory from the source location to the destination location. It is similar to the 'llvm.memcpy' intrinsic but allows the two memory locations to overlap. | 116 // The 'llvm.memmove.*' intrinsics move a block of memory from the source |
91 // Note that, unlike the standard libc function, the llvm.memmove.* intrinsics do not return a value, and takes an extra alignment argument. | 117 // location to the destination location. It is similar to the 'llvm.memcpy' |
118 // intrinsic but allows the two memory locations to overlap. | |
119 // Note that, unlike the standard libc function, the llvm.memmove.* intrinsics | |
120 // do not return a value, and takes an extra alignment argument. | |
92 | 121 |
93 pragma(intrinsic, "llvm.memmove.i32") | 122 pragma(intrinsic, "llvm.memmove.i32") |
94 void llvm_memmove_i32(void* dst, void* src, uint len, uint alignment); | 123 void llvm_memmove_i32(void* dst, void* src, uint len, uint alignment); |
124 | |
95 pragma(intrinsic, "llvm.memmove.i64") | 125 pragma(intrinsic, "llvm.memmove.i64") |
96 void llvm_memmove_i64(void* dst, void* src, ulong len, int alignment); | 126 void llvm_memmove_i64(void* dst, void* src, ulong len, int alignment); |
97 | 127 |
98 | 128 |
99 // The 'llvm.memset.*' intrinsics fill a block of memory with a particular byte value. | 129 // The 'llvm.memset.*' intrinsics fill a block of memory with a particular byte |
100 // Note that, unlike the standard libc function, the llvm.memset intrinsic does not return a value, and takes an extra alignment argument. | 130 // value. |
131 // Note that, unlike the standard libc function, the llvm.memset intrinsic does | |
132 // not return a value, and takes an extra alignment argument. | |
101 | 133 |
102 pragma(intrinsic, "llvm.memset.i32") | 134 pragma(intrinsic, "llvm.memset.i32") |
103 void llvm_memset_i32(void* dst, ubyte val, uint len, uint alignment); | 135 void llvm_memset_i32(void* dst, ubyte val, uint len, uint alignment); |
136 | |
104 pragma(intrinsic, "llvm.memset.i64") | 137 pragma(intrinsic, "llvm.memset.i64") |
105 void llvm_memset_i64(void* dst, ubyte val, ulong len, uint alignment); | 138 void llvm_memset_i64(void* dst, ubyte val, ulong len, uint alignment); |
106 | 139 |
107 | 140 |
108 // The 'llvm.sqrt' intrinsics return the sqrt of the specified operand, returning the same value as the libm 'sqrt' functions would. Unlike sqrt in libm, however, llvm.sqrt has undefined behavior for negative numbers other than -0.0 (which allows for better optimization, because there is no need to worry about errno being set). llvm.sqrt(-0.0) is defined to return -0.0 like IEEE sqrt. | 141 // The 'llvm.sqrt' intrinsics return the sqrt of the specified operand, |
142 // returning the same value as the libm 'sqrt' functions would. Unlike sqrt in | |
143 // libm, however, llvm.sqrt has undefined behavior for negative numbers other | |
144 // than -0.0 (which allows for better optimization, because there is no need to | |
145 // worry about errno being set). llvm.sqrt(-0.0) is defined to return -0.0 like | |
146 // IEEE sqrt. | |
109 | 147 |
110 pragma(intrinsic, "llvm.sqrt.f32") | 148 pragma(intrinsic, "llvm.sqrt.f32") |
111 float llvm_sqrt_f32(float val); | 149 float llvm_sqrt_f32(float val); |
150 | |
112 pragma(intrinsic, "llvm.sqrt.f64") | 151 pragma(intrinsic, "llvm.sqrt.f64") |
113 double llvm_sqrt_f64(double val); | 152 double llvm_sqrt_f64(double val); |
114 | 153 |
115 version(Reals_80Bit) | 154 version(Reals_80Bit) |
116 { | 155 { |
123 pragma(intrinsic, "llvm.sqrt.f64") | 162 pragma(intrinsic, "llvm.sqrt.f64") |
124 real llvm_sqrt_real(real val); | 163 real llvm_sqrt_real(real val); |
125 } | 164 } |
126 | 165 |
127 | 166 |
128 // The 'llvm.sin.*' intrinsics return the sine of the operand. | 167 // The 'llvm.sin.*' intrinsics return the sine of the operand. |
129 | 168 |
130 pragma(intrinsic, "llvm.sin.f32") | 169 pragma(intrinsic, "llvm.sin.f32") |
131 float llvm_sin_f32(float val); | 170 float llvm_sin_f32(float val); |
171 | |
132 pragma(intrinsic, "llvm.sin.f64") | 172 pragma(intrinsic, "llvm.sin.f64") |
133 double llvm_sin_f64(double val); | 173 double llvm_sin_f64(double val); |
134 | 174 |
135 version(Reals_80Bit) | 175 version(Reals_80Bit) |
136 { | 176 { |
143 pragma(intrinsic, "llvm.sin.f64") | 183 pragma(intrinsic, "llvm.sin.f64") |
144 real llvm_sin_real(real val); | 184 real llvm_sin_real(real val); |
145 } | 185 } |
146 | 186 |
147 | 187 |
148 // The 'llvm.cos.*' intrinsics return the cosine of the operand. | 188 // The 'llvm.cos.*' intrinsics return the cosine of the operand. |
149 | 189 |
150 pragma(intrinsic, "llvm.cos.f32") | 190 pragma(intrinsic, "llvm.cos.f32") |
151 float llvm_cos_f32(float val); | 191 float llvm_cos_f32(float val); |
192 | |
152 pragma(intrinsic, "llvm.cos.f64") | 193 pragma(intrinsic, "llvm.cos.f64") |
153 double llvm_cos_f64(double val); | 194 double llvm_cos_f64(double val); |
154 | 195 |
155 version(Reals_80Bit) | 196 version(Reals_80Bit) |
156 { | 197 { |
163 pragma(intrinsic, "llvm.cos.f64") | 204 pragma(intrinsic, "llvm.cos.f64") |
164 real llvm_cos_real(real val); | 205 real llvm_cos_real(real val); |
165 } | 206 } |
166 | 207 |
167 | 208 |
168 // The 'llvm.powi.*' intrinsics return the first operand raised to the specified (positive or negative) power. The order of evaluation of multiplications is not defined. When a vector of floating point type is used, the second argument remains a scalar integer value. | 209 // The 'llvm.powi.*' intrinsics return the first operand raised to the specified |
210 // (positive or negative) power. The order of evaluation of multiplications is | |
211 // not defined. When a vector of floating point type is used, the second | |
212 // argument remains a scalar integer value. | |
169 | 213 |
170 pragma(intrinsic, "llvm.powi.f32") | 214 pragma(intrinsic, "llvm.powi.f32") |
171 float llvm_powi_f32(float val, int power); | 215 float llvm_powi_f32(float val, int power); |
172 | 216 |
173 pragma(intrinsic, "llvm.powi.f64") | 217 pragma(intrinsic, "llvm.powi.f64") |
184 pragma(intrinsic, "llvm.powi.f64") | 228 pragma(intrinsic, "llvm.powi.f64") |
185 real llvm_powi_real(real val, int power); | 229 real llvm_powi_real(real val, int power); |
186 } | 230 } |
187 | 231 |
188 | 232 |
189 // The 'llvm.pow.*' intrinsics return the first operand raised to the specified (positive or negative) power. | 233 // The 'llvm.pow.*' intrinsics return the first operand raised to the specified |
234 // (positive or negative) power. | |
190 | 235 |
191 pragma(intrinsic, "llvm.pow.f32") | 236 pragma(intrinsic, "llvm.pow.f32") |
192 float llvm_pow_f32(float val, float power); | 237 float llvm_pow_f32(float val, float power); |
193 | 238 |
194 pragma(intrinsic, "llvm.pow.f64") | 239 pragma(intrinsic, "llvm.pow.f64") |
209 | 254 |
210 // | 255 // |
211 // BIT MANIPULATION INTRINSICS | 256 // BIT MANIPULATION INTRINSICS |
212 // | 257 // |
213 | 258 |
214 // The 'llvm.bswap' family of intrinsics is used to byte swap integer values with an even number of bytes (positive multiple of 16 bits). These are useful for performing operations on data that is not in the target's native byte order. | 259 // The 'llvm.bswap' family of intrinsics is used to byte swap integer values |
260 // with an even number of bytes (positive multiple of 16 bits). These are | |
261 // useful for performing operations on data that is not in the target's native | |
262 // byte order. | |
215 | 263 |
216 pragma(intrinsic, "llvm.bswap.i16.i16") | 264 pragma(intrinsic, "llvm.bswap.i16.i16") |
217 ushort llvm_bswap_i16(ushort val); | 265 ushort llvm_bswap_i16(ushort val); |
218 | 266 |
219 pragma(intrinsic, "llvm.bswap.i32.i32") | 267 pragma(intrinsic, "llvm.bswap.i32.i32") |
221 | 269 |
222 pragma(intrinsic, "llvm.bswap.i64.i64") | 270 pragma(intrinsic, "llvm.bswap.i64.i64") |
223 ulong llvm_bswap_i64(ulong val); | 271 ulong llvm_bswap_i64(ulong val); |
224 | 272 |
225 | 273 |
226 // The 'llvm.ctpop' family of intrinsics counts the number of bits set in a value. | 274 // The 'llvm.ctpop' family of intrinsics counts the number of bits set in a |
275 // value. | |
227 | 276 |
228 pragma(intrinsic, "llvm.ctpop.i8") | 277 pragma(intrinsic, "llvm.ctpop.i8") |
229 ubyte llvm_ctpop_i8(ubyte src); | 278 ubyte llvm_ctpop_i8(ubyte src); |
230 | 279 |
231 pragma(intrinsic, "llvm.ctpop.i16") | 280 pragma(intrinsic, "llvm.ctpop.i16") |
236 | 285 |
237 pragma(intrinsic, "llvm.ctpop.i64") | 286 pragma(intrinsic, "llvm.ctpop.i64") |
238 ulong llvm_ctpop_i64(ulong src); | 287 ulong llvm_ctpop_i64(ulong src); |
239 | 288 |
240 | 289 |
241 // The 'llvm.ctlz' family of intrinsic functions counts the number of leading zeros in a variable. | 290 // The 'llvm.ctlz' family of intrinsic functions counts the number of leading |
291 // zeros in a variable. | |
242 | 292 |
243 pragma(intrinsic, "llvm.ctlz.i8") | 293 pragma(intrinsic, "llvm.ctlz.i8") |
244 ubyte llvm_ctlz_i8(ubyte src); | 294 ubyte llvm_ctlz_i8(ubyte src); |
245 | 295 |
246 pragma(intrinsic, "llvm.ctlz.i16") | 296 pragma(intrinsic, "llvm.ctlz.i16") |
251 | 301 |
252 pragma(intrinsic, "llvm.ctlz.i64") | 302 pragma(intrinsic, "llvm.ctlz.i64") |
253 ulong llvm_ctlz_i64(ulong src); | 303 ulong llvm_ctlz_i64(ulong src); |
254 | 304 |
255 | 305 |
256 // The 'llvm.cttz' family of intrinsic functions counts the number of trailing zeros. | 306 // The 'llvm.cttz' family of intrinsic functions counts the number of trailing |
307 // zeros. | |
257 | 308 |
258 pragma(intrinsic, "llvm.cttz.i8") | 309 pragma(intrinsic, "llvm.cttz.i8") |
259 ubyte llvm_cttz_i8(ubyte src); | 310 ubyte llvm_cttz_i8(ubyte src); |
260 | 311 |
261 pragma(intrinsic, "llvm.cttz.i16") | 312 pragma(intrinsic, "llvm.cttz.i16") |
266 | 317 |
267 pragma(intrinsic, "llvm.cttz.i64") | 318 pragma(intrinsic, "llvm.cttz.i64") |
268 ulong llvm_cttz_i64(ulong src); | 319 ulong llvm_cttz_i64(ulong src); |
269 | 320 |
270 | 321 |
271 // The 'llvm.part.select' family of intrinsic functions selects a range of bits from an integer value and returns them in the same bit width as the original value. | 322 // The 'llvm.part.select' family of intrinsic functions selects a range of bits |
323 // from an integer value and returns them in the same bit width as the original | |
324 // value. | |
272 | 325 |
273 pragma(intrinsic, "llvm.part.select.i8") | 326 pragma(intrinsic, "llvm.part.select.i8") |
274 ubyte llvm_part_select_i(ubyte val, uint loBit, uint hiBit); | 327 ubyte llvm_part_select_i(ubyte val, uint loBit, uint hiBit); |
275 | 328 |
276 pragma(intrinsic, "llvm.part.select.i16") | 329 pragma(intrinsic, "llvm.part.select.i16") |
281 | 334 |
282 pragma(intrinsic, "llvm.part.select.i64") | 335 pragma(intrinsic, "llvm.part.select.i64") |
283 ulong llvm_part_select_i(ulong val, uint loBit, uint hiBit); | 336 ulong llvm_part_select_i(ulong val, uint loBit, uint hiBit); |
284 | 337 |
285 | 338 |
286 // The 'llvm.part.set' family of intrinsic functions replaces a range of bits in an integer value with another integer value. It returns the integer with the replaced bits. | 339 // The 'llvm.part.set' family of intrinsic functions replaces a range of bits |
340 // in an integer value with another integer value. It returns the integer with | |
341 // the replaced bits. | |
287 | 342 |
288 // TODO | 343 // TODO |
289 // declare i17 @llvm.part.set.i17.i9 (i17 %val, i9 %repl, i32 %lo, i32 %hi) | 344 // declare i17 @llvm.part.set.i17.i9 (i17 %val, i9 %repl, i32 %lo, i32 %hi) |
290 // declare i29 @llvm.part.set.i29.i9 (i29 %val, i9 %repl, i32 %lo, i32 %hi) | 345 // declare i29 @llvm.part.set.i29.i9 (i29 %val, i9 %repl, i32 %lo, i32 %hi) |
291 | 346 |
294 | 349 |
295 // | 350 // |
296 // ATOMIC OPERATIONS AND SYNCHRONIZATION INTRINSICS | 351 // ATOMIC OPERATIONS AND SYNCHRONIZATION INTRINSICS |
297 // | 352 // |
298 | 353 |
299 // The llvm.memory.barrier intrinsic guarantees ordering between specific pairs of memory access types. | 354 // The llvm.memory.barrier intrinsic guarantees ordering between specific |
355 // pairs of memory access types. | |
300 | 356 |
301 pragma(intrinsic, "llvm.memory.barrier") | 357 pragma(intrinsic, "llvm.memory.barrier") |
302 void llvm_memory_barrier(bool ll, bool ls, bool sl, bool ss, bool device); | 358 void llvm_memory_barrier(bool ll, bool ls, bool sl, bool ss, bool device); |
303 | 359 |
304 // This loads a value in memory and compares it to a given value. If they are equal, it stores a new value into the memory. | 360 // This loads a value in memory and compares it to a given value. If they are |
361 // equal, it stores a new value into the memory. | |
305 | 362 |
306 pragma(intrinsic, "llvm.atomic.cmp.swap.i#.p0i#") | 363 pragma(intrinsic, "llvm.atomic.cmp.swap.i#.p0i#") |
307 T llvm_atomic_cmp_swap(T)(T* ptr, T cmp, T val); | 364 T llvm_atomic_cmp_swap(T)(T* ptr, T cmp, T val); |
308 | 365 |
309 // This intrinsic loads the value stored in memory at ptr and yields the value from memory. It then stores the value in val in the memory at ptr. | 366 // This intrinsic loads the value stored in memory at ptr and yields the value |
367 // from memory. It then stores the value in val in the memory at ptr. | |
310 | 368 |
311 pragma(intrinsic, "llvm.atomic.swap.i#.p0i#") | 369 pragma(intrinsic, "llvm.atomic.swap.i#.p0i#") |
312 T llvm_atomic_swap(T)(T* ptr, T val); | 370 T llvm_atomic_swap(T)(T* ptr, T val); |
313 | 371 |
314 // This intrinsic adds delta to the value stored in memory at ptr. It yields the original value at ptr. | 372 // This intrinsic adds delta to the value stored in memory at ptr. It yields |
373 // the original value at ptr. | |
315 | 374 |
316 pragma(intrinsic, "llvm.atomic.load.add.i#.p0i#") | 375 pragma(intrinsic, "llvm.atomic.load.add.i#.p0i#") |
317 T llvm_atomic_load_add(T)(T* ptr, T val); | 376 T llvm_atomic_load_add(T)(T* ptr, T val); |
318 | 377 |
319 // This intrinsic subtracts delta to the value stored in memory at ptr. It yields the original value at ptr. | 378 // This intrinsic subtracts delta to the value stored in memory at ptr. It |
379 // yields the original value at ptr. | |
320 | 380 |
321 pragma(intrinsic, "llvm.atomic.load.sub.i#.p0i#") | 381 pragma(intrinsic, "llvm.atomic.load.sub.i#.p0i#") |
322 T llvm_atomic_load_sub(T)(T* ptr, T val); | 382 T llvm_atomic_load_sub(T)(T* ptr, T val); |
323 | 383 |
324 // These intrinsics bitwise the operation (and, nand, or, xor) delta to the value stored in memory at ptr. It yields the original value at ptr. | 384 // These intrinsics bitwise the operation (and, nand, or, xor) delta to the |
385 // value stored in memory at ptr. It yields the original value at ptr. | |
325 | 386 |
326 pragma(intrinsic, "llvm.atomic.load.and.i#.p0i#") | 387 pragma(intrinsic, "llvm.atomic.load.and.i#.p0i#") |
327 T llvm_atomic_load_and(T)(T* ptr, T val); | 388 T llvm_atomic_load_and(T)(T* ptr, T val); |
389 | |
328 pragma(intrinsic, "llvm.atomic.load.nand.i#.p0i#") | 390 pragma(intrinsic, "llvm.atomic.load.nand.i#.p0i#") |
329 T llvm_atomic_load_nand(T)(T* ptr, T val); | 391 T llvm_atomic_load_nand(T)(T* ptr, T val); |
392 | |
330 pragma(intrinsic, "llvm.atomic.load.or.i#.p0i#") | 393 pragma(intrinsic, "llvm.atomic.load.or.i#.p0i#") |
331 T llvm_atomic_load_or(T)(T* ptr, T val); | 394 T llvm_atomic_load_or(T)(T* ptr, T val); |
395 | |
332 pragma(intrinsic, "llvm.atomic.load.xor.i#.p0i#") | 396 pragma(intrinsic, "llvm.atomic.load.xor.i#.p0i#") |
333 T llvm_atomic_load_xor(T)(T* ptr, T val); | 397 T llvm_atomic_load_xor(T)(T* ptr, T val); |
334 | 398 |
335 // These intrinsics takes the signed or unsigned minimum or maximum of delta and the value stored in memory at ptr. It yields the original value at ptr. | 399 // These intrinsics takes the signed or unsigned minimum or maximum of delta |
400 // and the value stored in memory at ptr. It yields the original value at ptr. | |
336 | 401 |
337 pragma(intrinsic, "llvm.atomic.load.max.i#.p0i#") | 402 pragma(intrinsic, "llvm.atomic.load.max.i#.p0i#") |
338 T llvm_atomic_load_max(T)(T* ptr, T val); | 403 T llvm_atomic_load_max(T)(T* ptr, T val); |
404 | |
339 pragma(intrinsic, "llvm.atomic.load.min.i#.p0i#") | 405 pragma(intrinsic, "llvm.atomic.load.min.i#.p0i#") |
340 T llvm_atomic_load_min(T)(T* ptr, T val); | 406 T llvm_atomic_load_min(T)(T* ptr, T val); |
407 | |
341 pragma(intrinsic, "llvm.atomic.load.umax.i#.p0i#") | 408 pragma(intrinsic, "llvm.atomic.load.umax.i#.p0i#") |
342 T llvm_atomic_load_umax(T)(T* ptr, T val); | 409 T llvm_atomic_load_umax(T)(T* ptr, T val); |
410 | |
343 pragma(intrinsic, "llvm.atomic.load.umin.i#.p0i#") | 411 pragma(intrinsic, "llvm.atomic.load.umin.i#.p0i#") |
344 T llvm_atomic_load_umin(T)(T* ptr, T val); | 412 T llvm_atomic_load_umin(T)(T* ptr, T val); |
345 | 413 |
346 | 414 |
347 // | 415 // |
359 OverflowRet!(T) llvm_sadd_with_overflow(T)(T lhs, T rhs); | 427 OverflowRet!(T) llvm_sadd_with_overflow(T)(T lhs, T rhs); |
360 | 428 |
361 pragma(intrinsic, "llvm.uadd.with.overflow.i#") | 429 pragma(intrinsic, "llvm.uadd.with.overflow.i#") |
362 OverflowRet!(T) llvm_uadd_with_overflow(T)(T lhs, T rhs); | 430 OverflowRet!(T) llvm_uadd_with_overflow(T)(T lhs, T rhs); |
363 | 431 |
432 | |
364 // Signed and unsigned subtraction | 433 // Signed and unsigned subtraction |
365 pragma(intrinsic, "llvm.ssub.with.overflow.i#") | 434 pragma(intrinsic, "llvm.ssub.with.overflow.i#") |
366 OverflowRet!(T) llvm_ssub_with_overflow(T)(T lhs, T rhs); | 435 OverflowRet!(T) llvm_ssub_with_overflow(T)(T lhs, T rhs); |
367 | 436 |
368 pragma(intrinsic, "llvm.usub.with.overflow.i#") | 437 pragma(intrinsic, "llvm.usub.with.overflow.i#") |
369 OverflowRet!(T) llvm_usub_with_overflow(T)(T lhs, T rhs); | 438 OverflowRet!(T) llvm_usub_with_overflow(T)(T lhs, T rhs); |
439 | |
370 | 440 |
371 // Signed and unsigned multiplication | 441 // Signed and unsigned multiplication |
372 pragma(intrinsic, "llvm.smul.with.overflow.i#") | 442 pragma(intrinsic, "llvm.smul.with.overflow.i#") |
373 OverflowRet!(T) llvm_smul_with_overflow(T)(T lhs, T rhs); | 443 OverflowRet!(T) llvm_smul_with_overflow(T)(T lhs, T rhs); |
374 | 444 |
385 // | 455 // |
386 // GENERAL INTRINSICS | 456 // GENERAL INTRINSICS |
387 // | 457 // |
388 | 458 |
389 | 459 |
390 // This intrinsics is lowered to the target dependent trap instruction. If the target does not have a trap instruction, this intrinsic will be lowered to the call of the abort() function. | 460 // This intrinsics is lowered to the target dependent trap instruction. If the |
461 // target does not have a trap instruction, this intrinsic will be lowered to | |
462 // the call of the abort() function. | |
391 | 463 |
392 pragma(intrinsic, "llvm.trap") | 464 pragma(intrinsic, "llvm.trap") |
393 void llvm_trap(); | 465 void llvm_trap(); |