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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1407143002: Merge compares and branches (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 2 months 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') | no next file with comments »
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 void postLower() override; 144 void postLower() override;
145 145
146 void lowerAlloca(const InstAlloca *Inst) override; 146 void lowerAlloca(const InstAlloca *Inst) override;
147 void lowerArithmetic(const InstArithmetic *Inst) override; 147 void lowerArithmetic(const InstArithmetic *Inst) override;
148 void lowerAssign(const InstAssign *Inst) override; 148 void lowerAssign(const InstAssign *Inst) override;
149 void lowerBr(const InstBr *Inst) override; 149 void lowerBr(const InstBr *Inst) override;
150 void lowerCast(const InstCast *Inst) override; 150 void lowerCast(const InstCast *Inst) override;
151 void lowerExtractElement(const InstExtractElement *Inst) override; 151 void lowerExtractElement(const InstExtractElement *Inst) override;
152 void lowerFcmp(const InstFcmp *Inst) override; 152 void lowerFcmp(const InstFcmp *Inst) override;
153 void lowerIcmp(const InstIcmp *Inst) override; 153 void lowerIcmp(const InstIcmp *Inst) override;
154 /// Complains loudly if invoked because the cpu can handle 64-bit types
155 /// natively.
156 template <typename T = Traits>
157 typename std::enable_if<T::Is64Bit, void>::type
158 lowerIcmp64(const InstIcmp *) {
159 llvm::report_fatal_error(
160 "Hey, yo! This is x86-64. Watcha doin'? (lowerIcmp64)");
161 }
162 /// x86lowerIcmp64 handles 64-bit icmp lowering.
163 template <typename T = Traits>
164 typename std::enable_if<!T::Is64Bit, void>::type
165 lowerIcmp64(const InstIcmp *Inst);
166 154
167 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; 155 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override;
168 void lowerInsertElement(const InstInsertElement *Inst) override; 156 void lowerInsertElement(const InstInsertElement *Inst) override;
169 void lowerLoad(const InstLoad *Inst) override; 157 void lowerLoad(const InstLoad *Inst) override;
170 void lowerPhi(const InstPhi *Inst) override; 158 void lowerPhi(const InstPhi *Inst) override;
171 void lowerSelect(const InstSelect *Inst) override; 159 void lowerSelect(const InstSelect *Inst) override;
172 void lowerStore(const InstStore *Inst) override; 160 void lowerStore(const InstStore *Inst) override;
173 void lowerSwitch(const InstSwitch *Inst) override; 161 void lowerSwitch(const InstSwitch *Inst) override;
174 void lowerUnreachable(const InstUnreachable *Inst) override; 162 void lowerUnreachable(const InstUnreachable *Inst) override;
175 void lowerOther(const Inst *Instr) override; 163 void lowerOther(const Inst *Instr) override;
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 } 703 }
716 704
717 template <typename... Args> 705 template <typename... Args>
718 void dispatchToConcrete(void (Machine::*Method)(Args...), Args &&... args) { 706 void dispatchToConcrete(void (Machine::*Method)(Args...), Args &&... args) {
719 (static_cast<Machine *>(this)->*Method)(std::forward<Args>(args)...); 707 (static_cast<Machine *>(this)->*Method)(std::forward<Args>(args)...);
720 } 708 }
721 709
722 void lowerShift64(InstArithmetic::OpKind Op, Operand *Src0Lo, Operand *Src0Hi, 710 void lowerShift64(InstArithmetic::OpKind Op, Operand *Src0Lo, Operand *Src0Hi,
723 Operand *Src1Lo, Variable *DestLo, Variable *DestHi); 711 Operand *Src1Lo, Variable *DestLo, Variable *DestHi);
724 712
713 /// Emit the code for a combined compare and branch, or sets the destination
714 /// variable of the compare if branch is nullptr.
715 void lowerIcmpAndBr(const InstIcmp *Icmp, const InstBr *Br);
716
717 /// Emit a setcc instruction if Br == nullptr; otherwise emit a branch.
718 void setccOrBr(typename Traits::Cond::BrCond Condition, Variable *Dest,
719 const InstBr *Br);
720
721 /// Emit a mov [1|0] instruction if Br == nullptr; otherwise emit a branch.
722 void movOrBr(bool IcmpResult, Variable *Dest, const InstBr *Br);
723
724 /// Complains loudly if invoked because the cpu can handle 64-bit types
725 /// natively.
726 template <typename T = Traits>
727 typename std::enable_if<T::Is64Bit, void>::type lowerIcmp64(const InstIcmp *,
728 const InstBr *) {
729 llvm::report_fatal_error(
730 "Hey, yo! This is x86-64. Watcha doin'? (lowerIcmp64)");
731 }
732 /// x86lowerIcmp64 handles 64-bit icmp lowering.
733 template <typename T = Traits>
734 typename std::enable_if<!T::Is64Bit, void>::type
735 lowerIcmp64(const InstIcmp *Icmp, const InstBr *Br);
736
725 BoolFolding FoldingInfo; 737 BoolFolding FoldingInfo;
726 }; 738 };
727 } // end of namespace X86Internal 739 } // end of namespace X86Internal
728 } // end of namespace Ice 740 } // end of namespace Ice
729 741
730 #include "IceTargetLoweringX86BaseImpl.h" 742 #include "IceTargetLoweringX86BaseImpl.h"
731 743
732 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 744 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698