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