mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 16:35:10 +00:00
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
This commit is contained in:
parent
918f8e4ab0
commit
2632bbf0de
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user