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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1257283004: Iasm and obj lowering for advanced switch lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 4 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 | « src/IceTargetLoweringX8664.cpp ('k') | 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 /// Naive lowering of cmpxchg. 151 /// Naive lowering of cmpxchg.
152 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, 152 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected,
153 Operand *Desired); 153 Operand *Desired);
154 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized. 154 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized.
155 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr, 155 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr,
156 Operand *Expected, Operand *Desired); 156 Operand *Expected, Operand *Desired);
157 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, 157 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr,
158 Operand *Val); 158 Operand *Val);
159 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, 159 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal,
160 Operand *SecondVal); 160 Operand *SecondVal);
161 /// Lower an indirect jump adding sandboxing when needed.
162 void lowerIndirectJump(Variable *Target);
161 163
162 /// Check the comparison is in [Min,Max]. The flags register will be modified 164 /// Check the comparison is in [Min,Max]. The flags register will be modified
163 /// with: 165 /// with:
164 /// - below equal, if in range 166 /// - below equal, if in range
165 /// - above, set if not in range 167 /// - above, set if not in range
166 /// The index into the range is returned. 168 /// The index into the range is returned.
167 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max); 169 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max);
168 /// Lowering of a cluster of switch cases. If the case is not matched control 170 /// Lowering of a cluster of switch cases. If the case is not matched control
169 /// will pass to the default label provided. If the default label is nullptr 171 /// will pass to the default label provided. If the default label is nullptr
170 /// then control will fall through to the next instruction. DoneCmp should be 172 /// then control will fall through to the next instruction. DoneCmp should be
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 Context.insert(Traits::Insts::And::create(Func, Dest, Src0)); 261 Context.insert(Traits::Insts::And::create(Func, Dest, Src0));
260 } 262 }
261 void _and_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) { 263 void _and_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) {
262 Context.insert(Traits::Insts::AndRMW::create(Func, DestSrc0, Src1)); 264 Context.insert(Traits::Insts::AndRMW::create(Func, DestSrc0, Src1));
263 } 265 }
264 void _blendvps(Variable *Dest, Operand *Src0, Operand *Src1) { 266 void _blendvps(Variable *Dest, Operand *Src0, Operand *Src1) {
265 Context.insert(Traits::Insts::Blendvps::create(Func, Dest, Src0, Src1)); 267 Context.insert(Traits::Insts::Blendvps::create(Func, Dest, Src0, Src1));
266 } 268 }
267 void _br(typename Traits::Cond::BrCond Condition, CfgNode *TargetTrue, 269 void _br(typename Traits::Cond::BrCond Condition, CfgNode *TargetTrue,
268 CfgNode *TargetFalse) { 270 CfgNode *TargetFalse) {
269 Context.insert( 271 Context.insert(Traits::Insts::Br::create(
270 Traits::Insts::Br::create(Func, TargetTrue, TargetFalse, Condition)); 272 Func, TargetTrue, TargetFalse, Condition, Traits::Insts::Br::Far));
271 } 273 }
272 void _br(CfgNode *Target) { 274 void _br(CfgNode *Target) {
273 Context.insert(Traits::Insts::Br::create(Func, Target)); 275 Context.insert(
276 Traits::Insts::Br::create(Func, Target, Traits::Insts::Br::Far));
274 } 277 }
275 void _br(typename Traits::Cond::BrCond Condition, CfgNode *Target) { 278 void _br(typename Traits::Cond::BrCond Condition, CfgNode *Target) {
276 Context.insert(Traits::Insts::Br::create(Func, Target, Condition)); 279 Context.insert(Traits::Insts::Br::create(Func, Target, Condition,
280 Traits::Insts::Br::Far));
277 } 281 }
278 void _br(typename Traits::Cond::BrCond Condition, 282 void _br(typename Traits::Cond::BrCond Condition,
279 typename Traits::Insts::Label *Label) { 283 typename Traits::Insts::Label *Label,
280 Context.insert(Traits::Insts::Br::create(Func, Label, Condition)); 284 typename Traits::Insts::Br::Mode Kind = Traits::Insts::Br::Near) {
285 Context.insert(Traits::Insts::Br::create(Func, Label, Condition, Kind));
281 } 286 }
282 void _bsf(Variable *Dest, Operand *Src0) { 287 void _bsf(Variable *Dest, Operand *Src0) {
283 Context.insert(Traits::Insts::Bsf::create(Func, Dest, Src0)); 288 Context.insert(Traits::Insts::Bsf::create(Func, Dest, Src0));
284 } 289 }
285 void _bsr(Variable *Dest, Operand *Src0) { 290 void _bsr(Variable *Dest, Operand *Src0) {
286 Context.insert(Traits::Insts::Bsr::create(Func, Dest, Src0)); 291 Context.insert(Traits::Insts::Bsr::create(Func, Dest, Src0));
287 } 292 }
288 void _bswap(Variable *SrcDest) { 293 void _bswap(Variable *SrcDest) {
289 Context.insert(Traits::Insts::Bswap::create(Func, SrcDest)); 294 Context.insert(Traits::Insts::Bswap::create(Func, SrcDest));
290 } 295 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 } 608 }
604 609
605 BoolFolding FoldingInfo; 610 BoolFolding FoldingInfo;
606 }; 611 };
607 } // end of namespace X86Internal 612 } // end of namespace X86Internal
608 } // end of namespace Ice 613 } // end of namespace Ice
609 614
610 #include "IceTargetLoweringX86BaseImpl.h" 615 #include "IceTargetLoweringX86BaseImpl.h"
611 616
612 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 617 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8664.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698