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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1255053008: Inline memset when there is a constant value and count. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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/IceInstX86BaseImpl.h ('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 /// Replace a function call with inline instructions.
162 void lowerMemset(Operand *Dest, Operand *Val, Operand *Count);
163
161 /// Lower an indirect jump adding sandboxing when needed. 164 /// Lower an indirect jump adding sandboxing when needed.
162 void lowerIndirectJump(Variable *Target); 165 void lowerIndirectJump(Variable *Target);
163 166
164 /// Check the comparison is in [Min,Max]. The flags register will be modified 167 /// Check the comparison is in [Min,Max]. The flags register will be modified
165 /// with: 168 /// with:
166 /// - below equal, if in range 169 /// - below equal, if in range
167 /// - above, set if not in range 170 /// - above, set if not in range
168 /// The index into the range is returned. 171 /// The index into the range is returned.
169 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max); 172 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 173 /// Lowering of a cluster of switch cases. If the case is not matched control
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 /// used by a real load/store operation. Legalizes the operand as well. 210 /// used by a real load/store operation. Legalizes the operand as well.
208 /// This is a nop if the operand is already a legal memory operand. 211 /// This is a nop if the operand is already a legal memory operand.
209 typename Traits::X86OperandMem *formMemoryOperand(Operand *Ptr, Type Ty, 212 typename Traits::X86OperandMem *formMemoryOperand(Operand *Ptr, Type Ty,
210 bool DoLegalize = true); 213 bool DoLegalize = true);
211 214
212 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); 215 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister);
213 static Type stackSlotType(); 216 static Type stackSlotType();
214 217
215 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); 218 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister);
216 219
217 /// Returns a vector in a register with the given constant entries. 220 /// \name Returns a vector in a register with the given constant entries.
221 /// @{
218 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); 222 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister);
219 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); 223 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister);
220 Variable *makeVectorOfMinusOnes(Type Ty, 224 Variable *makeVectorOfMinusOnes(Type Ty,
221 int32_t RegNum = Variable::NoRegister); 225 int32_t RegNum = Variable::NoRegister);
222 Variable *makeVectorOfHighOrderBits(Type Ty, 226 Variable *makeVectorOfHighOrderBits(Type Ty,
223 int32_t RegNum = Variable::NoRegister); 227 int32_t RegNum = Variable::NoRegister);
224 Variable *makeVectorOfFabsMask(Type Ty, 228 Variable *makeVectorOfFabsMask(Type Ty,
225 int32_t RegNum = Variable::NoRegister); 229 int32_t RegNum = Variable::NoRegister);
230 /// @}
226 231
227 /// Return a memory operand corresponding to a stack allocated Variable. 232 /// Return a memory operand corresponding to a stack allocated Variable.
228 typename Traits::X86OperandMem * 233 typename Traits::X86OperandMem *
229 getMemoryOperandForStackSlot(Type Ty, Variable *Slot, uint32_t Offset = 0); 234 getMemoryOperandForStackSlot(Type Ty, Variable *Slot, uint32_t Offset = 0);
230 235
231 void makeRandomRegisterPermutation( 236 void makeRandomRegisterPermutation(
232 llvm::SmallVectorImpl<int32_t> &Permutation, 237 llvm::SmallVectorImpl<int32_t> &Permutation,
233 const llvm::SmallBitVector &ExcludeRegisters) const override; 238 const llvm::SmallBitVector &ExcludeRegisters) const override;
234 239
235 /// The following are helpers that insert lowered x86 instructions 240 /// The following are helpers that insert lowered x86 instructions
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 } 627 }
623 628
624 BoolFolding FoldingInfo; 629 BoolFolding FoldingInfo;
625 }; 630 };
626 } // end of namespace X86Internal 631 } // end of namespace X86Internal
627 } // end of namespace Ice 632 } // end of namespace Ice
628 633
629 #include "IceTargetLoweringX86BaseImpl.h" 634 #include "IceTargetLoweringX86BaseImpl.h"
630 635
631 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 636 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698