|
From: <sv...@va...> - 2015-08-15 08:55:22
|
Author: rhyskidd
Date: Sat Aug 15 09:55:14 2015
New Revision: 15548
Log:
Plumb through memalign16() rather than having four implementations of the same code. n-i-bz.
Modified:
trunk/none/tests/amd64/sse4-64.c
trunk/none/tests/arm64/fp_and_simd.c
trunk/none/tests/arm64/memory.c
Modified: trunk/none/tests/amd64/sse4-64.c
==============================================================================
--- trunk/none/tests/amd64/sse4-64.c (original)
+++ trunk/none/tests/amd64/sse4-64.c Sat Aug 15 09:55:14 2015
@@ -12,35 +12,10 @@
#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;
Modified: trunk/none/tests/arm64/fp_and_simd.c
==============================================================================
--- trunk/none/tests/arm64/fp_and_simd.c (original)
+++ trunk/none/tests/arm64/fp_and_simd.c Sat Aug 15 09:55:14 2015
@@ -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 @@
}
}
-__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;
Modified: trunk/none/tests/arm64/memory.c
==============================================================================
--- trunk/none/tests/arm64/memory.c (original)
+++ trunk/none/tests/arm64/memory.c Sat Aug 15 09:55:14 2015
@@ -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 @@
#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;
|