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

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: Fix sandboxing and linking 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
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 /// Naive lowering of cmpxchg. 153 /// Naive lowering of cmpxchg.
154 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, 154 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected,
155 Operand *Desired); 155 Operand *Desired);
156 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized. 156 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized.
157 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr, 157 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr,
158 Operand *Expected, Operand *Desired); 158 Operand *Expected, Operand *Desired);
159 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, 159 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr,
160 Operand *Val); 160 Operand *Val);
161 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, 161 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal,
162 Operand *SecondVal); 162 Operand *SecondVal);
163 /// Lower and indirect jump adding sandboxing when needed.
jvoung (off chromium) 2015/07/29 21:31:17 "Lower an indirect" ?
ascull 2015/07/29 22:43:04 Done.
164 void lowerIndirectJump(Variable *Target);
163 165
164 /// Check the comparison is in [Min,Max]. The flags register will be modified 166 /// Check the comparison is in [Min,Max]. The flags register will be modified
165 /// with: 167 /// with:
166 /// - below equal, if in range 168 /// - below equal, if in range
167 /// - above, set if not in range 169 /// - above, set if not in range
168 /// The index into the range is returned. 170 /// The index into the range is returned.
169 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max); 171 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max);
170 /// Lowering of a cluster of switch cases. If the case is not matched control 172 /// Lowering of a cluster of switch cases. If the case is not matched control
171 /// will pass to the default label provided. If the default label is nullptr 173 /// will pass to the default label provided. If the default label is nullptr
172 /// then control will fall through to the next instruction. DoneCmp should be 174 /// then control will fall through to the next instruction. DoneCmp should be
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 Context.insert(Traits::Insts::And::create(Func, Dest, Src0)); 263 Context.insert(Traits::Insts::And::create(Func, Dest, Src0));
262 } 264 }
263 void _and_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) { 265 void _and_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) {
264 Context.insert(Traits::Insts::AndRMW::create(Func, DestSrc0, Src1)); 266 Context.insert(Traits::Insts::AndRMW::create(Func, DestSrc0, Src1));
265 } 267 }
266 void _blendvps(Variable *Dest, Operand *Src0, Operand *Src1) { 268 void _blendvps(Variable *Dest, Operand *Src0, Operand *Src1) {
267 Context.insert(Traits::Insts::Blendvps::create(Func, Dest, Src0, Src1)); 269 Context.insert(Traits::Insts::Blendvps::create(Func, Dest, Src0, Src1));
268 } 270 }
269 void _br(typename Traits::Cond::BrCond Condition, CfgNode *TargetTrue, 271 void _br(typename Traits::Cond::BrCond Condition, CfgNode *TargetTrue,
270 CfgNode *TargetFalse) { 272 CfgNode *TargetFalse) {
271 Context.insert( 273 Context.insert(Traits::Insts::Br::create(
272 Traits::Insts::Br::create(Func, TargetTrue, TargetFalse, Condition)); 274 Func, TargetTrue, TargetFalse, Condition, Traits::Insts::Br::Far));
273 } 275 }
274 void _br(CfgNode *Target) { 276 void _br(CfgNode *Target) {
275 Context.insert(Traits::Insts::Br::create(Func, Target)); 277 Context.insert(
278 Traits::Insts::Br::create(Func, Target, Traits::Insts::Br::Far));
276 } 279 }
277 void _br(typename Traits::Cond::BrCond Condition, CfgNode *Target) { 280 void _br(typename Traits::Cond::BrCond Condition, CfgNode *Target) {
278 Context.insert(Traits::Insts::Br::create(Func, Target, Condition)); 281 Context.insert(Traits::Insts::Br::create(Func, Target, Condition,
282 Traits::Insts::Br::Far));
279 } 283 }
280 void _br(typename Traits::Cond::BrCond Condition, 284 void _br(typename Traits::Cond::BrCond Condition,
281 typename Traits::Insts::Label *Label) { 285 typename Traits::Insts::Label *Label,
282 Context.insert(Traits::Insts::Br::create(Func, Label, Condition)); 286 typename Traits::Insts::Br::BrKind Kind = Traits::Insts::Br::Near) {
287 Context.insert(Traits::Insts::Br::create(Func, Label, Condition, Kind));
283 } 288 }
284 void _bsf(Variable *Dest, Operand *Src0) { 289 void _bsf(Variable *Dest, Operand *Src0) {
285 Context.insert(Traits::Insts::Bsf::create(Func, Dest, Src0)); 290 Context.insert(Traits::Insts::Bsf::create(Func, Dest, Src0));
286 } 291 }
287 void _bsr(Variable *Dest, Operand *Src0) { 292 void _bsr(Variable *Dest, Operand *Src0) {
288 Context.insert(Traits::Insts::Bsr::create(Func, Dest, Src0)); 293 Context.insert(Traits::Insts::Bsr::create(Func, Dest, Src0));
289 } 294 }
290 void _bswap(Variable *SrcDest) { 295 void _bswap(Variable *SrcDest) {
291 Context.insert(Traits::Insts::Bswap::create(Func, SrcDest)); 296 Context.insert(Traits::Insts::Bswap::create(Func, SrcDest));
292 } 297 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 } 610 }
606 611
607 BoolFolding FoldingInfo; 612 BoolFolding FoldingInfo;
608 }; 613 };
609 } // end of namespace X86Internal 614 } // end of namespace X86Internal
610 } // end of namespace Ice 615 } // end of namespace Ice
611 616
612 #include "IceTargetLoweringX86BaseImpl.h" 617 #include "IceTargetLoweringX86BaseImpl.h"
613 618
614 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 619 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698