]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
VG_(bzero_inline): handle up to 12 words inline.
authorJulian Seward <jseward@acm.org>
Mon, 13 Jan 2014 00:17:54 +0000 (00:17 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 13 Jan 2014 00:17:54 +0000 (00:17 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13772

include/pub_tool_libcbase.h

index 0aea3ace739256d73aef86a5b9858dc4f8f8e2b7..fcc0ed1164b780695272b344a6440308584ea4be 100644 (file)
@@ -124,7 +124,7 @@ extern void* VG_(memmove)( void *d, const void *s, SizeT sz );
 extern void* VG_(memset) ( void *s, Int c, SizeT sz );
 extern Int   VG_(memcmp) ( const void* s1, const void* s2, SizeT n );
 
-/* Zero out up to 8 words quickly in-line.  Do not use this for blocks
+/* Zero out up to 12 words quickly in-line.  Do not use this for blocks
    of size which are unknown at compile time, since the whole point is
    for it to be inlined, and then for gcc to remove all code except
    for the relevant 'sz' case. */
@@ -135,6 +135,18 @@ static void VG_(bzero_inline) ( void* s, SizeT sz )
        && LIKELY(0 == (((Addr)s) & (Addr)(sizeof(UWord)-1)))) {
       UWord* p = (UWord*)s;
       switch (sz / (SizeT)sizeof(UWord)) {
+          case 12: p[0] = p[1] = p[2] = p[3]
+                  = p[4] = p[5] = p[6] = p[7] 
+                  = p[8] = p[9] = p[10] = p[11] = 0UL; return;
+          case 11: p[0] = p[1] = p[2] = p[3]
+                  = p[4] = p[5] = p[6] = p[7] 
+                  = p[8] = p[9] = p[10] = 0UL; return;
+          case 10: p[0] = p[1] = p[2] = p[3]
+                  = p[4] = p[5] = p[6] = p[7] 
+                  = p[8] = p[9] = 0UL; return;
+          case 9: p[0] = p[1] = p[2] = p[3]
+                  = p[4] = p[5] = p[6] = p[7] 
+                  = p[8] = 0UL; return;
           case 8: p[0] = p[1] = p[2] = p[3]
                   = p[4] = p[5] = p[6] = p[7] = 0UL; return;
           case 7: p[0] = p[1] = p[2] = p[3]