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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/IceTargetLoweringX86Base.h
diff --git a/src/IceTargetLoweringX86Base.h b/src/IceTargetLoweringX86Base.h
index 342c97b2da5d2d7bb574a2793cf7b916f2b5a104..2c4c7bff7c6808cb13bed266e1b4f7e2aaf3ce66 100644
--- a/src/IceTargetLoweringX86Base.h
+++ b/src/IceTargetLoweringX86Base.h
@@ -153,9 +153,18 @@ protected:
Operand *Val);
void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal,
Operand *SecondVal);
- /// Replace a call to memcpy with inline instructions.
+ /// If Overflow is false, find the largest type whose width is less than or
+ /// equal to Size. If Overflow is true, find the smallest type whose width can
+ /// be larger than Size. The maximum width can be limited to LimitWidth bytes.
+ 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.
+ uint32_t LimitWidth = 0);
+ /// 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.
+ void lowerCopyMem(Type Ty, Variable *Dest, Variable *Src, uint32_t OffsetAmt);
+ /// Replace some calls to memcpy with inline instructions.
void lowerMemcpy(Operand *Dest, Operand *Src, Operand *Count);
- /// Replace a call to memset with inline instructions.
+ /// Replace some calls to memmove with inline instructions.
+ void lowerMemmove(Operand *Dest, Operand *Src, Operand *Count);
+ /// Replace some calls to memset with inline instructions.
void lowerMemset(Operand *Dest, Operand *Val, Operand *Count);
/// Lower an indirect jump adding sandboxing when needed.

Powered by Google App Engine
This is Rietveld 408576698