From: Rhys Kidd Date: Sat, 15 Aug 2015 08:55:14 +0000 (+0000) Subject: Plumb through memalign16() rather than having four implementations of the same code... X-Git-Tag: svn/VALGRIND_3_11_0~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17aa7a30f6324b20dfd80807b1b4da85dbaf4d52;p=thirdparty%2Fvalgrind.git Plumb through memalign16() rather than having four implementations of the same code. n-i-bz. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15548 --- diff --git a/none/tests/amd64/sse4-64.c b/none/tests/amd64/sse4-64.c index 46e0cdcfd4..662dd52001 100644 --- a/none/tests/amd64/sse4-64.c +++ b/none/tests/amd64/sse4-64.c @@ -12,35 +12,10 @@ #include #include #include -//#include "tests/malloc.h" // reenable when reintegrated +#include "tests/malloc.h" #include - -// rmme when reintegrated -// Allocates a 16-aligned block. Asserts if the allocation fails. -#ifdef VGO_darwin -#include -#else -#include -#endif -__attribute__((unused)) -static void* memalign16(size_t szB) -{ - void* x; -#if defined(VGO_darwin) - // Darwin lacks memalign, but its malloc is always 16-aligned anyway. - x = malloc(szB); -#else - x = memalign(16, szB); -#endif - assert(x); - assert(0 == ((16-1) & (unsigned long)x)); - return x; -} - - - typedef unsigned char V128[16]; typedef unsigned int UInt; typedef signed int Int; diff --git a/none/tests/arm64/fp_and_simd.c b/none/tests/arm64/fp_and_simd.c index fb0c7e6d00..6928bb1d04 100644 --- a/none/tests/arm64/fp_and_simd.c +++ b/none/tests/arm64/fp_and_simd.c @@ -3,6 +3,7 @@ #include #include // memalign #include // memset +#include "tests/malloc.h" #include // isnormal typedef unsigned char UChar; @@ -92,16 +93,6 @@ static void showBlock ( const char* msg, V128* block, Int nBlock ) } } -__attribute__((unused)) -static void* memalign16(size_t szB) -{ - void* x; - x = memalign(16, szB); - assert(x); - assert(0 == ((16-1) & (unsigned long)x)); - return x; -} - static ULong dup4x16 ( UInt x ) { ULong r = x & 0xF; diff --git a/none/tests/arm64/memory.c b/none/tests/arm64/memory.c index 1b3eb402f1..b172260589 100644 --- a/none/tests/arm64/memory.c +++ b/none/tests/arm64/memory.c @@ -6,6 +6,7 @@ #include #include // memalign #include // memset +#include "tests/malloc.h" #include typedef unsigned char UChar; @@ -20,16 +21,6 @@ typedef unsigned char Bool; #define False ((Bool)0) #define True ((Bool)1) -__attribute__((noinline)) -static void* memalign16(size_t szB) -{ - void* x; - x = memalign(16, szB); - assert(x); - assert(0 == ((16-1) & (unsigned long)x)); - return x; -} - static inline UChar randUChar ( void ) { static UInt seed = 80021;