From 7ef585e3bb164b02d7a6116b26456d8f97dd571c Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Mon, 21 Jan 2019 11:30:05 +0100 Subject: [PATCH] cleanup --- Makefile.am | 21 ++++++++++----------- libsharp/sharp_core.c | 6 ++---- libsharp/sharp_core_avx.c | 8 -------- libsharp/sharp_core_avx2.c | 8 -------- libsharp/sharp_core_avx512f.c | 8 -------- libsharp/sharp_core_fma.c | 8 -------- libsharp/sharp_core_fma4.c | 8 -------- libsharp/sharp_core_inc.c | 8 ++++++++ 8 files changed, 20 insertions(+), 55 deletions(-) delete mode 100644 libsharp/sharp_core_avx.c delete mode 100644 libsharp/sharp_core_avx2.c delete mode 100644 libsharp/sharp_core_avx512f.c delete mode 100644 libsharp/sharp_core_fma.c delete mode 100644 libsharp/sharp_core_fma4.c diff --git a/Makefile.am b/Makefile.am index a51f568..b0b09ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,11 +18,11 @@ libsharp_la_SOURCES = \ libsharp/sharp_vecsupport.h \ libsharp/sharp_ylmgen_c.h -libavx_la_SOURCES = libsharp/sharp_core_avx.c -libavx2_la_SOURCES = libsharp/sharp_core_avx2.c -libfma_la_SOURCES = libsharp/sharp_core_fma.c -libfma4_la_SOURCES = libsharp/sharp_core_fma4.c -libavx512f_la_SOURCES = libsharp/sharp_core_avx512f.c +libavx_la_SOURCES = libsharp/sharp_core_inc.c +libavx2_la_SOURCES = libsharp/sharp_core_inc.c +libfma_la_SOURCES = libsharp/sharp_core_inc.c +libfma4_la_SOURCES = libsharp/sharp_core_inc.c +libavx512f_la_SOURCES = libsharp/sharp_core_inc.c noinst_LTLIBRARIES = libavx.la libavx2.la libfma.la libfma4.la libavx512f.la @@ -35,7 +35,6 @@ include_HEADERS = \ libsharp/sharp_cxx.h EXTRA_DIST = \ - libsharp/sharp_core_inc.c \ runtest.sh check_PROGRAMS = sharp_testsuite @@ -46,11 +45,11 @@ TESTS = runtest.sh AM_CFLAGS = -I$(top_srcdir)/c_utils -I$(top_srcdir)/libsharp @AM_CFLAGS@ -libavx_la_CFLAGS = ${AM_CFLAGS} -mavx -libavx2_la_CFLAGS = ${AM_CFLAGS} -mavx2 -libfma_la_CFLAGS = ${AM_CFLAGS} -mfma -libfma4_la_CFLAGS = ${AM_CFLAGS} -mfma4 -libavx512f_la_CFLAGS = ${AM_CFLAGS} -mavx512f +libavx_la_CFLAGS = ${AM_CFLAGS} -mavx -DARCH=avx +libavx2_la_CFLAGS = ${AM_CFLAGS} -mavx2 -DARCH=avx2 +libfma_la_CFLAGS = ${AM_CFLAGS} -mfma -DARCH=fma +libfma4_la_CFLAGS = ${AM_CFLAGS} -mfma4 -DARCH=fma4 +libavx512f_la_CFLAGS = ${AM_CFLAGS} -mavx512f -DARCH=avx512f pkgconfigdir = $(libdir)/pkgconfig nodist_pkgconfig_DATA = @PACKAGE_NAME@.pc diff --git a/libsharp/sharp_core.c b/libsharp/sharp_core.c index e4c1059..6cfb694 100644 --- a/libsharp/sharp_core.c +++ b/libsharp/sharp_core.c @@ -1,9 +1,7 @@ -#define XCONCATX(a,b) a##_##b -#define XCONCATX2(a,b) XCONCATX(a,b) -#define XARCH(a) XCONCATX2(a,ARCH) - #define ARCH default +#define GENERIC_ARCH #include "sharp_core_inc.c" +#undef GENERIC_ARCH #undef ARCH typedef void (*t_inner_loop) (sharp_job *job, const int *ispair, diff --git a/libsharp/sharp_core_avx.c b/libsharp/sharp_core_avx.c deleted file mode 100644 index 053dfba..0000000 --- a/libsharp/sharp_core_avx.c +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef MULTIARCH -#define XCONCATX(a,b) a##_##b -#define XCONCATX2(a,b) XCONCATX(a,b) -#define XARCH(a) XCONCATX2(a,ARCH) - -#define ARCH avx -#include "sharp_core_inc.c" -#endif diff --git a/libsharp/sharp_core_avx2.c b/libsharp/sharp_core_avx2.c deleted file mode 100644 index ca0a3b9..0000000 --- a/libsharp/sharp_core_avx2.c +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef MULTIARCH -#define XCONCATX(a,b) a##_##b -#define XCONCATX2(a,b) XCONCATX(a,b) -#define XARCH(a) XCONCATX2(a,ARCH) - -#define ARCH avx2 -#include "sharp_core_inc.c" -#endif diff --git a/libsharp/sharp_core_avx512f.c b/libsharp/sharp_core_avx512f.c deleted file mode 100644 index 5781e3c..0000000 --- a/libsharp/sharp_core_avx512f.c +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef MULTIARCH -#define XCONCATX(a,b) a##_##b -#define XCONCATX2(a,b) XCONCATX(a,b) -#define XARCH(a) XCONCATX2(a,ARCH) - -#define ARCH avx512f -#include "sharp_core_inc.c" -#endif diff --git a/libsharp/sharp_core_fma.c b/libsharp/sharp_core_fma.c deleted file mode 100644 index bb0af2c..0000000 --- a/libsharp/sharp_core_fma.c +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef MULTIARCH -#define XCONCATX(a,b) a##_##b -#define XCONCATX2(a,b) XCONCATX(a,b) -#define XARCH(a) XCONCATX2(a,ARCH) - -#define ARCH fma -#include "sharp_core_inc.c" -#endif diff --git a/libsharp/sharp_core_fma4.c b/libsharp/sharp_core_fma4.c deleted file mode 100644 index 9b7f67b..0000000 --- a/libsharp/sharp_core_fma4.c +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef MULTIARCH -#define XCONCATX(a,b) a##_##b -#define XCONCATX2(a,b) XCONCATX(a,b) -#define XARCH(a) XCONCATX2(a,ARCH) - -#define ARCH fma4 -#include "sharp_core_inc.c" -#endif diff --git a/libsharp/sharp_core_inc.c b/libsharp/sharp_core_inc.c index d229a49..96981f6 100644 --- a/libsharp/sharp_core_inc.c +++ b/libsharp/sharp_core_inc.c @@ -29,6 +29,12 @@ * \author Martin Reinecke */ +#if (defined(MULTIARCH) || defined(GENERIC_ARCH)) + +#define XCONCATX(a,b) a##_##b +#define XCONCATX2(a,b) XCONCATX(a,b) +#define XARCH(a) XCONCATX2(a,ARCH) + #include #include #include @@ -1179,3 +1185,5 @@ const char *XARCH(sharp_architecture)(void) { return xstr(ARCH); } + +#endif