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

Side by Side Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 2217983003: Subzero: Use the memset inline threshold for memset. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 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/IceTargetLoweringX8664Traits.h ('k') | no next file » | 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/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.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 4997 matching lines...) Expand 10 before | Expand all | Expand 10 after
5008 _store(Ctx->getConstantInt(Ty, SpreadValue), Mem); 5008 _store(Ctx->getConstantInt(Ty, SpreadValue), Mem);
5009 } 5009 }
5010 }; 5010 };
5011 5011
5012 // Find the largest type that can be used and use it as much as possible in 5012 // Find the largest type that can be used and use it as much as possible in
5013 // reverse order. Then handle any remainder with overlapping copies. Since 5013 // reverse order. Then handle any remainder with overlapping copies. Since
5014 // the remainder will be at the end, there will be reduces pressure on the 5014 // the remainder will be at the end, there will be reduces pressure on the
5015 // memory unit as the access to the same memory are far apart. 5015 // memory unit as the access to the same memory are far apart.
5016 Type Ty; 5016 Type Ty;
5017 if (ValValue == 0 && CountValue >= BytesPerStoreq && 5017 if (ValValue == 0 && CountValue >= BytesPerStoreq &&
5018 CountValue <= BytesPerStorep * Traits::MEMCPY_UNROLL_LIMIT) { 5018 CountValue <= BytesPerStorep * Traits::MEMSET_UNROLL_LIMIT) {
5019 // When the value is zero it can be loaded into a vector register cheaply 5019 // When the value is zero it can be loaded into a vector register cheaply
5020 // using the xor trick. 5020 // using the xor trick.
5021 Base = legalizeToReg(Dest); 5021 Base = legalizeToReg(Dest);
5022 VecReg = makeVectorOfZeros(IceType_v16i8); 5022 VecReg = makeVectorOfZeros(IceType_v16i8);
5023 Ty = largestTypeInSize(CountValue); 5023 Ty = largestTypeInSize(CountValue);
5024 } else if (CountValue <= BytesPerStorei32 * Traits::MEMCPY_UNROLL_LIMIT) { 5024 } else if (CountValue <= BytesPerStorei32 * Traits::MEMSET_UNROLL_LIMIT) {
5025 // When the value is non-zero or the count is small we can't use vector 5025 // When the value is non-zero or the count is small we can't use vector
5026 // instructions so are limited to 32-bit stores. 5026 // instructions so are limited to 32-bit stores.
5027 Base = legalizeToReg(Dest); 5027 Base = legalizeToReg(Dest);
5028 constexpr uint32_t MaxSize = 4; 5028 constexpr uint32_t MaxSize = 4;
5029 Ty = largestTypeInSize(CountValue, MaxSize); 5029 Ty = largestTypeInSize(CountValue, MaxSize);
5030 } 5030 }
5031 5031
5032 if (Base) { 5032 if (Base) {
5033 uint32_t TyWidth = typeWidthInBytes(Ty); 5033 uint32_t TyWidth = typeWidthInBytes(Ty);
5034 5034
(...skipping 3055 matching lines...) Expand 10 before | Expand all | Expand 10 after
8090 emitGlobal(*Var, SectionSuffix); 8090 emitGlobal(*Var, SectionSuffix);
8091 } 8091 }
8092 } 8092 }
8093 } break; 8093 } break;
8094 } 8094 }
8095 } 8095 }
8096 } // end of namespace X86NAMESPACE 8096 } // end of namespace X86NAMESPACE
8097 } // end of namespace Ice 8097 } // end of namespace Ice
8098 8098
8099 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H 8099 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8664Traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698