From: Julian Seward Date: Mon, 4 Apr 2016 12:33:35 +0000 (+0000) Subject: memset replacement: unroll vectorised loops. X-Git-Tag: svn/VALGRIND_3_12_0~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32d0fc4be52cb7029f7359d516c881e3229ba4fc;p=thirdparty%2Fvalgrind.git memset replacement: unroll vectorised loops. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15848 --- diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c index 8de085a57b..f3be419421 100644 --- a/shared/vg_replace_strmem.c +++ b/shared/vg_replace_strmem.c @@ -1200,6 +1200,11 @@ static inline void my_exit ( int x ) 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 @@ static inline void my_exit ( int x ) 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) \