index.html revision 0ec64cebd9fe84734506899cb08a5a792bee35e4
1ff5380f65f639f043680868c74927c15f7428499Chris Lattner<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
2ff5380f65f639f043680868c74927c15f7428499Chris Lattner          "http://www.w3.org/TR/html4/strict.dtd">
3ff5380f65f639f043680868c74927c15f7428499Chris Lattner<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
4ff5380f65f639f043680868c74927c15f7428499Chris Lattner<html>
5ff5380f65f639f043680868c74927c15f7428499Chris Lattner<head>
6ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
7c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <title>"compiler-rt" Runtime Library</title>
8ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <link type="text/css" rel="stylesheet" href="menu.css">
9ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <link type="text/css" rel="stylesheet" href="content.css">
10ff5380f65f639f043680868c74927c15f7428499Chris Lattner</head>
11135bcdf9ca7584489050b23b2ee155cce6d6cce3Chris Lattner
12ff5380f65f639f043680868c74927c15f7428499Chris Lattner<body>
13ff5380f65f639f043680868c74927c15f7428499Chris Lattner<!--#include virtual="menu.html.incl"-->
14ff5380f65f639f043680868c74927c15f7428499Chris Lattner<div id="content">
15ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--*********************************************************************-->
16c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <h1>"compiler-rt" Runtime Library</h1>
17ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--*********************************************************************-->
18ff5380f65f639f043680868c74927c15f7428499Chris Lattner  
19c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <p>The compiler-rt project is a simple library that provides an implementation
20ff5380f65f639f043680868c74927c15f7428499Chris Lattner     of the low-level target-specific hooks required by code generation and
21ff5380f65f639f043680868c74927c15f7428499Chris Lattner     other runtime components.  For example, when compiling for a 32-bit target,
22ff5380f65f639f043680868c74927c15f7428499Chris Lattner    converting a double to a 64-bit unsigned integer is compiling into a runtime
23c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner    call to the "__fixunsdfdi" function.  The compiler-rt library provides
24ff5380f65f639f043680868c74927c15f7428499Chris Lattner    optimized implementations of this and other low-level routines.</p>
25eb561bef8f503f399d1a429737f5657aa6e21369Chris Lattner
264b1219694b97516aa72ca498a336dbf19f295fd2Chris Lattner  <p>All of the code in the compiler-rt project is <a 
274b1219694b97516aa72ca498a336dbf19f295fd2Chris Lattner     href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
284b1219694b97516aa72ca498a336dbf19f295fd2Chris Lattner     under the MIT license and the UIUC License (a BSD-like license).</p>
290ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar
300ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar  <!--=====================================================================-->
310ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar  <h2 id="users">Clients</h2>
320ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar  <!--=====================================================================-->
330ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar
340ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar  <p>Currently compiler-rt is primarily used by
350ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    the <a href="http://clang.llvm.org">Clang</a>
360ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    and <a href="http://llvm.org">LLVM</a> projects as the implementation for
370ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    the runtime compiler support libraries. The library currently provides both
380ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    the low-level target-specific hooks required by code generation, as well as
390ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    additional modules for supporting the runtime requirements of features like
400ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    code coverage, profiling, or address sanitizer (ASAN) instrumentation.</p>
410ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar
420ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar  <p>For more information on using compiler-rt with Clang, please see the Clang
430ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    <a href="http://clang.llvm.org/get_started.html">Getting Started</a>
440ec64cebd9fe84734506899cb08a5a792bee35e4Daniel Dunbar    page.</p>
45ff5380f65f639f043680868c74927c15f7428499Chris Lattner  
46ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--=====================================================================-->
47ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <h2 id="goals">Goals</h2>
48ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--=====================================================================-->
49ff5380f65f639f043680868c74927c15f7428499Chris Lattner  
50c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <p>Different targets require different routines.  The compiler-rt project aims
51ff5380f65f639f043680868c74927c15f7428499Chris Lattner     to implement these routines in both target-independent C form as well as
52ff5380f65f639f043680868c74927c15f7428499Chris Lattner     providing heavily optimized assembly versions of the routines in some
53c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner     cases.  It should be very easy to bring compiler-rt to support a new
54ff5380f65f639f043680868c74927c15f7428499Chris Lattner     target by adding the new routines needed by that target.</p>
55ff5380f65f639f043680868c74927c15f7428499Chris Lattner     
56c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <p>Where it make sense, the compiler-rt project aims to implement interfaces
57ff5380f65f639f043680868c74927c15f7428499Chris Lattner     that are drop-in compatible with the libgcc interfaces.</p>
58ff5380f65f639f043680868c74927c15f7428499Chris Lattner
59ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--=====================================================================-->
60ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <h2 id="features">Features</h2>
61ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--=====================================================================-->
62ff5380f65f639f043680868c74927c15f7428499Chris Lattner
63c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner   <p>The current feature set of compiler-rt is:</p>
64ff5380f65f639f043680868c74927c15f7428499Chris Lattner
65ff5380f65f639f043680868c74927c15f7428499Chris Lattner   <ul>
66f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan    <li>Full support for the libgcc interfaces on supported targets.</li>
67ff5380f65f639f043680868c74927c15f7428499Chris Lattner    <li>High performance hand tuned implementations of commonly used functions
68ff5380f65f639f043680868c74927c15f7428499Chris Lattner        like __floatundidf in assembly that are dramatically faster than the
69ff5380f65f639f043680868c74927c15f7428499Chris Lattner        libgcc implementations.</li>
70ff5380f65f639f043680868c74927c15f7428499Chris Lattner    <li>A target-independent implementation of the Apple "Blocks" runtime
71ff5380f65f639f043680868c74927c15f7428499Chris Lattner        interfaces.</li>
72ff5380f65f639f043680868c74927c15f7428499Chris Lattner   </ul>
73f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan
74f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan  <!--=====================================================================-->
75f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan  <h2 id="requirements">Platform Support</h2>
76f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan  <!--=====================================================================-->
77f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan
78f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   <p>Compiler-RT is known to work on the following platforms:</p>
79f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan
80f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   <li>Machine Architectures:
81f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan    <ul>
82f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <li>i386</li>
83f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <li>X86-64</li>
84ee0093b506cebe629e93a994b301628829352a60Edward O'Callaghan     <li>SPARC64</li>
85ee0093b506cebe629e93a994b301628829352a60Edward O'Callaghan     <li>ARM</li>
86f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <li>PowerPC</li>
87f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <li>PowerPC 64</li>
88f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan    </ul></li>
89f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan
90f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   <table cellpadding="3" summary="Known Compiler-RT platforms">
91f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   <tr>
92f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <th>OS</th>
93f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <th>Arch</th>
94f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   </tr>
95f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   <tr>
96f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <td>AuroraUX</td>
97f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <td>All<sup>
98f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   </tr>
99f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   <tr>
100ac4c794c61fa1871e519ad3cf0b26a53c6bb0f3cEdward O'Callaghan     <td>DragonFlyBSD</td>
101ac4c794c61fa1871e519ad3cf0b26a53c6bb0f3cEdward O'Callaghan     <td>All<sup>
102ac4c794c61fa1871e519ad3cf0b26a53c6bb0f3cEdward O'Callaghan   </tr>
103ac4c794c61fa1871e519ad3cf0b26a53c6bb0f3cEdward O'Callaghan   <tr>
104863dd146bd186581ef71e38a4fac7df3c4c4e5efEdward O'Callaghan     <td>FreeBSD</td>
105863dd146bd186581ef71e38a4fac7df3c4c4e5efEdward O'Callaghan     <td>All<sup>
106863dd146bd186581ef71e38a4fac7df3c4c4e5efEdward O'Callaghan   </tr>
107863dd146bd186581ef71e38a4fac7df3c4c4e5efEdward O'Callaghan   <tr>
108ee0093b506cebe629e93a994b301628829352a60Edward O'Callaghan     <td>NetBSD</td>
109ee0093b506cebe629e93a994b301628829352a60Edward O'Callaghan     <td>All<sup>
110ee0093b506cebe629e93a994b301628829352a60Edward O'Callaghan   </tr>
111ee0093b506cebe629e93a994b301628829352a60Edward O'Callaghan   <tr>
112f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <td>Linux</td>
113f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <td>All<sup>
114f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   </tr>
115f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   <tr>
116f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <td>Darwin</td>
117f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan     <td>All<sup>
118f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   </tr>
119f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan   </table>
120f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan
121f361ff15d3a8286e27f8adc8d02c9d3ed79fc8dbEdward O'Callaghan  <!--=====================================================================-->
122f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan  <h2 id="dir-structure">Source Structure</h2>
123f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan  <!--=====================================================================-->
124f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan
125f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan   <p>A short explanation of the directory structure of compiler-rt:</p>
126f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan
127f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan   <p>For testing it is possible to build a generic library and an optimized library.
128f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan       The optimized library is formed by overlaying the optimized versions onto the generic library.
129f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan       Of course, some architectures have additional functions,
130f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan       so the optimized library may have functions not found in the generic version.</p>
131f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan
132f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan   <ul>   
133f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan    <li> lib/ Is a generic portable implementations.</li>
13448adb329aeb41e07a89a9f0b1341b9a948d47b47Edward O'Callaghan    <li> lib/(arch) has optimized version for the supported architectures.</li>
135f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan   </ul>
136f998156715cdf8ba5d07ab8c853d803a22867e77Edward O'Callaghan    
137ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--=====================================================================-->
138ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <h2>Get it and get involved!</h2>
139ff5380f65f639f043680868c74927c15f7428499Chris Lattner  <!--=====================================================================-->
140ff5380f65f639f043680868c74927c15f7428499Chris Lattner  
141c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <p>To check out the code, use:</p>
142c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  
143c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <ul>
144c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <li>svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt</li>
1452d05d968e18065b85320bbd8bb7bde97b5d87f07Edward O'Callaghan  <li>mkdir build</li>
1462d05d968e18065b85320bbd8bb7bde97b5d87f07Edward O'Callaghan  <li>cd build</li>
1472d05d968e18065b85320bbd8bb7bde97b5d87f07Edward O'Callaghan  <li>cmake /compiler-rt</li>
148c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <li>make</li>
1491bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner  </ul>
1501bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner
1511bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner  <p>To run the Compiler-RT Test Suit (recommended):</p>
1521bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner
1531bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner  <ul>
1548c8d1aaf3b776095d1fe5018d4b16622b46d4e12Edward O'Callaghan  <li>ctest</li>
1551bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner  </ul>
1561bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner
1571bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner  <p>To Install:</p>
1581bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner
1591bb4c3837fcf384c0106191fc405160e74d7d679Chris Lattner  <ul>
1602d05d968e18065b85320bbd8bb7bde97b5d87f07Edward O'Callaghan  <li>make install</li>
161c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  </ul>
162c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  
163c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  <p>compiler-rt doesn't have its own mailing list, if you have questions please
164c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner     email the <a
165c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner    href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">llvmdev</a> mailing
166c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner    list.  Commits to the compiler-rt SVN module are automatically sent to the
167c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner    <a 
168c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner  href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">llvm-commits</a>
169c1346747862498226b5af3c4d4bd3c4dc429d5d7Chris Lattner    mailing list.</p>
170ff5380f65f639f043680868c74927c15f7428499Chris Lattner</div>
171ff5380f65f639f043680868c74927c15f7428499Chris Lattner</body>
172ff5380f65f639f043680868c74927c15f7428499Chris Lattner</html>
173