blob: caba8f0ad8437cfee810b957a2ec01bd50794b3d [file] [log] [blame]
Chris Lattner00950542001-06-06 20:29:01 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><title>llvm Assembly Language Reference Manual</title></head>
3<body bgcolor=white>
4
5<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
6<tr><td>&nbsp; <font size=+5 color="#EEEEFF" face="Georgia,Palatino,Times,Roman"><b>llvm Assembly Language Reference Manual</b></font></td>
7</tr></table>
8
9<ol>
10 <li><a href="#abstract">Abstract</a>
11 <li><a href="#introduction">Introduction</a>
12 <li><a href="#identifiers">Identifiers</a>
13 <li><a href="#typesystem">Type System</a>
14 <ol>
15 <li><a href="#t_primitive">Primitive Types</a>
16 <ol>
17 <li><a href="#t_classifications">Type Classifications</a>
18 </ol>
19 <li><a href="#t_derived">Derived Types</a>
20 <ol>
21 <li><a href="#t_array" >Array Type</a>
Chris Lattner7faa8832002-04-14 06:13:44 +000022 <li><a href="#t_function">Function Type</a>
Chris Lattner00950542001-06-06 20:29:01 +000023 <li><a href="#t_pointer">Pointer Type</a>
24 <li><a href="#t_struct" >Structure Type</a>
Chris Lattner690d99b2002-08-29 18:33:48 +000025 <!-- <li><a href="#t_packed" >Packed Type</a> -->
Chris Lattner00950542001-06-06 20:29:01 +000026 </ol>
27 </ol>
28 <li><a href="#highlevel">High Level Structure</a>
29 <ol>
30 <li><a href="#modulestructure">Module Structure</a>
Chris Lattner2b7d3202002-05-06 03:03:22 +000031 <li><a href="#globalvars">Global Variables</a>
Chris Lattner7faa8832002-04-14 06:13:44 +000032 <li><a href="#functionstructure">Function Structure</a>
Chris Lattner00950542001-06-06 20:29:01 +000033 </ol>
34 <li><a href="#instref">Instruction Reference</a>
35 <ol>
36 <li><a href="#terminators">Terminator Instructions</a>
37 <ol>
Chris Lattner7faa8832002-04-14 06:13:44 +000038 <li><a href="#i_ret" >'<tt>ret</tt>' Instruction</a>
39 <li><a href="#i_br" >'<tt>br</tt>' Instruction</a>
40 <li><a href="#i_switch">'<tt>switch</tt>' Instruction</a>
41 <li><a href="#i_invoke">'<tt>invoke</tt>' Instruction</a>
Chris Lattner00950542001-06-06 20:29:01 +000042 </ol>
Chris Lattner00950542001-06-06 20:29:01 +000043 <li><a href="#binaryops">Binary Operations</a>
44 <ol>
45 <li><a href="#i_add" >'<tt>add</tt>' Instruction</a>
46 <li><a href="#i_sub" >'<tt>sub</tt>' Instruction</a>
47 <li><a href="#i_mul" >'<tt>mul</tt>' Instruction</a>
48 <li><a href="#i_div" >'<tt>div</tt>' Instruction</a>
49 <li><a href="#i_rem" >'<tt>rem</tt>' Instruction</a>
50 <li><a href="#i_setcc">'<tt>set<i>cc</i></tt>' Instructions</a>
51 </ol>
52 <li><a href="#bitwiseops">Bitwise Binary Operations</a>
53 <ol>
54 <li><a href="#i_and">'<tt>and</tt>' Instruction</a>
55 <li><a href="#i_or" >'<tt>or</tt>' Instruction</a>
56 <li><a href="#i_xor">'<tt>xor</tt>' Instruction</a>
57 <li><a href="#i_shl">'<tt>shl</tt>' Instruction</a>
58 <li><a href="#i_shr">'<tt>shr</tt>' Instruction</a>
59 </ol>
60 <li><a href="#memoryops">Memory Access Operations</a>
61 <ol>
62 <li><a href="#i_malloc" >'<tt>malloc</tt>' Instruction</a>
63 <li><a href="#i_free" >'<tt>free</tt>' Instruction</a>
64 <li><a href="#i_alloca" >'<tt>alloca</tt>' Instruction</a>
65 <li><a href="#i_load" >'<tt>load</tt>' Instruction</a>
66 <li><a href="#i_store" >'<tt>store</tt>' Instruction</a>
Chris Lattner2b7d3202002-05-06 03:03:22 +000067 <li><a href="#i_getelementptr">'<tt>getelementptr</tt>' Instruction</a>
Chris Lattner00950542001-06-06 20:29:01 +000068 </ol>
69 <li><a href="#otherops">Other Operations</a>
70 <ol>
Chris Lattner6536cfe2002-05-06 22:08:29 +000071 <li><a href="#i_phi" >'<tt>phi</tt>' Instruction</a>
Chris Lattner33ba0d92001-07-09 00:26:23 +000072 <li><a href="#i_cast">'<tt>cast .. to</tt>' Instruction</a>
Chris Lattner00950542001-06-06 20:29:01 +000073 <li><a href="#i_call" >'<tt>call</tt>' Instruction</a>
Chris Lattner00950542001-06-06 20:29:01 +000074 </ol>
Chris Lattner00950542001-06-06 20:29:01 +000075 </ol>
Chris Lattner6536cfe2002-05-06 22:08:29 +000076<!--
Chris Lattner00950542001-06-06 20:29:01 +000077 <li><a href="#related">Related Work</a>
Chris Lattner6536cfe2002-05-06 22:08:29 +000078-->
Chris Lattnerd816bcf2002-08-30 21:50:21 +000079
80 <p><b>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and <A href="mailto:vadve@cs.uiuc.edu">Vikram Adve</a></b><p>
81
82
Chris Lattner00950542001-06-06 20:29:01 +000083</ol>
84
85
86<!-- *********************************************************************** -->
Chris Lattner2b7d3202002-05-06 03:03:22 +000087<p><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
88<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +000089<a name="abstract">Abstract
90</b></font></td></tr></table><ul>
91<!-- *********************************************************************** -->
92
93<blockquote>
Chris Lattner7bae3952002-06-25 18:03:17 +000094 This document is a reference manual for the LLVM assembly language. LLVM is
95 an SSA based representation that provides type safety, low level operations,
96 flexibility, and the capability of representing 'all' high level languages
97 cleanly. It is the common code representation used throughout all phases of
98 the LLVM compilation strategy.
Chris Lattner00950542001-06-06 20:29:01 +000099</blockquote>
100
101
102
103
104<!-- *********************************************************************** -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000105</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
106<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000107<a name="introduction">Introduction
108</b></font></td></tr></table><ul>
109<!-- *********************************************************************** -->
110
Chris Lattner7faa8832002-04-14 06:13:44 +0000111The LLVM code representation is designed to be used in three different forms: as
112an in-memory compiler IR, as an on-disk bytecode representation, suitable for
113fast loading by a dynamic compiler, and as a human readable assembly language
114representation. This allows LLVM to provide a powerful intermediate
115representation for efficient compiler transformations and analysis, while
116providing a natural means to debug and visualize the transformations. The three
117different forms of LLVM are all equivalent. This document describes the human
118readable representation and notation.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000119
Chris Lattner7faa8832002-04-14 06:13:44 +0000120The LLVM representation aims to be a light weight and low level while being
Chris Lattnerb7c6c2a2002-06-25 20:20:08 +0000121expressive, typed, and extensible at the same time. It aims to be a "universal
122IR" of sorts, by being at a low enough level that high level ideas may be
123cleanly mapped to it (similar to how microprocessors are "universal IR's",
124allowing many source languages to be mapped to them). By providing type
125information, LLVM can be used as the target of optimizations: for example,
126through pointer analysis, it can be proven that a C automatic variable is never
127accessed outside of the current function... allowing it to be promoted to a
128simple SSA value instead of a memory location.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000129
130<!-- _______________________________________________________________________ -->
131</ul><a name="wellformed"><h4><hr size=0>Well Formedness</h4><ul>
132
Chris Lattner7faa8832002-04-14 06:13:44 +0000133It is important to note that this document describes 'well formed' llvm assembly
134language. There is a difference between what the parser accepts and what is
135considered 'well formed'. For example, the following instruction is
136syntactically okay, but not well formed:<p>
Chris Lattner00950542001-06-06 20:29:01 +0000137
138<pre>
139 %x = <a href="#i_add">add</a> int 1, %x
140</pre>
141
Chris Lattner7bae3952002-06-25 18:03:17 +0000142...because the definition of %x does not dominate all of its uses. The LLVM
143infrastructure provides a verification pass that may be used to verify that an
144LLVM module is well formed. This pass is automatically run by the parser after
Chris Lattner2b7d3202002-05-06 03:03:22 +0000145parsing input assembly, and by the optimizer before it outputs bytecode. The
Chris Lattner7faa8832002-04-14 06:13:44 +0000146violations pointed out by the verifier pass indicate bugs in transformation
Chris Lattner2b7d3202002-05-06 03:03:22 +0000147passes or input to the parser.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000148
Chris Lattner7bae3952002-06-25 18:03:17 +0000149<!-- Describe the typesetting conventions here. -->
Chris Lattner00950542001-06-06 20:29:01 +0000150
151
152<!-- *********************************************************************** -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000153</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
154<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000155<a name="identifiers">Identifiers
156</b></font></td></tr></table><ul>
157<!-- *********************************************************************** -->
158
159LLVM uses three different forms of identifiers, for different purposes:<p>
160
161<ol>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000162<li>Numeric constants are represented as you would expect: 12, -3 123.421, etc. Floating point constants have an optional hexidecimal notation.
Chris Lattner00950542001-06-06 20:29:01 +0000163<li>Named values are represented as a string of characters with a '%' prefix. For example, %foo, %DivisionByZero, %a.really.long.identifier. The actual regular expression used is '<tt>%[a-zA-Z$._][a-zA-Z$._0-9]*</tt>'.
164<li>Unnamed values are represented as an unsigned numeric value with a '%' prefix. For example, %12, %2, %44.
165</ol><p>
166
Chris Lattner7faa8832002-04-14 06:13:44 +0000167LLVM requires the values start with a '%' sign for two reasons: Compilers don't
168need to worry about name clashes with reserved words, and the set of reserved
169words may be expanded in the future without penalty. Additionally, unnamed
170identifiers allow a compiler to quickly come up with a temporary variable
171without having to avoid symbol table conflicts.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000172
Chris Lattner7faa8832002-04-14 06:13:44 +0000173Reserved words in LLVM are very similar to reserved words in other languages.
174There are keywords for different opcodes ('<tt><a href="#i_add">add</a></tt>',
175'<tt><a href="#i_cast">cast</a></tt>', '<tt><a href="#i_ret">ret</a></tt>',
176etc...), for primitive type names ('<tt><a href="#t_void">void</a></tt>',
177'<tt><a href="#t_uint">uint</a></tt>', etc...), and others. These reserved
178words cannot conflict with variable names, because none of them start with a '%'
179character.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000180
Chris Lattner7faa8832002-04-14 06:13:44 +0000181Here is an example of LLVM code to multiply the integer variable '<tt>%X</tt>'
182by 8:<p>
Chris Lattner00950542001-06-06 20:29:01 +0000183
184The easy way:
185<pre>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000186 %result = <a href="#i_mul">mul</a> uint %X, 8
Chris Lattner00950542001-06-06 20:29:01 +0000187</pre>
188
189After strength reduction:
190<pre>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000191 %result = <a href="#i_shl">shl</a> uint %X, ubyte 3
Chris Lattner00950542001-06-06 20:29:01 +0000192</pre>
193
194And the hard way:
195<pre>
Chris Lattner7bae3952002-06-25 18:03:17 +0000196 <a href="#i_add">add</a> uint %X, %X <i>; yields {uint}:%0</i>
197 <a href="#i_add">add</a> uint %0, %0 <i>; yields {uint}:%1</i>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000198 %result = <a href="#i_add">add</a> uint %1, %1
Chris Lattner00950542001-06-06 20:29:01 +0000199</pre>
200
201This last way of multiplying <tt>%X</tt> by 8 illustrates several important lexical features of LLVM:<p>
202
203<ol>
204<li>Comments are delimited with a '<tt>;</tt>' and go until the end of line.
Chris Lattner7faa8832002-04-14 06:13:44 +0000205<li>Unnamed temporaries are created when the result of a computation is not
206 assigned to a named value.
Chris Lattner00950542001-06-06 20:29:01 +0000207<li>Unnamed temporaries are numbered sequentially
208</ol><p>
209
Chris Lattner7faa8832002-04-14 06:13:44 +0000210...and it also show a convention that we follow in this document. When
211demonstrating instructions, we will follow an instruction with a comment that
212defines the type and name of value produced. Comments are shown in italic
213text.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000214
Chris Lattner2b7d3202002-05-06 03:03:22 +0000215The one unintuitive notation for constants is the optional hexidecimal form of
216floating point constants. For example, the form '<tt>double
2170x432ff973cafa8000</tt>' is equivalent to (but harder to read than) '<tt>double
2184.5e+15</tt>' which is also supported by the parser. The only time hexadecimal
219floating point constants are useful (and the only time that they are generated
220by the disassembler) is when an FP constant has to be emitted that is not
221representable as a decimal floating point number exactly. For example, NaN's,
222infinities, and other special cases are represented in their IEEE hexadecimal
223format so that assembly and disassembly do not cause any bits to change in the
224constants.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000225
226
227<!-- *********************************************************************** -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000228</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
229<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000230<a name="typesystem">Type System
231</b></font></td></tr></table><ul>
232<!-- *********************************************************************** -->
233
Chris Lattner2b7d3202002-05-06 03:03:22 +0000234The LLVM type system is one of the most important features of the intermediate
Chris Lattnerb7c6c2a2002-06-25 20:20:08 +0000235representation. Being typed enables a number of optimizations to be performed
236on the IR directly, without having to do extra analyses on the side before the
237transformation. A strong type system makes it easier to read the generated code
238and enables novel analyses and transformations that are not feasible to perform
239on normal three address code representations.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000240
Chris Lattner7bae3952002-06-25 18:03:17 +0000241<!-- The written form for the type system was heavily influenced by the
242syntactic problems with types in the C language<sup><a
243href="#rw_stroustrup">1</a></sup>.<p> -->
Chris Lattner00950542001-06-06 20:29:01 +0000244
245
246
247<!-- ======================================================================= -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000248</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
249<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000250<a name="t_primitive">Primitive Types
251</b></font></td></tr></table><ul>
252
Chris Lattner7faa8832002-04-14 06:13:44 +0000253The primitive types are the fundemental building blocks of the LLVM system. The
254current set of primitive types are as follows:<p>
Chris Lattner00950542001-06-06 20:29:01 +0000255
256<table border=0 align=center><tr><td>
257
258<table border=1 cellspacing=0 cellpadding=4 align=center>
259<tr><td><tt>void</tt></td> <td>No value</td></tr>
260<tr><td><tt>ubyte</tt></td> <td>Unsigned 8 bit value</td></tr>
261<tr><td><tt>ushort</tt></td><td>Unsigned 16 bit value</td></tr>
262<tr><td><tt>uint</tt></td> <td>Unsigned 32 bit value</td></tr>
263<tr><td><tt>ulong</tt></td> <td>Unsigned 64 bit value</td></tr>
264<tr><td><tt>float</tt></td> <td>32 bit floating point value</td></tr>
265<tr><td><tt>label</tt></td> <td>Branch destination</td></tr>
266</table>
267
Chris Lattner7faa8832002-04-14 06:13:44 +0000268</td><td valign=top>
Chris Lattner00950542001-06-06 20:29:01 +0000269
270<table border=1 cellspacing=0 cellpadding=4 align=center>
271<tr><td><tt>bool</tt></td> <td>True or False value</td></tr>
272<tr><td><tt>sbyte</tt></td> <td>Signed 8 bit value</td></tr>
273<tr><td><tt>short</tt></td> <td>Signed 16 bit value</td></tr>
274<tr><td><tt>int</tt></td> <td>Signed 32 bit value</td></tr>
275<tr><td><tt>long</tt></td> <td>Signed 64 bit value</td></tr>
276<tr><td><tt>double</tt></td><td>64 bit floating point value</td></tr>
Chris Lattner00950542001-06-06 20:29:01 +0000277</table>
278
279</td></tr></table><p>
280
281
282
283<!-- _______________________________________________________________________ -->
284</ul><a name="t_classifications"><h4><hr size=0>Type Classifications</h4><ul>
285
286These different primitive types fall into a few useful classifications:<p>
287
288<table border=1 cellspacing=0 cellpadding=4 align=center>
289<tr><td><a name="t_signed">signed</td> <td><tt>sbyte, short, int, long, float, double</tt></td></tr>
290<tr><td><a name="t_unsigned">unsigned</td><td><tt>ubyte, ushort, uint, ulong</tt></td></tr>
291<tr><td><a name="t_integral">integral</td><td><tt>ubyte, sbyte, ushort, short, uint, int, ulong, long</tt></td></tr>
292<tr><td><a name="t_floating">floating point</td><td><tt>float, double</tt></td></tr>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000293<tr><td><a name="t_firstclass">first class</td><td><tt>bool, ubyte, sbyte, ushort, short,<br> uint, int, ulong, long, float, double, <a href="#t_pointer">pointer</a></tt></td></tr>
Chris Lattner00950542001-06-06 20:29:01 +0000294</table><p>
295
296
297
298
299
300<!-- ======================================================================= -->
301</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0><tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
302<a name="t_derived">Derived Types
303</b></font></td></tr></table><ul>
304
Chris Lattner7faa8832002-04-14 06:13:44 +0000305The real power in LLVM comes from the derived types in the system. This is what
306allows a programmer to represent arrays, functions, pointers, and other useful
307types. Note that these derived types may be recursive: For example, it is
308possible to have a two dimensional array.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000309
310
311
312<!-- _______________________________________________________________________ -->
313</ul><a name="t_array"><h4><hr size=0>Array Type</h4><ul>
314
315<h5>Overview:</h5>
316
Chris Lattner7faa8832002-04-14 06:13:44 +0000317The array type is a very simple derived type that arranges elements sequentially
318in memory. The array type requires a size (number of elements) and an
319underlying data type.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000320
Chris Lattner7faa8832002-04-14 06:13:44 +0000321<h5>Syntax:</h5>
322<pre>
323 [&lt;# elements&gt; x &lt;elementtype&gt;]
324</pre>
Chris Lattner00950542001-06-06 20:29:01 +0000325
Chris Lattner2b7d3202002-05-06 03:03:22 +0000326The number of elements is a constant integer value, elementtype may be any type
Chris Lattner7faa8832002-04-14 06:13:44 +0000327with a size.<p>
328
329<h5>Examples:</h5>
330<ul>
Chris Lattner00950542001-06-06 20:29:01 +0000331 <tt>[40 x int ]</tt>: Array of 40 integer values.<br>
332 <tt>[41 x int ]</tt>: Array of 41 integer values.<br>
333 <tt>[40 x uint]</tt>: Array of 40 unsigned integer values.<p>
Chris Lattner7faa8832002-04-14 06:13:44 +0000334</ul>
Chris Lattner00950542001-06-06 20:29:01 +0000335
336Here are some examples of multidimensional arrays:<p>
337<ul>
338<table border=0 cellpadding=0 cellspacing=0>
339<tr><td><tt>[3 x [4 x int]]</tt></td><td>: 3x4 array integer values.</td></tr>
Chris Lattner7faa8832002-04-14 06:13:44 +0000340<tr><td><tt>[12 x [10 x float]]</tt></td><td>: 2x10 array of single precision floating point values.</td></tr>
Chris Lattner00950542001-06-06 20:29:01 +0000341<tr><td><tt>[2 x [3 x [4 x uint]]]</tt></td><td>: 2x3x4 array of unsigned integer values.</td></tr>
342</table>
343</ul>
344
345
Chris Lattner00950542001-06-06 20:29:01 +0000346<!-- _______________________________________________________________________ -->
Chris Lattner7faa8832002-04-14 06:13:44 +0000347</ul><a name="t_function"><h4><hr size=0>Function Type</h4><ul>
Chris Lattner00950542001-06-06 20:29:01 +0000348
349<h5>Overview:</h5>
350
Chris Lattner7faa8832002-04-14 06:13:44 +0000351The function type can be thought of as a function signature. It consists of a
352return type and a list of formal parameter types. Function types are usually
353used when to build virtual function tables (which are structures of pointers to
354functions), for indirect function calls, and when defining a function.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000355
356<h5>Syntax:</h5>
357<pre>
358 &lt;returntype&gt; (&lt;parameter list&gt;)
359</pre>
360
Chris Lattner7faa8832002-04-14 06:13:44 +0000361Where '<tt>&lt;parameter list&gt;</tt>' is a comma seperated list of type
362specifiers. Optionally, the parameter list may include a type <tt>...</tt>,
363which indicates that the function takes a variable number of arguments. Note
364that there currently is no way to define a function in LLVM that takes a
365variable number of arguments, but it is possible to <b>call</b> a function that
366is vararg.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000367
368<h5>Examples:</h5>
369<ul>
370<table border=0 cellpadding=0 cellspacing=0>
Chris Lattner7faa8832002-04-14 06:13:44 +0000371
372<tr><td><tt>int (int)</tt></td><td>: function taking an <tt>int</tt>, returning
373an <tt>int</tt></td></tr>
374
375<tr><td><tt>float (int, int *) *</tt></td><td>: <a href="#t_pointer">Pointer</a>
376to a function that takes an <tt>int</tt> and a <a href="#t_pointer">pointer</a>
377to <tt>int</tt>, returning <tt>float</tt>.</td></tr>
378
379<tr><td><tt>int (sbyte *, ...)</tt></td><td>: A vararg function that takes at
380least one <a href="#t_pointer">pointer</a> to <tt>sbyte</tt> (signed char in C),
381which returns an integer. This is the signature for <tt>printf</tt> in
382LLVM.</td></tr>
383
Chris Lattner00950542001-06-06 20:29:01 +0000384</table>
385</ul>
386
387
388
389<!-- _______________________________________________________________________ -->
390</ul><a name="t_struct"><h4><hr size=0>Structure Type</h4><ul>
391
392<h5>Overview:</h5>
393
Chris Lattner2b7d3202002-05-06 03:03:22 +0000394The structure type is used to represent a collection of data members together in
Chris Lattner7bae3952002-06-25 18:03:17 +0000395memory. The packing of the field types is defined to match the ABI of the
396underlying processor. The elements of a structure may be any type that has a
397size.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000398
Chris Lattner2b7d3202002-05-06 03:03:22 +0000399Structures are accessed using '<tt><a href="#i_load">load</a></tt> and '<tt><a
400href="#i_store">store</a></tt>' by getting a pointer to a field with the '<tt><a
401href="#i_getelementptr">getelementptr</a></tt>' instruction.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000402
403<h5>Syntax:</h5>
404<pre>
405 { &lt;type list&gt; }
406</pre>
407
408
409<h5>Examples:</h5>
410<table border=0 cellpadding=0 cellspacing=0>
Chris Lattner7faa8832002-04-14 06:13:44 +0000411
412<tr><td><tt>{ int, int, int }</tt></td><td>: a triple of three <tt>int</tt>
413values</td></tr>
414
Chris Lattner7bae3952002-06-25 18:03:17 +0000415<tr><td><tt>{ float, int (int) * }</tt></td><td>: A pair, where the first
Chris Lattner7faa8832002-04-14 06:13:44 +0000416element is a <tt>float</tt> and the second element is a <a
417href="#t_pointer">pointer</a> to a <a href="t_function">function</a> that takes
418an <tt>int</tt>, returning an <tt>int</tt>.</td></tr>
419
Chris Lattner00950542001-06-06 20:29:01 +0000420</table>
421
422
423<!-- _______________________________________________________________________ -->
424</ul><a name="t_pointer"><h4><hr size=0>Pointer Type</h4><ul>
425
Chris Lattner7faa8832002-04-14 06:13:44 +0000426<h5>Overview:</h5>
427
428As in many languages, the pointer type represents a pointer or reference to
429another object, which must live in memory.<p>
430
431<h5>Syntax:</h5>
432<pre>
433 &lt;type&gt; *
434</pre>
435
436<h5>Examples:</h5>
437
438<table border=0 cellpadding=0 cellspacing=0>
439
440<tr><td><tt>[4x int]*</tt></td><td>: <a href="#t_pointer">pointer</a> to <a
441href="#t_array">array</a> of four <tt>int</tt> values</td></tr>
442
443<tr><td><tt>int (int *) *</tt></td><td>: A <a href="#t_pointer">pointer</a> to a
444<a href="t_function">function</a> that takes an <tt>int</tt>, returning an
445<tt>int</tt>.</td></tr>
446
447</table>
448<p>
449
Chris Lattner00950542001-06-06 20:29:01 +0000450
451<!-- _______________________________________________________________________ -->
Chris Lattner7faa8832002-04-14 06:13:44 +0000452<!--
Chris Lattner00950542001-06-06 20:29:01 +0000453</ul><a name="t_packed"><h4><hr size=0>Packed Type</h4><ul>
454
455Mention/decide that packed types work with saturation or not. Maybe have a packed+saturated type in addition to just a packed type.<p>
456
457Packed types should be 'nonsaturated' because standard data types are not saturated. Maybe have a saturated packed type?<p>
458
Chris Lattner7faa8832002-04-14 06:13:44 +0000459-->
460
Chris Lattner00950542001-06-06 20:29:01 +0000461
462<!-- *********************************************************************** -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000463</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
464<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000465<a name="highlevel">High Level Structure
466</b></font></td></tr></table><ul>
467<!-- *********************************************************************** -->
468
469
470<!-- ======================================================================= -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000471</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
472<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000473<a name="modulestructure">Module Structure
474</b></font></td></tr></table><ul>
475
Chris Lattner2b7d3202002-05-06 03:03:22 +0000476LLVM programs are composed of "Module"s, each of which is a translation unit of
477the input programs. Each module consists of functions, global variables, and
478symbol table entries. Modules may be combined together with the LLVM linker,
479which merges function (and global variable) definitions, resolves forward
480declarations, and merges symbol table entries. Here is an example of the "hello world" module:<p>
Chris Lattner00950542001-06-06 20:29:01 +0000481
Chris Lattner2b7d3202002-05-06 03:03:22 +0000482<pre>
483<i>; Declare the string constant as a global constant...</i>
484<a href="#identifiers">%.LC0</a> = <a href="#linkage_decl">internal</a> <a href="#globalvars">constant</a> <a href="#t_array">[13 x sbyte]</a> c"hello world\0A\00" <i>; [13 x sbyte]*</i>
485
486<i>; Forward declaration of puts</i>
487<a href="#functionstructure">declare</a> int "puts"(sbyte*) <i>; int(sbyte*)* </i>
488
489<i>; Definition of main function</i>
490int "main"() { <i>; int()* </i>
491 <i>; Convert [13x sbyte]* to sbyte *...</i>
492 %cast210 = <a href="#i_getelementptr">getelementptr</a> [13 x sbyte]* %.LC0, uint 0, uint 0 <i>; sbyte*</i>
493
494 <i>; Call puts function to write out the string to stdout...</i>
495 <a href="#i_call">call</a> int %puts(sbyte* %cast210) <i>; int</i>
496 <a href="#i_ret">ret</a> int 0
497}
498</pre>
499
500This example is made up of a <a href="#globalvars">global variable</a> named
501"<tt>.LC0</tt>", an external declaration of the "<tt>puts</tt>" function, and a
502<a href="#functionstructure">function definition</a> for "<tt>main</tt>".<p>
503
504<a name="linkage_decl">
505In general, a module is made up of a list of global values, where both functions
506and global variables are global values. Global values are represented by a
507pointer to a memory location (in this case, a pointer to an array of char, and a
508pointer to a function), and can be either "internal" or externally accessible
Chris Lattner7bae3952002-06-25 18:03:17 +0000509(which corresponds to the static keyword in C, when used at global scope).<p>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000510
511For example, since the "<tt>.LC0</tt>" variable is defined to be internal, if
512another module defined a "<tt>.LC0</tt>" variable and was linked with this one,
513one of the two would be renamed, preventing a collision. Since "<tt>main</tt>"
Chris Lattner7bae3952002-06-25 18:03:17 +0000514and "<tt>puts</tt>" are external (i.e., lacking "<tt>internal</tt>"
515declarations), they are accessible outside of the current module. It is illegal
516for a function declaration to be "<tt>internal</tt>".<p>
Chris Lattner00950542001-06-06 20:29:01 +0000517
518
519<!-- ======================================================================= -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000520</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
521<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
522<a name="globalvars">Global Variables
523</b></font></td></tr></table><ul>
524
525Global variables define regions of memory allocated at compilation time instead
Chris Lattner7bae3952002-06-25 18:03:17 +0000526of run-time. Global variables may optionally be initialized. A variable may
527be defined as a global "constant", which indicates that the contents of the
Chris Lattner2b7d3202002-05-06 03:03:22 +0000528variable will never be modified (opening options for optimization). Constants
529must always have an initial value.<p>
530
Chris Lattner7bae3952002-06-25 18:03:17 +0000531As SSA values, global variables define pointer values that are in scope
532(i.e. they dominate) for all basic blocks in the program. Global variables
533always define a pointer to their "content" type because they describe a region
534of memory, and all memory objects in LLVM are accessed through pointers.<p>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000535
536
537
538<!-- ======================================================================= -->
539</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
540<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
Chris Lattner7faa8832002-04-14 06:13:44 +0000541<a name="functionstructure">Function Structure
Chris Lattner00950542001-06-06 20:29:01 +0000542</b></font></td></tr></table><ul>
543
Chris Lattner2b7d3202002-05-06 03:03:22 +0000544LLVM functions definitions are composed of a (possibly empty) argument list, an
545opening curly brace, a list of basic blocks, and a closing curly brace. LLVM
546function declarations are defined with the "<tt>declare</tt>" keyword, a
547function name and a function signature.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000548
Chris Lattner2b7d3202002-05-06 03:03:22 +0000549A function definition contains a list of basic blocks, forming the CFG for the
550function. Each basic block may optionally start with a label (giving the basic
551block a symbol table entry), contains a list of instructions, and ends with a <a
552href="#terminators">terminator</a> instruction (such as a branch or function
553return).<p>
554
555The first basic block in program is special in two ways: it is immediately
556executed on entrance to the function, and it is not allowed to have predecessor
557basic blocks (i.e. there can not be any branches to the entry block of a
558function).<p>
Chris Lattner00950542001-06-06 20:29:01 +0000559
560
561<!-- *********************************************************************** -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000562</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
563<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000564<a name="instref">Instruction Reference
565</b></font></td></tr></table><ul>
566<!-- *********************************************************************** -->
567
Chris Lattner2b7d3202002-05-06 03:03:22 +0000568The LLVM instruction set consists of several different classifications of
Chris Lattnere489aa52002-08-14 17:55:59 +0000569instructions: <a href="#terminators">terminator instructions</a>, <a
570href="#binaryops">binary instructions</a>, <a href="#memoryops">memory
571instructions</a>, and <a href="#otherops">other instructions</a>.<p>
Chris Lattner2b7d3202002-05-06 03:03:22 +0000572
Chris Lattner00950542001-06-06 20:29:01 +0000573
574<!-- ======================================================================= -->
Chris Lattner2b7d3202002-05-06 03:03:22 +0000575</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
576<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +0000577<a name="terminators">Terminator Instructions
578</b></font></td></tr></table><ul>
579
Chris Lattner2b7d3202002-05-06 03:03:22 +0000580As mentioned <a href="#functionstructure">previously</a>, every basic block in a
Chris Lattner7bae3952002-06-25 18:03:17 +0000581program ends with a "Terminator" instruction, which indicates which block should
582be executed after the current block is finished. These terminator instructions
583typically yield a '<tt>void</tt>' value: they produce control flow, not values
584(the one exception being the '<a href="#i_invoke"><tt>invoke</tt></a>'
585instruction).<p>
Chris Lattner00950542001-06-06 20:29:01 +0000586
Chris Lattner7faa8832002-04-14 06:13:44 +0000587There are four different terminator instructions: the '<a
588href="#i_ret"><tt>ret</tt></a>' instruction, the '<a
589href="#i_br"><tt>br</tt></a>' instruction, the '<a
590href="#i_switch"><tt>switch</tt></a>' instruction, and the '<a
591href="#i_invoke"><tt>invoke</tt></a>' instruction.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000592
593
594<!-- _______________________________________________________________________ -->
595</ul><a name="i_ret"><h4><hr size=0>'<tt>ret</tt>' Instruction</h4><ul>
596
597<h5>Syntax:</h5>
598<pre>
Chris Lattner7faa8832002-04-14 06:13:44 +0000599 ret &lt;type&gt; &lt;value&gt; <i>; Return a value from a non-void function</i>
600 ret void <i>; Return from void function</i>
Chris Lattner00950542001-06-06 20:29:01 +0000601</pre>
602
603<h5>Overview:</h5>
Chris Lattner00950542001-06-06 20:29:01 +0000604
Chris Lattner2b7d3202002-05-06 03:03:22 +0000605The '<tt>ret</tt>' instruction is used to return control flow (and a value) from
606a function, back to the caller.<p>
Chris Lattner7faa8832002-04-14 06:13:44 +0000607
608There are two forms of the '<tt>ret</tt>' instructruction: one that returns a
609value and then causes control flow, and one that just causes control flow to
610occur.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000611
612<h5>Arguments:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +0000613
614The '<tt>ret</tt>' instruction may return any '<a href="#t_firstclass">first
615class</a>' type. Notice that a function is not <a href="#wellformed">well
616formed</a> if there exists a '<tt>ret</tt>' instruction inside of the function
617that returns a value that does not match the return type of the function.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000618
619<h5>Semantics:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +0000620
621When the '<tt>ret</tt>' instruction is executed, control flow returns back to
622the calling function's context. If the instruction returns a value, that value
623shall be propogated into the calling function's data space.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000624
625<h5>Example:</h5>
626<pre>
627 ret int 5 <i>; Return an integer value of 5</i>
Chris Lattner7faa8832002-04-14 06:13:44 +0000628 ret void <i>; Return from a void function</i>
Chris Lattner00950542001-06-06 20:29:01 +0000629</pre>
630
631
632<!-- _______________________________________________________________________ -->
633</ul><a name="i_br"><h4><hr size=0>'<tt>br</tt>' Instruction</h4><ul>
634
635<h5>Syntax:</h5>
636<pre>
637 br bool &lt;cond&gt;, label &lt;iftrue&gt;, label &lt;iffalse&gt;
638 br label &lt;dest&gt; <i>; Unconditional branch</i>
639</pre>
640
641<h5>Overview:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +0000642
643The '<tt>br</tt>' instruction is used to cause control flow to transfer to a
644different basic block in the current function. There are two forms of this
645instruction, corresponding to a conditional branch and an unconditional
646branch.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000647
648<h5>Arguments:</h5>
649
Chris Lattner7faa8832002-04-14 06:13:44 +0000650The conditional branch form of the '<tt>br</tt>' instruction takes a single
651'<tt>bool</tt>' value and two '<tt>label</tt>' values. The unconditional form
652of the '<tt>br</tt>' instruction takes a single '<tt>label</tt>' value as a
653target.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000654
655<h5>Semantics:</h5>
656
Chris Lattner7faa8832002-04-14 06:13:44 +0000657Upon execution of a conditional '<tt>br</tt>' instruction, the '<tt>bool</tt>'
658argument is evaluated. If the value is <tt>true</tt>, control flows to the
659'<tt>iftrue</tt>' '<tt>label</tt>' argument. If "cond" is <tt>false</tt>,
660control flows to the '<tt>iffalse</tt>' '<tt>label</tt>' argument.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000661
662<h5>Example:</h5>
663<pre>
664Test:
665 %cond = <a href="#i_setcc">seteq</a> int %a, %b
666 br bool %cond, label %IfEqual, label %IfUnequal
667IfEqual:
Chris Lattner2b7d3202002-05-06 03:03:22 +0000668 <a href="#i_ret">ret</a> int 1
Chris Lattner00950542001-06-06 20:29:01 +0000669IfUnequal:
Chris Lattner2b7d3202002-05-06 03:03:22 +0000670 <a href="#i_ret">ret</a> int 0
Chris Lattner00950542001-06-06 20:29:01 +0000671</pre>
672
673
674<!-- _______________________________________________________________________ -->
675</ul><a name="i_switch"><h4><hr size=0>'<tt>switch</tt>' Instruction</h4><ul>
676
677<h5>Syntax:</h5>
678<pre>
679 <i>; Definitions for lookup indirect branch</i>
680 %switchtype = type [&lt;anysize&gt; x { uint, label }]
681
682 <i>; Lookup indirect branch</i>
683 switch uint &lt;value&gt;, label &lt;defaultdest&gt;, %switchtype &lt;switchtable&gt;
684
685 <i>; Indexed indirect branch</i>
686 switch uint &lt;idxvalue&gt;, label &lt;defaultdest&gt;, [&lt;anysize&gt; x label] &lt;desttable&gt;
687</pre>
688
689<h5>Overview:</h5>
Chris Lattner00950542001-06-06 20:29:01 +0000690
Chris Lattner7faa8832002-04-14 06:13:44 +0000691The '<tt>switch</tt>' instruction is used to transfer control flow to one of
692several different places. It is a generalization of the '<tt>br</tt>'
693instruction, allowing a branch to occur to one of many possible destinations.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000694
Chris Lattner7faa8832002-04-14 06:13:44 +0000695The '<tt>switch</tt>' statement supports two different styles of indirect
696branching: lookup branching and indexed branching. Lookup branching is
697generally useful if the values to switch on are spread far appart, where index
698branching is useful if the values to switch on are generally dense.<p>
699
700The two different forms of the '<tt>switch</tt>' statement are simple hints to
Chris Lattner2b7d3202002-05-06 03:03:22 +0000701the underlying implementation. For example, the compiler may choose to
702implement a small indirect branch table as a series of predicated comparisons:
703if it is faster for the target architecture.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000704
705<h5>Arguments:</h5>
Chris Lattner00950542001-06-06 20:29:01 +0000706
Chris Lattner7faa8832002-04-14 06:13:44 +0000707The lookup form of the '<tt>switch</tt>' instruction uses three parameters: a
708'<tt>uint</tt>' comparison value '<tt>value</tt>', a default '<tt>label</tt>'
709destination, and an array of pairs of comparison value constants and
710'<tt>label</tt>'s. The sized array must be a constant value.<p>
711
712The indexed form of the '<tt>switch</tt>' instruction uses three parameters: an
713'<tt>uint</tt>' index value, a default '<tt>label</tt>' and a sized array of
714'<tt>label</tt>'s. The '<tt>dests</tt>' array must be a constant array.
Chris Lattner00950542001-06-06 20:29:01 +0000715
716<h5>Semantics:</h5>
717
Chris Lattner7faa8832002-04-14 06:13:44 +0000718The lookup style switch statement specifies a table of values and destinations.
719When the '<tt>switch</tt>' instruction is executed, this table is searched for
720the given value. If the value is found, the corresponding destination is
721branched to. <p>
Chris Lattner00950542001-06-06 20:29:01 +0000722
Chris Lattner7faa8832002-04-14 06:13:44 +0000723The index branch form simply looks up a label element directly in a table and
724branches to it.<p>
725
726In either case, the compiler knows the static size of the array, because it is
727provided as part of the constant values type.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000728
729<h5>Example:</h5>
730<pre>
731 <i>; Emulate a conditional br instruction</i>
732 %Val = <a href="#i_cast">cast</a> bool %value to uint
733 switch uint %Val, label %truedest, [1 x label] [label %falsedest ]
734
735 <i>; Emulate an unconditional br instruction</i>
736 switch uint 0, label %dest, [ 0 x label] [ ]
737
Chris Lattner2b7d3202002-05-06 03:03:22 +0000738 <i>; Implement a jump table:</i>
Chris Lattner00950542001-06-06 20:29:01 +0000739 switch uint %val, label %otherwise, [3 x label] [ label %onzero,
740 label %onone,
741 label %ontwo ]
742
743</pre>
744
745
746
747<!-- _______________________________________________________________________ -->
Chris Lattner7faa8832002-04-14 06:13:44 +0000748</ul><a name="i_invoke"><h4><hr size=0>'<tt>invoke</tt>' Instruction</h4><ul>
Chris Lattner00950542001-06-06 20:29:01 +0000749
750<h5>Syntax:</h5>
751<pre>
Chris Lattner7faa8832002-04-14 06:13:44 +0000752 &lt;result&gt; = invoke &lt;ptr to function ty&gt; %&lt;function ptr val&gt;(&lt;function args&gt;)
753 to label &lt;normal label&gt; except label &lt;exception label&gt;
Chris Lattner00950542001-06-06 20:29:01 +0000754</pre>
755
Chris Lattner6536cfe2002-05-06 22:08:29 +0000756<h5>Overview:</h5>
757
758The '<tt>invoke</tt>' instruction is used to cause control flow to transfer to a
759specified function, with the possibility of control flow transfer to either the
760'<tt>normal label</tt>' label or the '<tt>exception label</tt>'. The '<tt><a
761href="#i_call">call</a></tt>' instruction is closely related, but guarantees
762that control flow either never returns from the called function, or that it
Chris Lattner7bae3952002-06-25 18:03:17 +0000763returns to the instruction following the '<tt><a href="#i_call">call</a></tt>'
Chris Lattner6536cfe2002-05-06 22:08:29 +0000764instruction.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000765
766<h5>Arguments:</h5>
767
768This instruction requires several arguments:<p>
769<ol>
Chris Lattner7faa8832002-04-14 06:13:44 +0000770
771<li>'<tt>ptr to function ty</tt>': shall be the signature of the pointer to
Chris Lattner2b7d3202002-05-06 03:03:22 +0000772function value being invoked. In most cases, this is a direct function
Chris Lattner7faa8832002-04-14 06:13:44 +0000773invocation, but indirect <tt>invoke</tt>'s are just as possible, branching off
774an arbitrary pointer to function value.<p>
775
776<li>'<tt>function ptr val</tt>': An LLVM value containing a pointer to a
777function to be invoked.
778
779<li>'<tt>function args</tt>': argument list whose types match the function
Chris Lattner6536cfe2002-05-06 22:08:29 +0000780signature argument types. If the function signature indicates the function
781accepts a variable number of arguments, the extra arguments can be specified.
Chris Lattner7faa8832002-04-14 06:13:44 +0000782
783<li>'<tt>normal label</tt>': the label reached when the called function executes
784a '<tt><a href="#i_ret">ret</a></tt>' instruction.
785
786<li>'<tt>exception label</tt>': the label reached when an exception is thrown.
Chris Lattner00950542001-06-06 20:29:01 +0000787</ol>
788
789<h5>Semantics:</h5>
790
Chris Lattner2b7d3202002-05-06 03:03:22 +0000791This instruction is designed to operate as a standard '<tt><a
792href="#i_call">call</a></tt>' instruction in most regards. The primary
793difference is that it associates a label with the function invocation that may
794be accessed via the runtime library provided by the execution environment. This
795instruction is used in languages with destructors to ensure that proper cleanup
796is performed in the case of either a <tt>longjmp</tt> or a thrown exception.
797Additionally, this is important for implementation of '<tt>catch</tt>' clauses
798in high-level languages that support them.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000799
Chris Lattner7bae3952002-06-25 18:03:17 +0000800<!-- For a more comprehensive explanation of how this instruction is used, look in the llvm/docs/2001-05-18-ExceptionHandling.txt document.<p> -->
Chris Lattner00950542001-06-06 20:29:01 +0000801
802<h5>Example:</h5>
803<pre>
Chris Lattner7faa8832002-04-14 06:13:44 +0000804 %retval = invoke int %Test(int 15)
805 to label %Continue except label %TestCleanup <i>; {int}:retval set</i>
Chris Lattner00950542001-06-06 20:29:01 +0000806</pre>
807
808
809
810<!-- ======================================================================= -->
Chris Lattner00950542001-06-06 20:29:01 +0000811</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0><tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
812<a name="binaryops">Binary Operations
813</b></font></td></tr></table><ul>
814
Chris Lattner7faa8832002-04-14 06:13:44 +0000815Binary operators are used to do most of the computation in a program. They
816require two operands, execute an operation on them, and produce a single value.
817The result value of a binary operator is not neccesarily the same type as its
818operands.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000819
820There are several different binary operators:<p>
821
822
823<!-- _______________________________________________________________________ -->
824</ul><a name="i_add"><h4><hr size=0>'<tt>add</tt>' Instruction</h4><ul>
825
826<h5>Syntax:</h5>
827<pre>
828 &lt;result&gt; = add &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
829</pre>
830
831<h5>Overview:</h5>
832The '<tt>add</tt>' instruction returns the sum of its two operands.<p>
833
834<h5>Arguments:</h5>
835The two arguments to the '<tt>add</tt>' instruction must be either <a href="#t_integral">integral</a> or <a href="#t_floating">floating point</a> values. Both arguments must have identical types.<p>
836
837<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +0000838
839The value produced is the integral or floating point sum of the two operands.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000840
841<h5>Example:</h5>
842<pre>
843 &lt;result&gt; = add int 4, %var <i>; yields {int}:result = 4 + %var</i>
844</pre>
845
846
847<!-- _______________________________________________________________________ -->
848</ul><a name="i_sub"><h4><hr size=0>'<tt>sub</tt>' Instruction</h4><ul>
849
850<h5>Syntax:</h5>
851<pre>
852 &lt;result&gt; = sub &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
853</pre>
854
855<h5>Overview:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +0000856
Chris Lattner00950542001-06-06 20:29:01 +0000857The '<tt>sub</tt>' instruction returns the difference of its two operands.<p>
858
Chris Lattner7faa8832002-04-14 06:13:44 +0000859Note that the '<tt>sub</tt>' instruction is used to represent the '<tt>neg</tt>'
860instruction present in most other intermediate representations.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000861
862<h5>Arguments:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +0000863
864The two arguments to the '<tt>sub</tt>' instruction must be either <a
865href="#t_integral">integral</a> or <a href="#t_floating">floating point</a>
866values. Both arguments must have identical types.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000867
868<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +0000869
870The value produced is the integral or floating point difference of the two
871operands.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000872
873<h5>Example:</h5>
874<pre>
875 &lt;result&gt; = sub int 4, %var <i>; yields {int}:result = 4 - %var</i>
876 &lt;result&gt; = sub int 0, %val <i>; yields {int}:result = -%var</i>
877</pre>
878
879<!-- _______________________________________________________________________ -->
880</ul><a name="i_mul"><h4><hr size=0>'<tt>mul</tt>' Instruction</h4><ul>
881
882<h5>Syntax:</h5>
883<pre>
884 &lt;result&gt; = mul &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
885</pre>
886
887<h5>Overview:</h5>
888The '<tt>mul</tt>' instruction returns the product of its two operands.<p>
889
890<h5>Arguments:</h5>
891The two arguments to the '<tt>mul</tt>' instruction must be either <a href="#t_integral">integral</a> or <a href="#t_floating">floating point</a> values. Both arguments must have identical types.<p>
892
893<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +0000894
895The value produced is the integral or floating point product of the two
896operands.<p>
Chris Lattner7faa8832002-04-14 06:13:44 +0000897
898There is no signed vs unsigned multiplication. The appropriate action is taken
899based on the type of the operand. <p>
Chris Lattner00950542001-06-06 20:29:01 +0000900
901
902<h5>Example:</h5>
903<pre>
904 &lt;result&gt; = mul int 4, %var <i>; yields {int}:result = 4 * %var</i>
905</pre>
906
907
908<!-- _______________________________________________________________________ -->
909</ul><a name="i_div"><h4><hr size=0>'<tt>div</tt>' Instruction</h4><ul>
910
911<h5>Syntax:</h5>
912<pre>
913 &lt;result&gt; = div &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
914</pre>
915
916<h5>Overview:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +0000917
Chris Lattner00950542001-06-06 20:29:01 +0000918The '<tt>div</tt>' instruction returns the quotient of its two operands.<p>
919
920<h5>Arguments:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +0000921
922The two arguments to the '<tt>div</tt>' instruction must be either <a
923href="#t_integral">integral</a> or <a href="#t_floating">floating point</a>
924values. Both arguments must have identical types.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000925
926<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +0000927
928The value produced is the integral or floating point quotient of the two
929operands.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000930
931<h5>Example:</h5>
932<pre>
933 &lt;result&gt; = div int 4, %var <i>; yields {int}:result = 4 / %var</i>
934</pre>
935
936
937<!-- _______________________________________________________________________ -->
938</ul><a name="i_rem"><h4><hr size=0>'<tt>rem</tt>' Instruction</h4><ul>
939
940<h5>Syntax:</h5>
941<pre>
942 &lt;result&gt; = rem &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
943</pre>
944
945<h5>Overview:</h5>
946The '<tt>rem</tt>' instruction returns the remainder from the division of its two operands.<p>
947
948<h5>Arguments:</h5>
949The two arguments to the '<tt>rem</tt>' instruction must be either <a href="#t_integral">integral</a> or <a href="#t_floating">floating point</a> values. Both arguments must have identical types.<p>
950
951<h5>Semantics:</h5>
Chris Lattner6536cfe2002-05-06 22:08:29 +0000952
953This returns the <i>remainder</i> of a division (where the result has the same
954sign as the divisor), not the <i>modulus</i> (where the result has the same sign
955as the dividend) of a value. For more information about the difference, see: <a
956href="http://mathforum.org/dr.math/problems/anne.4.28.99.html">The Math
957Forum</a>.<p>
958
Chris Lattner00950542001-06-06 20:29:01 +0000959<h5>Example:</h5>
960<pre>
961 &lt;result&gt; = rem int 4, %var <i>; yields {int}:result = 4 % %var</i>
962</pre>
963
964
965<!-- _______________________________________________________________________ -->
966</ul><a name="i_setcc"><h4><hr size=0>'<tt>set<i>cc</i></tt>' Instructions</h4><ul>
967
968<h5>Syntax:</h5>
969<pre>
970 &lt;result&gt; = seteq &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {bool}:result</i>
971 &lt;result&gt; = setne &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {bool}:result</i>
972 &lt;result&gt; = setlt &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {bool}:result</i>
973 &lt;result&gt; = setgt &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {bool}:result</i>
974 &lt;result&gt; = setle &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {bool}:result</i>
975 &lt;result&gt; = setge &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {bool}:result</i>
976</pre>
977
Chris Lattner6536cfe2002-05-06 22:08:29 +0000978<h5>Overview:</h5> The '<tt>set<i>cc</i></tt>' family of instructions returns a
979boolean value based on a comparison of their two operands.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000980
Chris Lattner7faa8832002-04-14 06:13:44 +0000981<h5>Arguments:</h5> The two arguments to the '<tt>set<i>cc</i></tt>'
982instructions must be of <a href="#t_firstclass">first class</a> or <a
983href="#t_pointer">pointer</a> type (it is not possible to compare
984'<tt>label</tt>'s, '<tt>array</tt>'s, '<tt>structure</tt>' or '<tt>void</tt>'
Chris Lattner6536cfe2002-05-06 22:08:29 +0000985values, etc...). Both arguments must have identical types.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000986
Chris Lattner6536cfe2002-05-06 22:08:29 +0000987The '<tt>setlt</tt>', '<tt>setgt</tt>', '<tt>setle</tt>', and '<tt>setge</tt>'
988instructions do not operate on '<tt>bool</tt>' typed arguments.<p>
Chris Lattner00950542001-06-06 20:29:01 +0000989
990<h5>Semantics:</h5>
Chris Lattner6536cfe2002-05-06 22:08:29 +0000991
992The '<tt>seteq</tt>' instruction yields a <tt>true</tt> '<tt>bool</tt>' value if
993both operands are equal.<br>
994
995The '<tt>setne</tt>' instruction yields a <tt>true</tt> '<tt>bool</tt>' value if
996both operands are unequal.<br>
997
998The '<tt>setlt</tt>' instruction yields a <tt>true</tt> '<tt>bool</tt>' value if
999the first operand is less than the second operand.<br>
1000
1001The '<tt>setgt</tt>' instruction yields a <tt>true</tt> '<tt>bool</tt>' value if
1002the first operand is greater than the second operand.<br>
1003
1004The '<tt>setle</tt>' instruction yields a <tt>true</tt> '<tt>bool</tt>' value if
1005the first operand is less than or equal to the second operand.<br>
1006
1007The '<tt>setge</tt>' instruction yields a <tt>true</tt> '<tt>bool</tt>' value if
1008the first operand is greater than or equal to the second operand.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001009
1010<h5>Example:</h5>
1011<pre>
1012 &lt;result&gt; = seteq int 4, 5 <i>; yields {bool}:result = false</i>
1013 &lt;result&gt; = setne float 4, 5 <i>; yields {bool}:result = true</i>
1014 &lt;result&gt; = setlt uint 4, 5 <i>; yields {bool}:result = true</i>
1015 &lt;result&gt; = setgt sbyte 4, 5 <i>; yields {bool}:result = false</i>
1016 &lt;result&gt; = setle sbyte 4, 5 <i>; yields {bool}:result = true</i>
1017 &lt;result&gt; = setge sbyte 4, 5 <i>; yields {bool}:result = false</i>
1018</pre>
1019
1020
1021
1022<!-- ======================================================================= -->
Chris Lattner2b7d3202002-05-06 03:03:22 +00001023</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
1024<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +00001025<a name="bitwiseops">Bitwise Binary Operations
1026</b></font></td></tr></table><ul>
1027
Chris Lattner2b7d3202002-05-06 03:03:22 +00001028Bitwise binary operators are used to do various forms of bit-twiddling in a
1029program. They are generally very efficient instructions, and can commonly be
1030strength reduced from other instructions. They require two operands, execute an
1031operation on them, and produce a single value. The resulting value of the
1032bitwise binary operators is always the same type as its first operand.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001033
1034<!-- _______________________________________________________________________ -->
1035</ul><a name="i_and"><h4><hr size=0>'<tt>and</tt>' Instruction</h4><ul>
1036
1037<h5>Syntax:</h5>
1038<pre>
1039 &lt;result&gt; = and &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
1040</pre>
1041
1042<h5>Overview:</h5>
1043The '<tt>and</tt>' instruction returns the bitwise logical and of its two operands.<p>
1044
1045<h5>Arguments:</h5>
Chris Lattner6536cfe2002-05-06 22:08:29 +00001046
1047The two arguments to the '<tt>and</tt>' instruction must be either <a
1048href="#t_integral">integral</a> or <tt>bool</tt> values. Both arguments must
1049have identical types.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001050
1051
1052<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +00001053
1054The truth table used for the '<tt>and</tt>' instruction is:<p>
1055
Chris Lattnerc98cbbc2002-06-25 18:06:50 +00001056<center><table border=1 cellspacing=0 cellpadding=4>
Chris Lattner7bae3952002-06-25 18:03:17 +00001057<tr><td>In0</td> <td>In1</td> <td>Out</td></tr>
1058<tr><td>0</td> <td>0</td> <td>0</td></tr>
1059<tr><td>0</td> <td>1</td> <td>0</td></tr>
1060<tr><td>1</td> <td>0</td> <td>0</td></tr>
1061<tr><td>1</td> <td>1</td> <td>1</td></tr>
1062</table></center><p>
Chris Lattner00950542001-06-06 20:29:01 +00001063
1064
1065<h5>Example:</h5>
1066<pre>
1067 &lt;result&gt; = and int 4, %var <i>; yields {int}:result = 4 & %var</i>
1068 &lt;result&gt; = and int 15, 40 <i>; yields {int}:result = 8</i>
1069 &lt;result&gt; = and int 4, 8 <i>; yields {int}:result = 0</i>
1070</pre>
1071
1072
1073
1074<!-- _______________________________________________________________________ -->
1075</ul><a name="i_or"><h4><hr size=0>'<tt>or</tt>' Instruction</h4><ul>
1076
1077<h5>Syntax:</h5>
1078<pre>
1079 &lt;result&gt; = or &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
1080</pre>
1081
Chris Lattner7faa8832002-04-14 06:13:44 +00001082<h5>Overview:</h5> The '<tt>or</tt>' instruction returns the bitwise logical
1083inclusive or of its two operands.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001084
1085<h5>Arguments:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +00001086
1087The two arguments to the '<tt>or</tt>' instruction must be either <a
Chris Lattner6536cfe2002-05-06 22:08:29 +00001088href="#t_integral">integral</a> or <tt>bool</tt> values. Both arguments must
1089have identical types.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001090
1091
1092<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +00001093
1094The truth table used for the '<tt>or</tt>' instruction is:<p>
1095
Chris Lattnerc98cbbc2002-06-25 18:06:50 +00001096<center><table border=1 cellspacing=0 cellpadding=4>
Chris Lattner7bae3952002-06-25 18:03:17 +00001097<tr><td>In0</td> <td>In1</td> <td>Out</td></tr>
1098<tr><td>0</td> <td>0</td> <td>0</td></tr>
1099<tr><td>0</td> <td>1</td> <td>1</td></tr>
1100<tr><td>1</td> <td>0</td> <td>1</td></tr>
1101<tr><td>1</td> <td>1</td> <td>1</td></tr>
1102</table></center><p>
Chris Lattner00950542001-06-06 20:29:01 +00001103
1104
1105<h5>Example:</h5>
1106<pre>
1107 &lt;result&gt; = or int 4, %var <i>; yields {int}:result = 4 | %var</i>
1108 &lt;result&gt; = or int 15, 40 <i>; yields {int}:result = 47</i>
1109 &lt;result&gt; = or int 4, 8 <i>; yields {int}:result = 12</i>
1110</pre>
1111
1112
1113<!-- _______________________________________________________________________ -->
1114</ul><a name="i_xor"><h4><hr size=0>'<tt>xor</tt>' Instruction</h4><ul>
1115
1116<h5>Syntax:</h5>
1117<pre>
1118 &lt;result&gt; = xor &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
1119</pre>
1120
1121<h5>Overview:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +00001122
1123The '<tt>xor</tt>' instruction returns the bitwise logical exclusive or of its
1124two operands.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001125
1126<h5>Arguments:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +00001127
1128The two arguments to the '<tt>xor</tt>' instruction must be either <a
Chris Lattner6536cfe2002-05-06 22:08:29 +00001129href="#t_integral">integral</a> or <tt>bool</tt> values. Both arguments must
1130have identical types.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001131
1132
1133<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +00001134
1135The truth table used for the '<tt>xor</tt>' instruction is:<p>
1136
Chris Lattnerc98cbbc2002-06-25 18:06:50 +00001137<center><table border=1 cellspacing=0 cellpadding=4>
Chris Lattner7bae3952002-06-25 18:03:17 +00001138<tr><td>In0</td> <td>In1</td> <td>Out</td></tr>
1139<tr><td>0</td> <td>0</td> <td>0</td></tr>
1140<tr><td>0</td> <td>1</td> <td>1</td></tr>
1141<tr><td>1</td> <td>0</td> <td>1</td></tr>
1142<tr><td>1</td> <td>1</td> <td>0</td></tr>
1143</table></center><p>
Chris Lattner00950542001-06-06 20:29:01 +00001144
1145
1146<h5>Example:</h5>
1147<pre>
1148 &lt;result&gt; = xor int 4, %var <i>; yields {int}:result = 4 ^ %var</i>
1149 &lt;result&gt; = xor int 15, 40 <i>; yields {int}:result = 39</i>
1150 &lt;result&gt; = xor int 4, 8 <i>; yields {int}:result = 12</i>
1151</pre>
1152
1153
1154<!-- _______________________________________________________________________ -->
1155</ul><a name="i_shl"><h4><hr size=0>'<tt>shl</tt>' Instruction</h4><ul>
1156
1157<h5>Syntax:</h5>
1158<pre>
1159 &lt;result&gt; = shl &lt;ty&gt; &lt;var1&gt;, ubyte &lt;var2&gt; <i>; yields {ty}:result</i>
1160</pre>
1161
1162<h5>Overview:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +00001163
1164The '<tt>shl</tt>' instruction returns the first operand shifted to the left a
1165specified number of bits.
Chris Lattner00950542001-06-06 20:29:01 +00001166
1167<h5>Arguments:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +00001168
1169The first argument to the '<tt>shl</tt>' instruction must be an <a
1170href="#t_integral">integral</a> type. The second argument must be an
1171'<tt>ubyte</tt>' type.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001172
1173<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +00001174
1175The value produced is <tt>var1</tt> * 2<sup><tt>var2</tt></sup>.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001176
1177
1178<h5>Example:</h5>
1179<pre>
1180 &lt;result&gt; = shl int 4, ubyte %var <i>; yields {int}:result = 4 << %var</i>
1181 &lt;result&gt; = shl int 4, ubyte 2 <i>; yields {int}:result = 16</i>
1182 &lt;result&gt; = shl int 1, ubyte 10 <i>; yields {int}:result = 1024</i>
1183</pre>
1184
1185
1186<!-- _______________________________________________________________________ -->
1187</ul><a name="i_shr"><h4><hr size=0>'<tt>shr</tt>' Instruction</h4><ul>
1188
1189
1190<h5>Syntax:</h5>
1191<pre>
1192 &lt;result&gt; = shr &lt;ty&gt; &lt;var1&gt;, ubyte &lt;var2&gt; <i>; yields {ty}:result</i>
1193</pre>
1194
1195<h5>Overview:</h5>
1196The '<tt>shr</tt>' instruction returns the first operand shifted to the right a specified number of bits.
1197
1198<h5>Arguments:</h5>
1199The first argument to the '<tt>shr</tt>' instruction must be an <a href="#t_integral">integral</a> type. The second argument must be an '<tt>ubyte</tt>' type.<p>
1200
1201<h5>Semantics:</h5>
Chris Lattner7bae3952002-06-25 18:03:17 +00001202
1203If the first argument is a <a href="#t_signed">signed</a> type, the most
1204significant bit is duplicated in the newly free'd bit positions. If the first
1205argument is unsigned, zero bits shall fill the empty positions.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001206
1207<h5>Example:</h5>
1208<pre>
1209 &lt;result&gt; = shr int 4, ubyte %var <i>; yields {int}:result = 4 >> %var</i>
1210 &lt;result&gt; = shr int 4, ubyte 1 <i>; yields {int}:result = 2</i>
1211 &lt;result&gt; = shr int 4, ubyte 2 <i>; yields {int}:result = 1</i>
1212 &lt;result&gt; = shr int 4, ubyte 3 <i>; yields {int}:result = 0</i>
1213</pre>
1214
1215
1216
1217
1218
1219<!-- ======================================================================= -->
Chris Lattner2b7d3202002-05-06 03:03:22 +00001220</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
1221<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +00001222<a name="memoryops">Memory Access Operations
1223</b></font></td></tr></table><ul>
1224
Chris Lattner6536cfe2002-05-06 22:08:29 +00001225Accessing memory in SSA form is, well, sticky at best. This section describes how to read, write, allocate and free memory in LLVM.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001226
1227
1228<!-- _______________________________________________________________________ -->
1229</ul><a name="i_malloc"><h4><hr size=0>'<tt>malloc</tt>' Instruction</h4><ul>
1230
1231<h5>Syntax:</h5>
1232<pre>
Chris Lattner7faa8832002-04-14 06:13:44 +00001233 &lt;result&gt; = malloc &lt;type&gt;, uint &lt;NumElements&gt; <i>; yields {type*}:result</i>
1234 &lt;result&gt; = malloc &lt;type&gt; <i>; yields {type*}:result</i>
Chris Lattner00950542001-06-06 20:29:01 +00001235</pre>
1236
1237<h5>Overview:</h5>
1238The '<tt>malloc</tt>' instruction allocates memory from the system heap and returns a pointer to it.<p>
1239
1240<h5>Arguments:</h5>
1241
Chris Lattner7faa8832002-04-14 06:13:44 +00001242The the '<tt>malloc</tt>' instruction allocates
1243<tt>sizeof(&lt;type&gt;)*NumElements</tt> bytes of memory from the operating
1244system, and returns a pointer of the appropriate type to the program. The
1245second form of the instruction is a shorter version of the first instruction
1246that defaults to allocating one element.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001247
Chris Lattner7faa8832002-04-14 06:13:44 +00001248'<tt>type</tt>' must be a sized type<p>
Chris Lattner00950542001-06-06 20:29:01 +00001249
1250<h5>Semantics:</h5>
1251Memory is allocated, a pointer is returned.<p>
1252
1253<h5>Example:</h5>
1254<pre>
1255 %array = malloc [4 x ubyte ] <i>; yields {[%4 x ubyte]*}:array</i>
1256
1257 %size = <a href="#i_add">add</a> uint 2, 2 <i>; yields {uint}:size = uint 4</i>
Chris Lattner7faa8832002-04-14 06:13:44 +00001258 %array1 = malloc ubyte, uint 4 <i>; yields {ubyte*}:array1</i>
1259 %array2 = malloc [12 x ubyte], uint %size <i>; yields {[12 x ubyte]*}:array2</i>
Chris Lattner00950542001-06-06 20:29:01 +00001260</pre>
1261
1262
1263<!-- _______________________________________________________________________ -->
1264</ul><a name="i_free"><h4><hr size=0>'<tt>free</tt>' Instruction</h4><ul>
1265
1266<h5>Syntax:</h5>
1267<pre>
1268 free &lt;type&gt; &lt;value&gt; <i>; yields {void}</i>
1269</pre>
1270
1271
1272<h5>Overview:</h5>
1273The '<tt>free</tt>' instruction returns memory back to the unused memory heap, to be reallocated in the future.<p>
1274
1275
1276<h5>Arguments:</h5>
1277
Chris Lattner6536cfe2002-05-06 22:08:29 +00001278'<tt>value</tt>' shall be a pointer value that points to a value that was
1279allocated with the '<tt><a href="#i_malloc">malloc</a></tt>' instruction.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001280
1281
1282<h5>Semantics:</h5>
Chris Lattner00950542001-06-06 20:29:01 +00001283
Chris Lattner6536cfe2002-05-06 22:08:29 +00001284Access to the memory pointed to by the pointer is not longer defined after this instruction executes.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001285
1286<h5>Example:</h5>
1287<pre>
1288 %array = <a href="#i_malloc">malloc</a> [4 x ubyte] <i>; yields {[4 x ubyte]*}:array</i>
1289 free [4 x ubyte]* %array
1290</pre>
1291
1292
1293<!-- _______________________________________________________________________ -->
1294</ul><a name="i_alloca"><h4><hr size=0>'<tt>alloca</tt>' Instruction</h4><ul>
1295
1296<h5>Syntax:</h5>
1297<pre>
Chris Lattner7faa8832002-04-14 06:13:44 +00001298 &lt;result&gt; = alloca &lt;type&gt;, uint &lt;NumElements&gt; <i>; yields {type*}:result</i>
1299 &lt;result&gt; = alloca &lt;type&gt; <i>; yields {type*}:result</i>
Chris Lattner00950542001-06-06 20:29:01 +00001300</pre>
1301
1302<h5>Overview:</h5>
1303
Chris Lattner7faa8832002-04-14 06:13:44 +00001304The '<tt>alloca</tt>' instruction allocates memory on the current stack frame of
1305the procedure that is live until the current function returns to its caller.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001306
1307<h5>Arguments:</h5>
Chris Lattner00950542001-06-06 20:29:01 +00001308
Chris Lattner7faa8832002-04-14 06:13:44 +00001309The the '<tt>alloca</tt>' instruction allocates
1310<tt>sizeof(&lt;type&gt;)*NumElements</tt> bytes of memory on the runtime stack,
1311returning a pointer of the appropriate type to the program. The second form of
1312the instruction is a shorter version of the first that defaults to allocating
1313one element.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001314
Chris Lattner7faa8832002-04-14 06:13:44 +00001315'<tt>type</tt>' may be any sized type.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001316
1317<h5>Semantics:</h5>
Chris Lattner7faa8832002-04-14 06:13:44 +00001318
1319Memory is allocated, a pointer is returned. '<tt>alloca</tt>'d memory is
1320automatically released when the function returns. The '<tt>alloca</tt>'
1321instruction is commonly used to represent automatic variables that must have an
1322address available, as well as spilled variables.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001323
1324<h5>Example:</h5>
1325<pre>
1326 %ptr = alloca int <i>; yields {int*}:ptr</i>
Chris Lattner7faa8832002-04-14 06:13:44 +00001327 %ptr = alloca int, uint 4 <i>; yields {int*}:ptr</i>
Chris Lattner00950542001-06-06 20:29:01 +00001328</pre>
1329
1330
1331<!-- _______________________________________________________________________ -->
Chris Lattner2b7d3202002-05-06 03:03:22 +00001332</ul><a name="i_load"><h4><hr size=0>'<tt>load</tt>' Instruction</h4><ul>
1333
1334<h5>Syntax:</h5>
1335<pre>
1336 &lt;result&gt; = load &lt;ty&gt;* &lt;pointer&gt;
1337</pre>
1338
1339<h5>Overview:</h5>
1340The '<tt>load</tt>' instruction is used to read from memory.<p>
1341
1342<h5>Arguments:</h5>
1343
1344The argument to the '<tt>load</tt>' instruction specifies the memory address to load from. The pointer must point to a <a href="t_firstclass">first class</a> type.<p>
1345
1346<h5>Semantics:</h5>
1347
1348The location of memory pointed to is loaded.
1349
1350<h5>Examples:</h5>
1351<pre>
1352 %ptr = <a href="#i_alloca">alloca</a> int <i>; yields {int*}:ptr</i>
1353 <a href="#i_store">store</a> int 3, int* %ptr <i>; yields {void}</i>
1354 %val = load int* %ptr <i>; yields {int}:val = int 3</i>
1355</pre>
1356
1357
1358
1359
1360<!-- _______________________________________________________________________ -->
1361</ul><a name="i_store"><h4><hr size=0>'<tt>store</tt>' Instruction</h4><ul>
1362
1363<h5>Syntax:</h5>
1364<pre>
1365 store &lt;ty&gt; &lt;value&gt;, &lt;ty&gt;* &lt;pointer&gt; <i>; yields {void}</i>
1366</pre>
1367
1368<h5>Overview:</h5>
1369The '<tt>store</tt>' instruction is used to write to memory.<p>
1370
1371<h5>Arguments:</h5>
1372
1373There are two arguments to the '<tt>store</tt>' instruction: a value to store
1374and an address to store it into. The type of the '<tt>&lt;pointer&gt;</tt>'
1375operand must be a pointer to the type of the '<tt>&lt;value&gt;</tt>'
1376operand.<p>
1377
1378<h5>Semantics:</h5> The contents of memory are updated to contain
1379'<tt>&lt;value&gt;</tt>' at the location specified by the
1380'<tt>&lt;pointer&gt;</tt>' operand.<p>
1381
1382<h5>Example:</h5>
1383<pre>
1384 %ptr = <a href="#i_alloca">alloca</a> int <i>; yields {int*}:ptr</i>
1385 <a href="#i_store">store</a> int 3, int* %ptr <i>; yields {void}</i>
1386 %val = load int* %ptr <i>; yields {int}:val = int 3</i>
1387</pre>
1388
1389
1390
1391
1392<!-- _______________________________________________________________________ -->
Chris Lattner7faa8832002-04-14 06:13:44 +00001393</ul><a name="i_getelementptr"><h4><hr size=0>'<tt>getelementptr</tt>' Instruction</h4><ul>
1394
1395<h5>Syntax:</h5>
1396<pre>
1397 &lt;result&gt; = getelementptr &lt;ty&gt;* &lt;ptrval&gt;{, uint &lt;aidx&gt;|, ubyte &lt;sidx&gt;}*
1398</pre>
1399
1400<h5>Overview:</h5>
1401
1402The '<tt>getelementptr</tt>' instruction is used to get the address of a
Chris Lattner6536cfe2002-05-06 22:08:29 +00001403subelement of an aggregate data structure.<p>
Chris Lattner7faa8832002-04-14 06:13:44 +00001404
1405<h5>Arguments:</h5>
1406
1407This instruction takes a list of <tt>uint</tt> values and <tt>ubyte</tt>
1408constants that indicate what form of addressing to perform. The actual types of
1409the arguments provided depend on the type of the first pointer argument. The
1410'<tt>getelementptr</tt>' instruction is used to index down through the type
1411levels of a structure.<p>
1412
Chris Lattner6536cfe2002-05-06 22:08:29 +00001413For example, lets consider a C code fragment and how it gets compiled to
1414LLVM:<p>
1415
1416<pre>
1417struct RT {
1418 char A;
1419 int B[10][20];
1420 char C;
1421};
1422struct ST {
1423 int X;
1424 double Y;
1425 struct RT Z;
1426};
1427
1428int *foo(struct ST *s) {
1429 return &amp;s[1].Z.B[5][13];
1430}
1431</pre>
1432
1433The LLVM code generated by the GCC frontend is:
1434
1435<pre>
1436%RT = type { sbyte, [10 x [20 x int]], sbyte }
1437%ST = type { int, double, %RT }
1438
1439int* "foo"(%ST* %s) {
1440 %reg = getelementptr %ST* %s, uint 1, ubyte 2, ubyte 1, uint 5, uint 13
1441 ret int* %reg
1442}
1443</pre>
Chris Lattner7faa8832002-04-14 06:13:44 +00001444
1445<h5>Semantics:</h5>
1446
Chris Lattner6536cfe2002-05-06 22:08:29 +00001447The index types specified for the '<tt>getelementptr</tt>' instruction depend on
1448the pointer type that is being index into. <a href="t_pointer">Pointer</a> and
1449<a href="t_array">array</a> types require '<tt>uint</tt>' values, and <a
1450href="t_struct">structure</a> types require '<tt>ubyte</tt>'
1451<b>constants</b>.<p>
1452
1453In the example above, the first index is indexing into the '<tt>%ST*</tt>' type,
1454which is a pointer, yielding a '<tt>%ST</tt>' = '<tt>{ int, double, %RT }</tt>'
1455type, a structure. The second index indexes into the third element of the
1456structure, yielding a '<tt>%RT</tt>' = '<tt>{ sbyte, [10 x [20 x int]], sbyte
1457}</tt>' type, another structure. The third index indexes into the second
1458element of the structure, yielding a '<tt>[10 x [20 x int]]</tt>' type, an
1459array. The two dimensions of the array are subscripted into, yielding an
1460'<tt>int</tt>' type. The '<tt>getelementptr</tt>' instruction return a pointer
1461to this element, thus yielding a '<tt>int*</tt>' type.<p>
1462
1463Note that it is perfectly legal to index partially through a structure,
1464returning a pointer to an inner element. Because of this, the LLVM code for the
1465given testcase is equivalent to:<p>
1466
1467<pre>
1468int* "foo"(%ST* %s) {
1469 %t1 = getelementptr %ST* %s , uint 1 <i>; yields %ST*:%t1</i>
1470 %t2 = getelementptr %ST* %t1, uint 0, ubyte 2 <i>; yields %RT*:%t2</i>
1471 %t3 = getelementptr %RT* %t2, uint 0, ubyte 1 <i>; yields [10 x [20 x int]]*:%t3</i>
1472 %t4 = getelementptr [10 x [20 x int]]* %t3, uint 0, uint 5 <i>; yields [20 x int]*:%t4</i>
1473 %t5 = getelementptr [20 x int]* %t4, uint 0, uint 13 <i>; yields int*:%t5</i>
1474 ret int* %t5
1475}
1476</pre>
1477
1478
Chris Lattner7faa8832002-04-14 06:13:44 +00001479
1480<h5>Example:</h5>
1481<pre>
Chris Lattnerf31860b2002-08-19 21:14:38 +00001482 <i>; yields [12 x ubyte]*:aptr</i>
Chris Lattner6536cfe2002-05-06 22:08:29 +00001483 %aptr = getelementptr {int, [12 x ubyte]}* %sptr, uint 0, ubyte 1
Chris Lattner7faa8832002-04-14 06:13:44 +00001484</pre>
1485
1486
1487
Chris Lattner00950542001-06-06 20:29:01 +00001488<!-- ======================================================================= -->
Chris Lattner2b7d3202002-05-06 03:03:22 +00001489</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
1490<tr><td>&nbsp;</td><td width="100%">&nbsp; <font color="#EEEEFF" face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +00001491<a name="otherops">Other Operations
1492</b></font></td></tr></table><ul>
1493
1494The instructions in this catagory are the "miscellaneous" functions, that defy better classification.<p>
1495
1496
1497<!-- _______________________________________________________________________ -->
Chris Lattner6536cfe2002-05-06 22:08:29 +00001498</ul><a name="i_phi"><h4><hr size=0>'<tt>phi</tt>' Instruction</h4><ul>
Chris Lattner33ba0d92001-07-09 00:26:23 +00001499
1500<h5>Syntax:</h5>
1501<pre>
Chris Lattner6536cfe2002-05-06 22:08:29 +00001502 &lt;result&gt; = phi &lt;ty&gt; [ &lt;val0&gt;, &lt;label0&gt;], ...
Chris Lattner33ba0d92001-07-09 00:26:23 +00001503</pre>
1504
1505<h5>Overview:</h5>
1506
Chris Lattner6536cfe2002-05-06 22:08:29 +00001507The '<tt>phi</tt>' instruction is used to implement the &phi; node in the SSA
1508graph representing the function.<p>
Chris Lattner33ba0d92001-07-09 00:26:23 +00001509
1510<h5>Arguments:</h5>
1511
Chris Lattner6536cfe2002-05-06 22:08:29 +00001512The type of the incoming values are specified with the first type field. After
1513this, the '<tt>phi</tt>' instruction takes a list of pairs as arguments, with
1514one pair for each predecessor basic block of the current block.<p>
1515
1516There must be no non-phi instructions between the start of a basic block and the
1517PHI instructions: i.e. PHI instructions must be first in a basic block.<p>
Chris Lattner33ba0d92001-07-09 00:26:23 +00001518
1519<h5>Semantics:</h5>
1520
Chris Lattner6536cfe2002-05-06 22:08:29 +00001521At runtime, the '<tt>phi</tt>' instruction logically takes on the value
1522specified by the parameter, depending on which basic block we came from in the
1523last <a href="#terminators">terminator</a> instruction.<p>
1524
1525<h5>Example:</h5>
1526
1527<pre>
1528Loop: ; Infinite loop that counts from 0 on up...
1529 %indvar = phi uint [ 0, %LoopHeader ], [ %nextindvar, %Loop ]
1530 %nextindvar = add uint %indvar, 1
1531 br label %Loop
1532</pre>
1533
1534
1535<!-- _______________________________________________________________________ -->
1536</ul><a name="i_cast"><h4><hr size=0>'<tt>cast .. to</tt>' Instruction</h4><ul>
1537
1538<h5>Syntax:</h5>
1539<pre>
1540 &lt;result&gt; = cast &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
1541</pre>
1542
1543<h5>Overview:</h5>
1544
1545The '<tt>cast</tt>' instruction is used as the primitive means to convert
1546integers to floating point, change data type sizes, and break type safety (by
1547casting pointers).<p>
1548
1549<h5>Arguments:</h5>
1550
Chris Lattner7bae3952002-06-25 18:03:17 +00001551The '<tt>cast</tt>' instruction takes a value to cast, which must be a first
Chris Lattner6536cfe2002-05-06 22:08:29 +00001552class value, and a type to cast it to, which must also be a first class type.<p>
1553
1554<h5>Semantics:</h5>
1555
1556This instruction follows the C rules for explicit casts when determining how the
1557data being cast must change to fit in its new container.<p>
1558
Chris Lattner7bae3952002-06-25 18:03:17 +00001559When casting to bool, any value that would be considered true in the context of
1560a C '<tt>if</tt>' condition is converted to the boolean '<tt>true</tt>' values,
1561all else are '<tt>false</tt>'.<p>
Chris Lattner33ba0d92001-07-09 00:26:23 +00001562
Chris Lattnerf8856bc2002-08-13 20:52:09 +00001563When extending an integral value from a type of one signness to another (for
1564example '<tt>sbyte</tt>' to '<tt>ulong</tt>'), the value is sign-extended if the
1565<b>source</b> value is signed, and zero-extended if the source value is
Chris Lattner2b4dcbb2002-08-15 19:36:05 +00001566unsigned. <tt>bool</tt> values are always zero extended into either zero or
1567one.<p>
Chris Lattnerf8856bc2002-08-13 20:52:09 +00001568
Chris Lattner33ba0d92001-07-09 00:26:23 +00001569<h5>Example:</h5>
1570<pre>
Chris Lattner6536cfe2002-05-06 22:08:29 +00001571 %X = cast int 257 to ubyte <i>; yields ubyte:1</i>
Chris Lattner7bae3952002-06-25 18:03:17 +00001572 %Y = cast int 123 to bool <i>; yields bool:true</i>
Chris Lattner33ba0d92001-07-09 00:26:23 +00001573</pre>
1574
1575
1576
1577<!-- _______________________________________________________________________ -->
Chris Lattner00950542001-06-06 20:29:01 +00001578</ul><a name="i_call"><h4><hr size=0>'<tt>call</tt>' Instruction</h4><ul>
1579
1580<h5>Syntax:</h5>
1581<pre>
Chris Lattner6536cfe2002-05-06 22:08:29 +00001582 &lt;result&gt; = call &lt;ty&gt;* &lt;fnptrval&gt;(&lt;param list&gt;)
Chris Lattner00950542001-06-06 20:29:01 +00001583</pre>
1584
1585<h5>Overview:</h5>
1586
Chris Lattner6536cfe2002-05-06 22:08:29 +00001587The '<tt>call</tt>' instruction represents a simple function call.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001588
1589<h5>Arguments:</h5>
1590
Chris Lattner6536cfe2002-05-06 22:08:29 +00001591This instruction requires several arguments:<p>
1592<ol>
1593
1594<li>'<tt>ty</tt>': shall be the signature of the pointer to function value being
1595invoked. The argument types must match the types implied by this signature.<p>
1596
1597<li>'<tt>fnptrval</tt>': An LLVM value containing a pointer to a function to be
1598invoked. In most cases, this is a direct function invocation, but indirect
1599<tt>call</tt>'s are just as possible, calling an arbitrary pointer to function
1600values.<p>
1601
1602<li>'<tt>function args</tt>': argument list whose types match the function
1603signature argument types. If the function signature indicates the function
1604accepts a variable number of arguments, the extra arguments can be specified.
1605</ol>
Chris Lattner00950542001-06-06 20:29:01 +00001606
1607<h5>Semantics:</h5>
1608
Chris Lattner6536cfe2002-05-06 22:08:29 +00001609The '<tt>call</tt>' instruction is used to cause control flow to transfer to a
1610specified function, with its incoming arguments bound to the specified values.
1611Upon a '<tt><a href="#i_ret">ret</a></tt>' instruction in the called function,
1612control flow continues with the instruction after the function call, and the
1613return value of the function is bound to the result argument. This is a simpler
1614case of the <a href="#i_invoke">invoke</a> instruction.<p>
Chris Lattner00950542001-06-06 20:29:01 +00001615
1616<h5>Example:</h5>
1617<pre>
1618 %retval = call int %test(int %argc)
Chris Lattner6536cfe2002-05-06 22:08:29 +00001619 call int(sbyte*, ...) *%printf(sbyte* %msg, int 12, sbyte 42);
1620
Chris Lattner00950542001-06-06 20:29:01 +00001621</pre>
1622
Chris Lattner6536cfe2002-05-06 22:08:29 +00001623<!--
Chris Lattner00950542001-06-06 20:29:01 +00001624
Chris Lattner6536cfe2002-05-06 22:08:29 +00001625<!x- *********************************************************************** -x>
Chris Lattner2b7d3202002-05-06 03:03:22 +00001626</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
1627<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattner00950542001-06-06 20:29:01 +00001628<a name="related">Related Work
1629</b></font></td></tr></table><ul>
Chris Lattner6536cfe2002-05-06 22:08:29 +00001630<!x- *********************************************************************** -x>
Chris Lattner00950542001-06-06 20:29:01 +00001631
1632
1633Codesigned virtual machines.<p>
1634
1635<dl>
1636<a name="rw_safetsa">
1637<dt>SafeTSA
1638<DD>Description here<p>
1639
1640<a name="rw_java">
1641<dt><a href="http://www.javasoft.com">Java</a>
1642<DD>Desciption here<p>
1643
1644<a name="rw_net">
1645<dt><a href="http://www.microsoft.com/net">Microsoft .net</a>
1646<DD>Desciption here<p>
1647
1648<a name="rw_gccrtl">
1649<dt><a href="http://www.math.umn.edu/systems_guide/gcc-2.95.1/gcc_15.html">GNU RTL Intermediate Representation</a>
1650<DD>Desciption here<p>
1651
1652<a name="rw_ia64">
1653<dt><a href="http://developer.intel.com/design/ia-64/index.htm">IA64 Architecture &amp; Instruction Set</a>
1654<DD>Desciption here<p>
1655
1656<a name="rw_mmix">
1657<dt><a href="http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html">MMIX Instruction Set</a>
1658<DD>Desciption here<p>
1659
1660<a name="rw_stroustrup">
1661<dt><a href="http://www.research.att.com/~bs/devXinterview.html">"Interview With Bjarne Stroustrup"</a>
1662<DD>This interview influenced the design and thought process behind LLVM in several ways, most notably the way that derived types are written in text format. See the question that starts with "you defined the C declarator syntax as an experiment that failed".<p>
1663</dl>
1664
Chris Lattner6536cfe2002-05-06 22:08:29 +00001665<!x- _______________________________________________________________________ -x>
Chris Lattner00950542001-06-06 20:29:01 +00001666</ul><a name="rw_vectorization"><h3><hr size=0>Vectorized Architectures</h3><ul>
1667
1668<dl>
1669<a name="rw_intel_simd">
1670<dt>Intel MMX, MMX2, SSE, SSE2
1671<DD>Description here<p>
1672
1673<a name="rw_amd_simd">
1674<dt><a href="http://www.nondot.org/~sabre/os/H1ChipFeatures/3DNow!TechnologyManual.pdf">AMD 3Dnow!, 3Dnow! 2</a>
1675<DD>Desciption here<p>
1676
1677<a name="rw_sun_simd">
1678<dt><a href="http://www.nondot.org/~sabre/os/H1ChipFeatures/VISInstructionSetUsersManual.pdf">Sun VIS ISA</a>
1679<DD>Desciption here<p>
1680
Chris Lattner6536cfe2002-05-06 22:08:29 +00001681<a name="rw_powerpc_simd">
1682<dt>PowerPC Altivec
1683<DD>Desciption here<p>
Chris Lattner00950542001-06-06 20:29:01 +00001684
1685</dl>
1686
1687more...
1688
Chris Lattner6536cfe2002-05-06 22:08:29 +00001689-->
1690
1691
Chris Lattner00950542001-06-06 20:29:01 +00001692<!-- *********************************************************************** -->
1693</ul>
1694<!-- *********************************************************************** -->
1695
1696
1697<hr>
1698<font size=-1>
1699<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
1700<!-- Created: Tue Jan 23 15:19:28 CST 2001 -->
1701<!-- hhmts start -->
Chris Lattnerd816bcf2002-08-30 21:50:21 +00001702Last modified: Fri Aug 30 16:49:39 CDT 2002
Chris Lattner00950542001-06-06 20:29:01 +00001703<!-- hhmts end -->
1704</font>
1705</body></html>