|
From: <sv...@va...> - 2016-04-04 12:33:44
|
Author: sewardj
Date: Mon Apr 4 13:33:35 2016
New Revision: 15848
Log:
memset replacement: unroll vectorised loops.
Modified:
trunk/shared/vg_replace_strmem.c
Modified: trunk/shared/vg_replace_strmem.c
==============================================================================
--- trunk/shared/vg_replace_strmem.c (original)
+++ trunk/shared/vg_replace_strmem.c Mon Apr 4 13:33:35 2016
@@ -1200,6 +1200,11 @@
c8 = (c8 << 32) | c8; \
while ((a & 7) != 0 && n >= 1) \
{ *(UChar*)a = (UChar)c; a += 1; n -= 1; } \
+ while (n >= 32) \
+ { *(ULong*)a = c8; a += 8; n -= 8; \
+ *(ULong*)a = c8; a += 8; n -= 8; \
+ *(ULong*)a = c8; a += 8; n -= 8; \
+ *(ULong*)a = c8; a += 8; n -= 8; } \
while (n >= 8) \
{ *(ULong*)a = c8; a += 8; n -= 8; } \
while (n >= 1) \
@@ -1212,6 +1217,11 @@
c4 = (c4 << 16) | c4; \
while ((a & 3) != 0 && n >= 1) \
{ *(UChar*)a = (UChar)c; a += 1; n -= 1; } \
+ while (n >= 16) \
+ { *(UInt*)a = c4; a += 4; n -= 4; \
+ *(UInt*)a = c4; a += 4; n -= 4; \
+ *(UInt*)a = c4; a += 4; n -= 4; \
+ *(UInt*)a = c4; a += 4; n -= 4; } \
while (n >= 4) \
{ *(UInt*)a = c4; a += 4; n -= 4; } \
while (n >= 1) \
|