summaryrefslogtreecommitdiffstats
path: root/examples/Kaleidoscope
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-06-14 06:03:16 +0000
committerEric Christopher <echristo@apple.com>2010-06-14 06:03:16 +0000
commit2632bbf0de4637e02f333952991263d526976faf (patch)
tree3d3b79b075c68961d376eb75fdd78163f22adb77 /examples/Kaleidoscope
parent918f8e4ab0fe645d26baface7958d3673437bc04 (diff)
downloadexternal_llvm-2632bbf0de4637e02f333952991263d526976faf.zip
external_llvm-2632bbf0de4637e02f333952991263d526976faf.tar.gz
external_llvm-2632bbf0de4637e02f333952991263d526976faf.tar.bz2
Make kaleidoscope use fp add/sub/mul.
Patch by Patrick Flannery! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/Kaleidoscope')
-rw-r--r--examples/Kaleidoscope/Chapter4/toy.cpp6
-rw-r--r--examples/Kaleidoscope/Chapter5/toy.cpp6
-rw-r--r--examples/Kaleidoscope/Chapter6/toy.cpp6
-rw-r--r--examples/Kaleidoscope/Chapter7/toy.cpp6
4 files changed, 12 insertions, 12 deletions
diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp
index a2ddda2..c88a76f 100644
--- a/examples/Kaleidoscope/Chapter4/toy.cpp
+++ b/examples/Kaleidoscope/Chapter4/toy.cpp
@@ -374,9 +374,9 @@ Value *BinaryExprAST::Codegen() {
if (L == 0 || R == 0) return 0;
switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
+ case '+': return Builder.CreateFAdd(L, R, "addtmp");
+ case '-': return Builder.CreateFSub(L, R, "subtmp");
+ case '*': return Builder.CreateFMul(L, R, "multmp");
case '<':
L = Builder.CreateFCmpULT(L, R, "cmptmp");
// Convert bool 0/1 to double 0.0 or 1.0
diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp
index da64b7e..05ea864 100644
--- a/examples/Kaleidoscope/Chapter5/toy.cpp
+++ b/examples/Kaleidoscope/Chapter5/toy.cpp
@@ -475,9 +475,9 @@ Value *BinaryExprAST::Codegen() {
if (L == 0 || R == 0) return 0;
switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
+ case '+': return Builder.CreateFAdd(L, R, "addtmp");
+ case '-': return Builder.CreateFSub(L, R, "subtmp");
+ case '*': return Builder.CreateFMul(L, R, "multmp");
case '<':
L = Builder.CreateFCmpULT(L, R, "cmptmp");
// Convert bool 0/1 to double 0.0 or 1.0
diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp
index 4e719e3..ef348e5 100644
--- a/examples/Kaleidoscope/Chapter6/toy.cpp
+++ b/examples/Kaleidoscope/Chapter6/toy.cpp
@@ -571,9 +571,9 @@ Value *BinaryExprAST::Codegen() {
if (L == 0 || R == 0) return 0;
switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
+ case '+': return Builder.CreateFAdd(L, R, "addtmp");
+ case '-': return Builder.CreateFSub(L, R, "subtmp");
+ case '*': return Builder.CreateFMul(L, R, "multmp");
case '<':
L = Builder.CreateFCmpULT(L, R, "cmptmp");
// Convert bool 0/1 to double 0.0 or 1.0
diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp
index 7dd9eae..7519deb 100644
--- a/examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/examples/Kaleidoscope/Chapter7/toy.cpp
@@ -667,9 +667,9 @@ Value *BinaryExprAST::Codegen() {
if (L == 0 || R == 0) return 0;
switch (Op) {
- case '+': return Builder.CreateAdd(L, R, "addtmp");
- case '-': return Builder.CreateSub(L, R, "subtmp");
- case '*': return Builder.CreateMul(L, R, "multmp");
+ case '+': return Builder.CreateFAdd(L, R, "addtmp");
+ case '-': return Builder.CreateFSub(L, R, "subtmp");
+ case '*': return Builder.CreateFMul(L, R, "multmp");
case '<':
L = Builder.CreateFCmpULT(L, R, "cmptmp");
// Convert bool 0/1 to double 0.0 or 1.0