}
}
+ // Handle the non-SIMD remainder by overlapping with previously processed data if needed
if (size > 0)
{
+ assert(size <= REGSIZE_BYTES);
+
+ // Round up to the closest power of two, but make sure it's not larger
+ // than the register we used for the main loop
+ regSize = min(regSize, compiler->roundUpGPRSize(size));
+
unsigned shiftBack = regSize - size;
assert(shiftBack <= regSize);
dstOffset -= shiftBack;
}
}
+ // Handle the non-SIMD remainder by overlapping with previously processed data if needed
if (size > 0)
{
+ assert(size <= REGSIZE_BYTES);
+
+ // Round up to the closest power of two, but make sure it's not larger
+ // than the register we used for the main loop
+ regSize = min(regSize, compiler->roundUpGPRSize(size));
+
unsigned shiftBack = regSize - size;
assert(shiftBack <= regSize);
#endif // FEATURE_SIMD
public:
+ // Similar to roundUpSIMDSize, but for General Purpose Registers (GPR)
+ unsigned int roundUpGPRSize(unsigned size)
+ {
+ if (size > 4 && (REGSIZE_BYTES == 8))
+ {
+ return 8;
+ }
+ else if (size > 2)
+ {
+ return 4;
+ }
+ return size; // 2, 1, 0
+ }
+
enum UnrollKind
{
Memset,