]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Plumb through memalign16() rather than having four implementations of the same code...
authorRhys Kidd <rhyskidd@gmail.com>
Sat, 15 Aug 2015 08:55:14 +0000 (08:55 +0000)
committerRhys Kidd <rhyskidd@gmail.com>
Sat, 15 Aug 2015 08:55:14 +0000 (08:55 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15548

none/tests/amd64/sse4-64.c
none/tests/arm64/fp_and_simd.c
none/tests/arm64/memory.c

index 46e0cdcfd46e971c4c5b4e2a3de93e51345d5595..662dd52001f00b20036ae6466d692ffd4788a732 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
-//#include "tests/malloc.h" // reenable when reintegrated
+#include "tests/malloc.h"
 #include <string.h>
 
 
-
-// rmme when reintegrated
-// Allocates a 16-aligned block.  Asserts if the allocation fails.
-#ifdef VGO_darwin
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#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;
index fb0c7e6d007a3bea5fb9ac0e9e98ce76d42f2251..6928bb1d045d58a9a778a8e3883d8e5032d89278 100644 (file)
@@ -3,6 +3,7 @@
 #include <assert.h>
 #include <malloc.h>  // memalign
 #include <string.h>  // memset
+#include "tests/malloc.h"
 #include <math.h>    // 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;
index 1b3eb402f10959a8ba756bbf8a4fc31592b5aead..b1722605897ea805e17faa163ad3b45ec3c91707 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <malloc.h>  // memalign
 #include <string.h>  // memset
+#include "tests/malloc.h"
 #include <assert.h>
 
 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;