llvm.org GIT mirror llvm / 2632bbf
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 Eric Christopher 9 years ago
4 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
373373 if (L == 0 || R == 0) return 0;
374374
375375 switch (Op) {
376 case '+': return Builder.CreateAdd(L, R, "addtmp");
377 case '-': return Builder.CreateSub(L, R, "subtmp");
378 case '*': return Builder.CreateMul(L, R, "multmp");
376 case '+': return Builder.CreateFAdd(L, R, "addtmp");
377 case '-': return Builder.CreateFSub(L, R, "subtmp");
378 case '*': return Builder.CreateFMul(L, R, "multmp");
379379 case '<':
380380 L = Builder.CreateFCmpULT(L, R, "cmptmp");
381381 // Convert bool 0/1 to double 0.0 or 1.0
474474 if (L == 0 || R == 0) return 0;
475475
476476 switch (Op) {
477 case '+': return Builder.CreateAdd(L, R, "addtmp");
478 case '-': return Builder.CreateSub(L, R, "subtmp");
479 case '*': return Builder.CreateMul(L, R, "multmp");
477 case '+': return Builder.CreateFAdd(L, R, "addtmp");
478 case '-': return Builder.CreateFSub(L, R, "subtmp");
479 case '*': return Builder.CreateFMul(L, R, "multmp");
480480 case '<':
481481 L = Builder.CreateFCmpULT(L, R, "cmptmp");
482482 // Convert bool 0/1 to double 0.0 or 1.0
570570 if (L == 0 || R == 0) return 0;
571571
572572 switch (Op) {
573 case '+': return Builder.CreateAdd(L, R, "addtmp");
574 case '-': return Builder.CreateSub(L, R, "subtmp");
575 case '*': return Builder.CreateMul(L, R, "multmp");
573 case '+': return Builder.CreateFAdd(L, R, "addtmp");
574 case '-': return Builder.CreateFSub(L, R, "subtmp");
575 case '*': return Builder.CreateFMul(L, R, "multmp");
576576 case '<':
577577 L = Builder.CreateFCmpULT(L, R, "cmptmp");
578578 // Convert bool 0/1 to double 0.0 or 1.0
666666 if (L == 0 || R == 0) return 0;
667667
668668 switch (Op) {
669 case '+': return Builder.CreateAdd(L, R, "addtmp");
670 case '-': return Builder.CreateSub(L, R, "subtmp");
671 case '*': return Builder.CreateMul(L, R, "multmp");
669 case '+': return Builder.CreateFAdd(L, R, "addtmp");
670 case '-': return Builder.CreateFSub(L, R, "subtmp");
671 case '*': return Builder.CreateFMul(L, R, "multmp");
672672 case '<':
673673 L = Builder.CreateFCmpULT(L, R, "cmptmp");
674674 // Convert bool 0/1 to double 0.0 or 1.0