[llvm-commits] CVS: llvm/docs/ReleaseNotes.html

Chris Lattner lattner at cs.uiuc.edu
Sat May 14 23:07:55 PDT 2005



Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.318 -> 1.319
---
Log message:

add generated code


---
Diffs of the changes:  (+25 -7)

 ReleaseNotes.html |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.318 llvm/docs/ReleaseNotes.html:1.319
--- llvm/docs/ReleaseNotes.html:1.318	Sun May 15 01:05:11 2005
+++ llvm/docs/ReleaseNotes.html	Sun May 15 01:07:40 2005
@@ -150,17 +150,35 @@
 generator supports tail calls.  Here is a simple example:</p>
 
 <p><pre>
-fastcc int %bar(int %X, int(double, int)* %FP) {        ;<i> fastcc</i>
-     %Y = tail call fastcc int %FP(double 0.0, int %X)  ;<i> tail, fastcc</i>
-     ret int %Y
-}
+    fastcc int %bar(int %X, int(double, int)* %FP) {       ;<i> fastcc</i>
+        %Y = tail call fastcc int %FP(double 0.0, int %X)  ;<i> tail, fastcc</i>
+        ret int %Y
+    }
 </pre></p>
 
 <p>In LLVM 1.5, the X86 code generator is the only target that has been enhanced
 to support proper tail calls (other targets will be enhanced in future).
 Further, because this support was added very close to the release, it is
-disabled by default.  Pass <tt>-enable-x86-fastcc</tt> to llc to enable it.  X86
-support will be enabled by default in the next LLVM release.</p>
+disabled by default.  Pass <tt>-enable-x86-fastcc</tt> to llc to enable it (this
+will be enabled by default in the next release).  The example above compiles to:
+</p>
+
+<p><pre>
+    bar:
+        sub ESP, 8                   # Callee uses more space than the caller
+        mov ECX, DWORD PTR [ESP + 8] # Get the old return address
+        mov DWORD PTR [ESP + 4], 0   # First half of 0.0
+        mov DWORD PTR [ESP + 8], 0   # Second half of 0.0
+        mov DWORD PTR [ESP], ECX     # Put the return address where it belongs
+        jmp EDX                      # Tail call "FP"
+</pre></p>
+
+<p>
+With fastcc on X86, the first two integer arguments are passed in EAX/EDX, the
+callee pops its arguments off the stack, and the argument area is always a
+multiple of 8 bytes in size.
+</p>
+
 </div>
 
 <!--_________________________________________________________________________-->
@@ -737,7 +755,7 @@
   src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
 
   <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
-  Last modified: $Date: 2005/05/15 06:05:11 $
+  Last modified: $Date: 2005/05/15 06:07:40 $
 </address>
 
 </body>






More information about the llvm-commits mailing list