aboutsummaryrefslogtreecommitdiffstats
path: root/docs/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorial')
-rw-r--r--docs/tutorial/LangImpl1.html2
-rw-r--r--docs/tutorial/LangImpl2.html2
-rw-r--r--docs/tutorial/LangImpl3.html44
-rw-r--r--docs/tutorial/LangImpl4.html38
-rw-r--r--docs/tutorial/LangImpl5.html12
-rw-r--r--docs/tutorial/LangImpl6.html10
-rw-r--r--docs/tutorial/LangImpl7.html28
-rw-r--r--docs/tutorial/LangImpl8.html2
-rw-r--r--docs/tutorial/Makefile2
-rw-r--r--docs/tutorial/OCamlLangImpl1.html2
-rw-r--r--docs/tutorial/OCamlLangImpl2.html2
-rw-r--r--docs/tutorial/OCamlLangImpl3.html34
-rw-r--r--docs/tutorial/OCamlLangImpl4.html28
-rw-r--r--docs/tutorial/OCamlLangImpl5.html4
-rw-r--r--docs/tutorial/OCamlLangImpl6.html2
-rw-r--r--docs/tutorial/OCamlLangImpl7.html20
16 files changed, 124 insertions, 108 deletions
diff --git a/docs/tutorial/LangImpl1.html b/docs/tutorial/LangImpl1.html
index fddb40f..0779bf1 100644
--- a/docs/tutorial/LangImpl1.html
+++ b/docs/tutorial/LangImpl1.html
@@ -342,7 +342,7 @@ so that you can use the lexer and parser together.
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-02-04 01:27:31 +0800 (四, 04 2月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/LangImpl2.html b/docs/tutorial/LangImpl2.html
index fb9f8e1..64f2747 100644
--- a/docs/tutorial/LangImpl2.html
+++ b/docs/tutorial/LangImpl2.html
@@ -1227,7 +1227,7 @@ int main() {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-02-04 01:27:31 +0800 (四, 04 2月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/LangImpl3.html b/docs/tutorial/LangImpl3.html
index aab7faa..831c7c1 100644
--- a/docs/tutorial/LangImpl3.html
+++ b/docs/tutorial/LangImpl3.html
@@ -170,7 +170,7 @@ internally (<tt>APFloat</tt> has the capability of holding floating point
constants of <em>A</em>rbitrary <em>P</em>recision). This code basically just
creates and returns a <tt>ConstantFP</tt>. Note that in the LLVM IR
that constants are all uniqued together and shared. For this reason, the API
-uses "the Context.get..." idiom instead of "new foo(..)" or "foo::Create(..)".</p>
+uses the "foo::get(...)" idiom instead of "new foo(..)" or "foo::Create(..)".</p>
<div class="doc_code">
<pre>
@@ -323,10 +323,10 @@ really talks about the external interface for a function (not the value computed
by an expression), it makes sense for it to return the LLVM Function it
corresponds to when codegen'd.</p>
-<p>The call to <tt>Context.get</tt> creates
+<p>The call to <tt>FunctionType::get</tt> creates
the <tt>FunctionType</tt> that should be used for a given Prototype. Since all
function arguments in Kaleidoscope are of type double, the first line creates
-a vector of "N" LLVM double types. It then uses the <tt>Context.get</tt>
+a vector of "N" LLVM double types. It then uses the <tt>Functiontype::get</tt>
method to create a function type that takes "N" doubles as arguments, returns
one double as a result, and that is not vararg (the false parameter indicates
this). Note that Types in LLVM are uniqued just like Constants are, so you
@@ -535,8 +535,7 @@ ready> <b>4+5</b>;
Read top-level expression:
define double @""() {
entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
- ret double %addtmp
+ ret double 9.000000e+00
}
</pre>
</div>
@@ -544,7 +543,8 @@ entry:
<p>Note how the parser turns the top-level expression into anonymous functions
for us. This will be handy when we add <a href="LangImpl4.html#jit">JIT
support</a> in the next chapter. Also note that the code is very literally
-transcribed, no optimizations are being performed. We will
+transcribed, no optimizations are being performed except simple constant
+folding done by IRBuilder. We will
<a href="LangImpl4.html#trivialconstfold">add optimizations</a> explicitly in
the next chapter.</p>
@@ -554,12 +554,12 @@ ready&gt; <b>def foo(a b) a*a + 2*a*b + b*b;</b>
Read function definition:
define double @foo(double %a, double %b) {
entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
+ %multmp = fmul double %a, %a
+ %multmp1 = fmul double 2.000000e+00, %a
+ %multmp2 = fmul double %multmp1, %b
+ %addtmp = fadd double %multmp, %multmp2
+ %multmp3 = fmul double %b, %b
+ %addtmp4 = fadd double %addtmp, %multmp3
ret double %addtmp4
}
</pre>
@@ -576,7 +576,7 @@ define double @bar(double %a) {
entry:
%calltmp = call double @foo( double %a, double 4.000000e+00 )
%calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
+ %addtmp = fadd double %calltmp, %calltmp1
ret double %addtmp
}
</pre>
@@ -612,18 +612,18 @@ ready&gt; <b>^D</b>
define double @""() {
entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
+ %addtmp = fadd double 4.000000e+00, 5.000000e+00
ret double %addtmp
}
define double @foo(double %a, double %b) {
entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
+ %multmp = fmul double %a, %a
+ %multmp1 = fmul double 2.000000e+00, %a
+ %multmp2 = fmul double %multmp1, %b
+ %addtmp = fadd double %multmp, %multmp2
+ %multmp3 = fmul double %b, %b
+ %addtmp4 = fadd double %addtmp, %multmp3
ret double %addtmp4
}
@@ -631,7 +631,7 @@ define double @bar(double %a) {
entry:
%calltmp = call double @foo( double %a, double 4.000000e+00 )
%calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
+ %addtmp = fadd double %calltmp, %calltmp1
ret double %addtmp
}
@@ -1263,7 +1263,7 @@ int main() {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/LangImpl4.html b/docs/tutorial/LangImpl4.html
index 38ed25d..992fe36 100644
--- a/docs/tutorial/LangImpl4.html
+++ b/docs/tutorial/LangImpl4.html
@@ -65,7 +65,7 @@ ready&gt; <b>def test(x) 1+2+x;</b>
Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double 3.000000e+00, %x
+ %addtmp = fadd double 3.000000e+00, %x
ret double %addtmp
}
</pre>
@@ -80,8 +80,8 @@ ready&gt; <b>def test(x) 1+2+x;</b>
Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double 2.000000e+00, 1.000000e+00
- %addtmp1 = add double %addtmp, %x
+ %addtmp = fadd double 2.000000e+00, 1.000000e+00
+ %addtmp1 = fadd double %addtmp, %x
ret double %addtmp1
}
</pre>
@@ -113,9 +113,9 @@ ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
ready> Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double 3.000000e+00, %x
- %addtmp1 = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp1
+ %addtmp = fadd double 3.000000e+00, %x
+ %addtmp1 = fadd double %x, 3.000000e+00
+ %multmp = fmul double %addtmp, %addtmp1
ret double %multmp
}
</pre>
@@ -240,8 +240,8 @@ ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
ready> Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp
+ %addtmp = fadd double %x, 3.000000e+00
+ %multmp = fmul double %addtmp, %addtmp
ret double %multmp
}
</pre>
@@ -363,8 +363,8 @@ ready&gt; <b>def testfunc(x y) x + y*2; </b>
Read function definition:
define double @testfunc(double %x, double %y) {
entry:
- %multmp = mul double %y, 2.000000e+00
- %addtmp = add double %multmp, %x
+ %multmp = fmul double %y, 2.000000e+00
+ %addtmp = fadd double %multmp, %x
ret double %addtmp
}
@@ -411,10 +411,10 @@ Read function definition:
define double @foo(double %x) {
entry:
%calltmp = call double @sin( double %x )
- %multmp = mul double %calltmp, %calltmp
+ %multmp = fmul double %calltmp, %calltmp
%calltmp2 = call double @cos( double %x )
- %multmp4 = mul double %calltmp2, %calltmp2
- %addtmp = add double %multmp, %multmp4
+ %multmp4 = fmul double %calltmp2, %calltmp2
+ %addtmp = fadd double %multmp, %multmp4
ret double %addtmp
}
@@ -485,7 +485,7 @@ LLVM JIT and optimizer. To build this example, use:
<div class="doc_code">
<pre>
# Compile
- g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit interpreter native` -O3 -o toy
+ g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
# Run
./toy
</pre>
@@ -502,7 +502,6 @@ at runtime.</p>
<pre>
#include "llvm/DerivedTypes.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
@@ -1075,7 +1074,12 @@ int main() {
TheModule = new Module("my cool jit", Context);
// Create the JIT. This takes ownership of the module.
- TheExecutionEngine = EngineBuilder(TheModule).create();
+ std::string ErrStr;
+ TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create();
+ if (!TheExecutionEngine) {
+ fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str());
+ exit(1);
+ }
FunctionPassManager OurFPM(TheModule);
@@ -1122,7 +1126,7 @@ int main() {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html
index bd175c0..a663e9c 100644
--- a/docs/tutorial/LangImpl5.html
+++ b/docs/tutorial/LangImpl5.html
@@ -678,7 +678,7 @@ loop: ; preds = %loop, %entry
; body
%calltmp = call double @putchard( double 4.200000e+01 )
; increment
- %nextvar = add double %i, 1.000000e+00
+ %nextvar = fadd double %i, 1.000000e+00
; termination test
%cmptmp = fcmp ult double %i, %n
@@ -902,7 +902,6 @@ if/then/else and for expressions.. To build this example, use:
<pre>
#include "llvm/DerivedTypes.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
@@ -1720,7 +1719,12 @@ int main() {
TheModule = new Module("my cool jit", Context);
// Create the JIT. This takes ownership of the module.
- TheExecutionEngine = EngineBuilder(TheModule).create();
+ std::string ErrStr;
+ TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create();
+ if (!TheExecutionEngine) {
+ fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str());
+ exit(1);
+ }
FunctionPassManager OurFPM(TheModule);
@@ -1767,7 +1771,7 @@ int main() {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/LangImpl6.html b/docs/tutorial/LangImpl6.html
index 0c93224..5986849 100644
--- a/docs/tutorial/LangImpl6.html
+++ b/docs/tutorial/LangImpl6.html
@@ -821,7 +821,6 @@ if/then/else and for expressions.. To build this example, use:
<pre>
#include "llvm/DerivedTypes.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
@@ -1757,7 +1756,12 @@ int main() {
TheModule = new Module("my cool jit", Context);
// Create the JIT. This takes ownership of the module.
- TheExecutionEngine = EngineBuilder(TheModule).create();
+ std::string ErrStr;
+ TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create();
+ if (!TheExecutionEngine) {
+ fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str());
+ exit(1);
+ }
FunctionPassManager OurFPM(TheModule);
@@ -1804,7 +1808,7 @@ int main() {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-02-12 03:15:20 +0800 (五, 12 2月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/LangImpl7.html b/docs/tutorial/LangImpl7.html
index 30342c3..9d67e6b 100644
--- a/docs/tutorial/LangImpl7.html
+++ b/docs/tutorial/LangImpl7.html
@@ -557,12 +557,12 @@ then: ; preds = %entry
else: ; preds = %entry
<b>%x3 = load double* %x1</b>
- %subtmp = sub double %x3, 1.000000e+00
+ %subtmp = fsub double %x3, 1.000000e+00
%calltmp = call double @fib( double %subtmp )
<b>%x4 = load double* %x1</b>
- %subtmp5 = sub double %x4, 2.000000e+00
+ %subtmp5 = fsub double %x4, 2.000000e+00
%calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
+ %addtmp = fadd double %calltmp, %calltmp6
br label %ifcont
ifcont: ; preds = %else, %then
@@ -595,11 +595,11 @@ then:
br label %ifcont
else:
- %subtmp = sub double <b>%x</b>, 1.000000e+00
+ %subtmp = fsub double <b>%x</b>, 1.000000e+00
%calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double <b>%x</b>, 2.000000e+00
+ %subtmp5 = fsub double <b>%x</b>, 2.000000e+00
%calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
+ %addtmp = fadd double %calltmp, %calltmp6
br label %ifcont
ifcont: ; preds = %else, %then
@@ -625,11 +625,11 @@ entry:
br i1 %ifcond, label %else, label %ifcont
else:
- %subtmp = sub double %x, 1.000000e+00
+ %subtmp = fsub double %x, 1.000000e+00
%calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double %x, 2.000000e+00
+ %subtmp5 = fsub double %x, 2.000000e+00
%calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
+ %addtmp = fadd double %calltmp, %calltmp6
ret double %addtmp
ifcont:
@@ -1004,7 +1004,6 @@ variables and var/in support. To build this example, use:
<pre>
#include "llvm/DerivedTypes.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
@@ -2105,7 +2104,12 @@ int main() {
TheModule = new Module("my cool jit", Context);
// Create the JIT. This takes ownership of the module.
- TheExecutionEngine = EngineBuilder(TheModule).create();
+ std::string ErrStr;
+ TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&amp;ErrStr).create();
+ if (!TheExecutionEngine) {
+ fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str());
+ exit(1);
+ }
FunctionPassManager OurFPM(TheModule);
@@ -2154,7 +2158,7 @@ int main() {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/LangImpl8.html b/docs/tutorial/LangImpl8.html
index b5d4f67..bd26cc4 100644
--- a/docs/tutorial/LangImpl8.html
+++ b/docs/tutorial/LangImpl8.html
@@ -359,7 +359,7 @@ Passing Style</a> and the use of tail calls (which LLVM also supports).</p>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-02-04 01:27:31 +0800 (四, 04 2月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/Makefile b/docs/tutorial/Makefile
index 6169bb8..9082ad4 100644
--- a/docs/tutorial/Makefile
+++ b/docs/tutorial/Makefile
@@ -12,7 +12,7 @@ include $(LEVEL)/Makefile.common
HTML := $(wildcard $(PROJ_SRC_DIR)/*.html)
EXTRA_DIST := $(HTML) index.html
-HTML_DIR := $(PROJ_docsdir)/html/tutorial
+HTML_DIR := $(DESTDIR)$(PROJ_docsdir)/html/tutorial
install-local:: $(HTML)
$(Echo) Installing HTML Tutorial Documentation
diff --git a/docs/tutorial/OCamlLangImpl1.html b/docs/tutorial/OCamlLangImpl1.html
index c9bb13d..64ba926 100644
--- a/docs/tutorial/OCamlLangImpl1.html
+++ b/docs/tutorial/OCamlLangImpl1.html
@@ -359,7 +359,7 @@ include a driver so that you can use the lexer and parser together.
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-02-04 01:27:31 +0800 (四, 04 2月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/OCamlLangImpl2.html b/docs/tutorial/OCamlLangImpl2.html
index f354223..db03134 100644
--- a/docs/tutorial/OCamlLangImpl2.html
+++ b/docs/tutorial/OCamlLangImpl2.html
@@ -1039,7 +1039,7 @@ main ()
<a href="mailto:sabre@nondot.org">Chris Lattner</a>
<a href="mailto:erickt@users.sourceforge.net">Erick Tryzelaar</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-02-04 01:27:31 +0800 (四, 04 2月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/OCamlLangImpl3.html b/docs/tutorial/OCamlLangImpl3.html
index 1802eff..4d2c0f8 100644
--- a/docs/tutorial/OCamlLangImpl3.html
+++ b/docs/tutorial/OCamlLangImpl3.html
@@ -484,7 +484,7 @@ ready&gt; <b>4+5</b>;
Read top-level expression:
define double @""() {
entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
+ %addtmp = fadd double 4.000000e+00, 5.000000e+00
ret double %addtmp
}
</pre>
@@ -503,12 +503,12 @@ ready&gt; <b>def foo(a b) a*a + 2*a*b + b*b;</b>
Read function definition:
define double @foo(double %a, double %b) {
entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
+ %multmp = fmul double %a, %a
+ %multmp1 = fmul double 2.000000e+00, %a
+ %multmp2 = fmul double %multmp1, %b
+ %addtmp = fadd double %multmp, %multmp2
+ %multmp3 = fmul double %b, %b
+ %addtmp4 = fadd double %addtmp, %multmp3
ret double %addtmp4
}
</pre>
@@ -525,7 +525,7 @@ define double @bar(double %a) {
entry:
%calltmp = call double @foo( double %a, double 4.000000e+00 )
%calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
+ %addtmp = fadd double %calltmp, %calltmp1
ret double %addtmp
}
</pre>
@@ -561,18 +561,18 @@ ready&gt; <b>^D</b>
define double @""() {
entry:
- %addtmp = add double 4.000000e+00, 5.000000e+00
+ %addtmp = fadd double 4.000000e+00, 5.000000e+00
ret double %addtmp
}
define double @foo(double %a, double %b) {
entry:
- %multmp = mul double %a, %a
- %multmp1 = mul double 2.000000e+00, %a
- %multmp2 = mul double %multmp1, %b
- %addtmp = add double %multmp, %multmp2
- %multmp3 = mul double %b, %b
- %addtmp4 = add double %addtmp, %multmp3
+ %multmp = fmul double %a, %a
+ %multmp1 = fmul double 2.000000e+00, %a
+ %multmp2 = fmul double %multmp1, %b
+ %addtmp = fadd double %multmp, %multmp2
+ %multmp3 = fmul double %b, %b
+ %addtmp4 = fadd double %addtmp, %multmp3
ret double %addtmp4
}
@@ -580,7 +580,7 @@ define double @bar(double %a) {
entry:
%calltmp = call double @foo( double %a, double 4.000000e+00 )
%calltmp1 = call double @bar( double 3.133700e+04 )
- %addtmp = add double %calltmp, %calltmp1
+ %addtmp = fadd double %calltmp, %calltmp1
ret double %addtmp
}
@@ -1085,7 +1085,7 @@ main ()
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/OCamlLangImpl4.html b/docs/tutorial/OCamlLangImpl4.html
index f3b9ff0..1e91330 100644
--- a/docs/tutorial/OCamlLangImpl4.html
+++ b/docs/tutorial/OCamlLangImpl4.html
@@ -72,8 +72,8 @@ ready&gt; <b>def test(x) 1+2+x;</b>
Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double 1.000000e+00, 2.000000e+00
- %addtmp1 = add double %addtmp, %x
+ %addtmp = fadd double 1.000000e+00, 2.000000e+00
+ %addtmp1 = fadd double %addtmp, %x
ret double %addtmp1
}
</pre>
@@ -104,7 +104,7 @@ ready&gt; <b>def test(x) 1+2+x;</b>
Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double 3.000000e+00, %x
+ %addtmp = fadd double 3.000000e+00, %x
ret double %addtmp
}
</pre>
@@ -127,9 +127,9 @@ ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
ready&gt; Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double 3.000000e+00, %x
- %addtmp1 = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp1
+ %addtmp = fadd double 3.000000e+00, %x
+ %addtmp1 = fadd double %x, 3.000000e+00
+ %multmp = fmul double %addtmp, %addtmp1
ret double %multmp
}
</pre>
@@ -267,8 +267,8 @@ ready&gt; <b>def test(x) (1+2+x)*(x+(1+2));</b>
ready&gt; Read function definition:
define double @test(double %x) {
entry:
- %addtmp = add double %x, 3.000000e+00
- %multmp = mul double %addtmp, %addtmp
+ %addtmp = fadd double %x, 3.000000e+00
+ %multmp = fmul double %addtmp, %addtmp
ret double %multmp
}
</pre>
@@ -388,8 +388,8 @@ ready&gt; <b>def testfunc(x y) x + y*2; </b>
Read function definition:
define double @testfunc(double %x, double %y) {
entry:
- %multmp = mul double %y, 2.000000e+00
- %addtmp = add double %multmp, %x
+ %multmp = fmul double %y, 2.000000e+00
+ %addtmp = fadd double %multmp, %x
ret double %addtmp
}
@@ -436,10 +436,10 @@ Read function definition:
define double @foo(double %x) {
entry:
%calltmp = call double @sin( double %x )
- %multmp = mul double %calltmp, %calltmp
+ %multmp = fmul double %calltmp, %calltmp
%calltmp2 = call double @cos( double %x )
- %multmp4 = mul double %calltmp2, %calltmp2
- %addtmp = add double %multmp, %multmp4
+ %multmp4 = fmul double %calltmp2, %calltmp2
+ %addtmp = fadd double %multmp, %multmp4
ret double %addtmp
}
@@ -1032,7 +1032,7 @@ extern double putchard(double X) {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/OCamlLangImpl5.html b/docs/tutorial/OCamlLangImpl5.html
index 93d7146..5848457 100644
--- a/docs/tutorial/OCamlLangImpl5.html
+++ b/docs/tutorial/OCamlLangImpl5.html
@@ -653,7 +653,7 @@ loop: ; preds = %loop, %entry
; body
%calltmp = call double @putchard( double 4.200000e+01 )
; increment
- %nextvar = add double %i, 1.000000e+00
+ %nextvar = fadd double %i, 1.000000e+00
; termination test
%cmptmp = fcmp ult double %i, %n
@@ -1563,7 +1563,7 @@ operators</a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/OCamlLangImpl6.html b/docs/tutorial/OCamlLangImpl6.html
index cf153c4..218c9d1 100644
--- a/docs/tutorial/OCamlLangImpl6.html
+++ b/docs/tutorial/OCamlLangImpl6.html
@@ -1568,7 +1568,7 @@ SSA construction</a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-02-04 01:27:31 +0800 (四, 04 2月 2010) $
</address>
</body>
</html>
diff --git a/docs/tutorial/OCamlLangImpl7.html b/docs/tutorial/OCamlLangImpl7.html
index 9e0f3bd..78d42f8 100644
--- a/docs/tutorial/OCamlLangImpl7.html
+++ b/docs/tutorial/OCamlLangImpl7.html
@@ -581,12 +581,12 @@ then: ; preds = %entry
else: ; preds = %entry
<b>%x3 = load double* %x1</b>
- %subtmp = sub double %x3, 1.000000e+00
+ %subtmp = fsub double %x3, 1.000000e+00
%calltmp = call double @fib( double %subtmp )
<b>%x4 = load double* %x1</b>
- %subtmp5 = sub double %x4, 2.000000e+00
+ %subtmp5 = fsub double %x4, 2.000000e+00
%calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
+ %addtmp = fadd double %calltmp, %calltmp6
br label %ifcont
ifcont: ; preds = %else, %then
@@ -619,11 +619,11 @@ then:
br label %ifcont
else:
- %subtmp = sub double <b>%x</b>, 1.000000e+00
+ %subtmp = fsub double <b>%x</b>, 1.000000e+00
%calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double <b>%x</b>, 2.000000e+00
+ %subtmp5 = fsub double <b>%x</b>, 2.000000e+00
%calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
+ %addtmp = fadd double %calltmp, %calltmp6
br label %ifcont
ifcont: ; preds = %else, %then
@@ -649,11 +649,11 @@ entry:
br i1 %ifcond, label %else, label %ifcont
else:
- %subtmp = sub double %x, 1.000000e+00
+ %subtmp = fsub double %x, 1.000000e+00
%calltmp = call double @fib( double %subtmp )
- %subtmp5 = sub double %x, 2.000000e+00
+ %subtmp5 = fsub double %x, 2.000000e+00
%calltmp6 = call double @fib( double %subtmp5 )
- %addtmp = add double %calltmp, %calltmp6
+ %addtmp = fadd double %calltmp, %calltmp6
ret double %addtmp
ifcont:
@@ -1901,7 +1901,7 @@ extern double printd(double X) {
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
<a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br>
- Last modified: $Date: 2010-02-03 09:27:31 -0800 (Wed, 03 Feb 2010) $
+ Last modified: $Date: 2010-03-02 09:11:08 +0800 (二, 02 3月 2010) $
</address>
</body>
</html>