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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1278173009: Inline memove for small constant sizes and refactor memcpy and memset. (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
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 /// Naive lowering of cmpxchg. 146 /// Naive lowering of cmpxchg.
147 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, 147 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected,
148 Operand *Desired); 148 Operand *Desired);
149 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized. 149 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized.
150 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr, 150 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr,
151 Operand *Expected, Operand *Desired); 151 Operand *Expected, Operand *Desired);
152 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, 152 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr,
153 Operand *Val); 153 Operand *Val);
154 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, 154 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal,
155 Operand *SecondVal); 155 Operand *SecondVal);
156 /// Replace a call to memcpy with inline instructions. 156 /// If Overflow is false, find the largest type whose width is less than or
157 /// equal to Size. If Overflow is true, find the smallest type whose width can
158 /// be larger than Size. The maximum width can be limited to LimitWidth bytes.
159 Type typeForSize(uint32_t Size, bool overflow = false,
John 2015/08/12 17:44:57 Can this method be made static? This comment tell
ascull 2015/08/17 22:18:52 Done.
160 uint32_t LimitWidth = 0);
161 /// Copy memory of given type from Src to Dest using OffsetAmt on both.
John 2015/08/12 17:44:57 the lower "prefix" threw me off here. I though the
ascull 2015/08/17 22:18:52 Done.
162 void lowerCopyMem(Type Ty, Variable *Dest, Variable *Src, uint32_t OffsetAmt);
163 /// Replace some calls to memcpy with inline instructions.
157 void lowerMemcpy(Operand *Dest, Operand *Src, Operand *Count); 164 void lowerMemcpy(Operand *Dest, Operand *Src, Operand *Count);
158 /// Replace a call to memset with inline instructions. 165 /// Replace some calls to memmove with inline instructions.
166 void lowerMemmove(Operand *Dest, Operand *Src, Operand *Count);
167 /// Replace some calls to memset with inline instructions.
159 void lowerMemset(Operand *Dest, Operand *Val, Operand *Count); 168 void lowerMemset(Operand *Dest, Operand *Val, Operand *Count);
160 169
161 /// Lower an indirect jump adding sandboxing when needed. 170 /// Lower an indirect jump adding sandboxing when needed.
162 void lowerIndirectJump(Variable *Target); 171 void lowerIndirectJump(Variable *Target);
163 172
164 /// Check the comparison is in [Min,Max]. The flags register will be modified 173 /// Check the comparison is in [Min,Max]. The flags register will be modified
165 /// with: 174 /// with:
166 /// - below equal, if in range 175 /// - below equal, if in range
167 /// - above, set if not in range 176 /// - above, set if not in range
168 /// The index into the range is returned. 177 /// The index into the range is returned.
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 664 }
656 665
657 BoolFolding FoldingInfo; 666 BoolFolding FoldingInfo;
658 }; 667 };
659 } // end of namespace X86Internal 668 } // end of namespace X86Internal
660 } // end of namespace Ice 669 } // end of namespace Ice
661 670
662 #include "IceTargetLoweringX86BaseImpl.h" 671 #include "IceTargetLoweringX86BaseImpl.h"
663 672
664 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 673 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698