Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1436623002: Improve bool folding (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Enabled fcmp folding and test Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceTargetLoweringX86BaseImpl.h » ('j') | src/IceTargetLoweringX86BaseImpl.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 } 713 }
714 714
715 template <typename... Args> 715 template <typename... Args>
716 void dispatchToConcrete(void (Machine::*Method)(Args...), Args &&... args) { 716 void dispatchToConcrete(void (Machine::*Method)(Args...), Args &&... args) {
717 (static_cast<Machine *>(this)->*Method)(std::forward<Args>(args)...); 717 (static_cast<Machine *>(this)->*Method)(std::forward<Args>(args)...);
718 } 718 }
719 719
720 void lowerShift64(InstArithmetic::OpKind Op, Operand *Src0Lo, Operand *Src0Hi, 720 void lowerShift64(InstArithmetic::OpKind Op, Operand *Src0Lo, Operand *Src0Hi,
721 Operand *Src1Lo, Variable *DestLo, Variable *DestHi); 721 Operand *Src1Lo, Variable *DestLo, Variable *DestHi);
722 722
723 /// Emit the code for a combined compare and branch, or sets the destination 723 /// Emit the code for a combined compare and branch, or sets the destination
Jim Stichnoth 2015/11/11 14:05:20 Nit 1: "set" instead of "sets". Nit 2: "if Br == n
sehr 2015/11/13 06:00:52 Doxygen is over my head :-). Done otherwise.
724 /// variable of the compare if branch is nullptr. 724 /// variable of the compare if branch is nullptr.
725 void lowerFcmpAndBr(const InstFcmp *Fcmp, const InstBr *Br);
726
727 /// Emit the code for a combined compare and branch, or sets the destination
728 /// variable of the compare if branch is nullptr.
725 void lowerIcmpAndBr(const InstIcmp *Icmp, const InstBr *Br); 729 void lowerIcmpAndBr(const InstIcmp *Icmp, const InstBr *Br);
726 730
727 /// Emit a setcc instruction if Br == nullptr; otherwise emit a branch. 731 /// Emit a setcc instruction if Br == nullptr; otherwise emit a branch.
728 void setccOrBr(typename Traits::Cond::BrCond Condition, Variable *Dest, 732 void setccOrBr(typename Traits::Cond::BrCond Condition, Variable *Dest,
729 const InstBr *Br); 733 const InstBr *Br);
730 734
731 /// Emit a mov [1|0] instruction if Br == nullptr; otherwise emit a branch. 735 /// Emit a mov [1|0] instruction if Br == nullptr; otherwise emit a branch.
732 void movOrBr(bool IcmpResult, Variable *Dest, const InstBr *Br); 736 void movOrBr(bool IcmpResult, Variable *Dest, const InstBr *Br);
733 737
738 /// Emit the code for a combined arithmetic instruction and branch.
739 void lowerArithAndBr(const InstArithmetic *Arith, const InstBr *Br);
740
734 /// Complains loudly if invoked because the cpu can handle 64-bit types 741 /// Complains loudly if invoked because the cpu can handle 64-bit types
735 /// natively. 742 /// natively.
736 template <typename T = Traits> 743 template <typename T = Traits>
737 typename std::enable_if<T::Is64Bit, void>::type lowerIcmp64(const InstIcmp *, 744 typename std::enable_if<T::Is64Bit, void>::type lowerIcmp64(const InstIcmp *,
738 const InstBr *) { 745 const InstBr *) {
739 llvm::report_fatal_error( 746 llvm::report_fatal_error(
740 "Hey, yo! This is x86-64. Watcha doin'? (lowerIcmp64)"); 747 "Hey, yo! This is x86-64. Watcha doin'? (lowerIcmp64)");
741 } 748 }
742 /// x86lowerIcmp64 handles 64-bit icmp lowering. 749 /// x86lowerIcmp64 handles 64-bit icmp lowering.
743 template <typename T = Traits> 750 template <typename T = Traits>
744 typename std::enable_if<!T::Is64Bit, void>::type 751 typename std::enable_if<!T::Is64Bit, void>::type
745 lowerIcmp64(const InstIcmp *Icmp, const InstBr *Br); 752 lowerIcmp64(const InstIcmp *Icmp, const InstBr *Br);
746 753
747 BoolFolding FoldingInfo; 754 BoolFolding FoldingInfo;
748 }; 755 };
749 } // end of namespace X86Internal 756 } // end of namespace X86Internal
750 } // end of namespace Ice 757 } // end of namespace Ice
751 758
752 #include "IceTargetLoweringX86BaseImpl.h" 759 #include "IceTargetLoweringX86BaseImpl.h"
753 760
754 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 761 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLoweringX86BaseImpl.h » ('j') | src/IceTargetLoweringX86BaseImpl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698