Added information about how to unpack the distribution for those who do not
[oota-llvm.git] / docs / LangRef.html
index 65cb4ea968d5c94e322bdb039fdc725c8faa1383..7b70c43831eb2d4d8e38ec42caf2b87f46f2e65f 100644 (file)
@@ -295,7 +295,7 @@ These different primitive types fall into a few useful classifications:<p>
 <table border=1 cellspacing=0 cellpadding=4 align=center>
 <tr><td><a name="t_signed">signed</td>    <td><tt>sbyte, short, int, long, float, double</tt></td></tr>
 <tr><td><a name="t_unsigned">unsigned</td><td><tt>ubyte, ushort, uint, ulong</tt></td></tr>
-<tr><td><a name="t_integral">integer</td><td><tt>ubyte, sbyte, ushort, short, uint, int, ulong, long</tt></td></tr>
+<tr><td><a name="t_integer">integer</td><td><tt>ubyte, sbyte, ushort, short, uint, int, ulong, long</tt></td></tr>
 <tr><td><a name="t_integral">integral</td><td><tt>bool, ubyte, sbyte, ushort, short, uint, int, ulong, long</tt></td></tr>
 <tr><td><a name="t_floating">floating point</td><td><tt>float, double</tt></td></tr>
 <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>
@@ -1193,9 +1193,10 @@ argument is unsigned, zero bits shall fill the empty positions.<p>
 <h5>Example:</h5>
 <pre>
   &lt;result&gt; = shr int 4, ubyte %var   <i>; yields {int}:result = 4 >> %var</i>
-  &lt;result&gt; = shr int 4, ubyte 1      <i>; yields {int}:result = 2</i>
+  &lt;result&gt; = shr uint 4, ubyte 1     <i>; yields {uint}:result = 2</i>
   &lt;result&gt; = shr int 4, ubyte 2      <i>; yields {int}:result = 1</i>
-  &lt;result&gt; = shr int 4, ubyte 3      <i>; yields {int}:result = 0</i>
+  &lt;result&gt; = shr sbyte 4, ubyte 3    <i>; yields {sbyte}:result = 0</i>
+  &lt;result&gt; = shr sbyte -2, ubyte 1   <i>; yields {sbyte}:result = -1</i>
 </pre>
 
 
@@ -1697,7 +1698,7 @@ int %test(int %X, ...) {
   %aq = alloca sbyte*
 
   ; Initialize variable argument processing
-  call void (sbyte**, ...)* %<a href="#i_va_start">llvm.va_start</a>(sbyte** %ap, int %X)
+  call void (sbyte**)* %<a href="#i_va_start">llvm.va_start</a>(sbyte** %ap)
 
   ; Read a single integer argument
   %tmp = <a href="#i_va_arg">va_arg</a> sbyte** %ap, int 
@@ -1718,7 +1719,7 @@ int %test(int %X, ...) {
 
 <h5>Syntax:</h5>
 <pre>
-  call void (va_list*, ...)* %llvm.va_start(&lt;va_list&gt;* &lt;arglist&gt;, &lt;argument&gt;)
+  call void (va_list*)* %llvm.va_start(&lt;va_list&gt;* &lt;arglist&gt;)
 </pre>
 
 <h5>Overview:</h5>
@@ -1730,18 +1731,16 @@ invoked.<p>
 
 <h5>Arguments:</h5>
 
-The first argument is a pointer to a <tt>va_list</tt> element to initialize.
-The second argument is required to be the last LLVM argument before the
-ellipsis.  In the future, this restriction may be relaxed (to allow it to be
-other arguments).<p>
+The argument is a pointer to a <tt>va_list</tt> element to initialize.<p>
 
 <h5>Semantics:</h5>
 
 The '<tt>llvm.va_start</tt>' intrinsic works just like the <tt>va_start</tt>
 macro available in C.  In a target-dependent way, it initializes the
-<tt>va_list</tt> element the first argument points to, so that the next call to
-<tt>va_arg</tt> will produce the first variable argument passed to the
-function.<p>
+<tt>va_list</tt> element the argument points to, so that the next call to
+<tt>va_arg</tt> will produce the first variable argument passed to the function.
+Unlike the C <tt>va_start</tt> macro, this intrinsic does not need to know the
+last argument of the function, the compiler can figure that out.<p>
 
 
 <!-- _______________________________________________________________________ -->
@@ -1812,7 +1811,7 @@ arbitrarily complex and require memory allocation, for example.<p>
 <address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
 <!-- Created: Tue Jan 23 15:19:28 CST 2001 -->
 <!-- hhmts start -->
-Last modified: Thu May  8 00:06:36 CDT 2003
+Last modified: Wed Jun 18 16:29:55 CDT 2003
 <!-- hhmts end -->
 </font>
 </body></html>