summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/x86_64/fpu/Makefile7
-rw-r--r--sysdeps/x86_64/fpu/svml_finite_alias.S3
-rw-r--r--sysdeps/x86_64/fpu/test-libmvec-alias-main.c56
-rw-r--r--sysdeps/x86_64/fpu/test-libmvec-alias.c101
4 files changed, 165 insertions, 2 deletions
diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile
index 88742faff1..807c208853 100644
--- a/sysdeps/x86_64/fpu/Makefile
+++ b/sysdeps/x86_64/fpu/Makefile
@@ -30,9 +30,11 @@ ifeq ($(subdir),math)
ifeq ($(build-mathvec),yes)
libmvec-tests += double-vlen2 double-vlen4 double-vlen4-avx2 \
float-vlen4 float-vlen8 float-vlen8-avx2
+libmvec-alias-tests = libmvec-alias
ifeq (yes,$(config-cflags-avx512))
libmvec-tests += double-vlen8 float-vlen16
+libmvec-alias-tests += libmvec-alias-avx512
endif
double-vlen4-arch-ext-cflags = -mavx
@@ -43,6 +45,11 @@ float-vlen8-arch-ext-cflags = -mavx
float-vlen8-arch-ext2-cflags = -mavx2
float-vlen16-arch-ext-cflags = -mavx512f
+CFLAGS-test-libmvec-alias.c = -fPIC -Wl,-shared $(double-vlen4-arch-ext2-cflags)
+LDFLAGS-test-libmvec-alias.so = -shared
+CFLAGS-test-libmvec-alias-avx512.c = -fPIC -Wl,-shared $(double-vlen8-arch-ext-cflags)
+LDFLAGS-test-libmvec-alias-avx512.so = -shared
+
CFLAGS-test-double-vlen4-avx2.c = $(libm-test-vec-cflags)
CFLAGS-test-double-vlen4-avx2-wrappers.c = $(double-vlen4-arch-ext2-cflags)
diff --git a/sysdeps/x86_64/fpu/svml_finite_alias.S b/sysdeps/x86_64/fpu/svml_finite_alias.S
index 0062fe49ff..8314cf4a9a 100644
--- a/sysdeps/x86_64/fpu/svml_finite_alias.S
+++ b/sysdeps/x86_64/fpu/svml_finite_alias.S
@@ -23,8 +23,7 @@
#define ALIAS_IMPL(alias, target) \
ENTRY (alias); \
- call target; \
- ret; \
+ jmp target@PLT; \
END (alias)
.text
diff --git a/sysdeps/x86_64/fpu/test-libmvec-alias-main.c b/sysdeps/x86_64/fpu/test-libmvec-alias-main.c
new file mode 100644
index 0000000000..acd465b0d7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-libmvec-alias-main.c
@@ -0,0 +1,56 @@
+
+extern double log_vlen2 (double);
+extern double exp_vlen2 (double);
+extern double pow_vlen2 (double, double);
+
+extern double log_vlen4 (double);
+extern double exp_vlen4 (double);
+extern double pow_vlen4 (double, double);
+
+extern double log_vlen4_avx2 (double);
+extern double exp_vlen4_avx2 (double);
+extern double pow_vlen4_avx2 (double, double);
+
+extern float logf_vlen4 (float);
+extern float expf_vlen4 (float);
+extern float powf_vlen4 (float, float);
+
+extern float logf_vlen8 (float);
+extern float expf_vlen8 (float);
+extern float powf_vlen8 (float, float);
+
+extern float logf_vlen8_avx2 (float);
+extern float expf_vlen8_avx2 (float);
+extern float powf_vlen8_avx2 (float, float);
+
+int main( void)
+{
+ double res = 0.0;
+ float resf = 0.0;
+
+ res += log_vlen2(1.0);
+ res += exp_vlen2(1.0);
+ res += pow_vlen2(1.1, 1.1);
+
+ res += log_vlen4(1.0);
+ res += exp_vlen4(1.0);
+ res += pow_vlen4(1.1, 1.1);
+
+ res += log_vlen4_avx2(1.0);
+ res += exp_vlen4_avx2(1.0);
+ res += pow_vlen4_avx2(1.1, 1.1);
+
+ resf += logf_vlen4(1.0);
+ resf += expf_vlen4(1.0);
+ resf += powf_vlen4(1.1, 1.1);
+
+ resf += logf_vlen8(1.0);
+ resf += expf_vlen8(1.0);
+ resf += powf_vlen8(1.1, 1.1);
+
+ resf += logf_vlen8_avx2(1.0);
+ resf += expf_vlen8_avx2(1.0);
+ resf += powf_vlen8_avx2(1.1, 1.1);
+
+ return 0;
+}
diff --git a/sysdeps/x86_64/fpu/test-libmvec-alias.c b/sysdeps/x86_64/fpu/test-libmvec-alias.c
new file mode 100644
index 0000000000..6a6a103165
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-libmvec-alias.c
@@ -0,0 +1,101 @@
+#include <immintrin.h>
+
+#include "test-double-vlen2.h"
+#define VEC_TYPE __m128d
+
+VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVbN2v___log_finite)
+VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVbN2v___exp_finite)
+VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVbN2vv___pow_finite)
+
+#undef VEC_TYPE
+#undef VECTOR_WRAPPER
+#undef VECTOR_WRAPPER_ff
+#undef VEC_SUFF
+#undef VEC_LEN
+
+#include "test-double-vlen4.h"
+#define VEC_TYPE __m256d
+
+VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVcN4v___log_finite)
+VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVcN4v___exp_finite)
+VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVcN4vv___pow_finite)
+
+#undef VEC_SUFF
+#define VEC_SUFF _vlen4_avx2
+
+VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVdN4v___log_finite)
+VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVdN4v___exp_finite)
+VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVdN4vv___pow_finite)
+
+#undef FUNC
+#undef FLOAT
+#undef BUILD_COMPLEX
+#undef TEST_MSG
+#undef CHOOSE
+#undef FUNC_TEST
+#undef VEC_TYPE
+#undef VECTOR_WRAPPER
+#undef VECTOR_WRAPPER_ff
+#undef VEC_SUFF
+#undef VEC_LEN
+
+#include "test-float-vlen4.h"
+#define VEC_TYPE __m128
+
+VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVbN4v___logf_finite)
+VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVbN4v___expf_finite)
+VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVbN4vv___powf_finite)
+
+#undef VEC_TYPE
+#undef VECTOR_WRAPPER
+#undef VECTOR_WRAPPER_ff
+#undef VEC_SUFF
+#undef VEC_LEN
+
+#include "test-float-vlen8.h"
+#define VEC_TYPE __m256
+
+VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVcN8v___logf_finite)
+VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVcN8v___expf_finite)
+VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVcN8vv___powf_finite)
+
+#undef VEC_SUFF
+#define VEC_SUFF _vlen8_avx2
+
+VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVdN8v___logf_finite)
+VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVdN8v___expf_finite)
+VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVdN8vv___powf_finite)
+
+/*
+int main( void)
+{
+ double res = 0.0;
+ float resf = 0.0;
+
+ res += log_vlen2(1.0);
+ res += exp_vlen2(1.0);
+ res += pow_vlen2(1.1, 1.1);
+
+ res += log_vlen4(1.0);
+ res += exp_vlen4(1.0);
+ res += pow_vlen4(1.1, 1.1);
+
+ res += log_vlen4_avx2(1.0);
+ res += exp_vlen4_avx2(1.0);
+ res += pow_vlen4_avx2(1.1, 1.1);
+
+ resf += logf_vlen4(1.0);
+ resf += expf_vlen4(1.0);
+ resf += powf_vlen4(1.1, 1.1);
+
+ resf += logf_vlen8(1.0);
+ resf += expf_vlen8(1.0);
+ resf += powf_vlen8(1.1, 1.1);
+
+ resf += logf_vlen8_avx2(1.0);
+ resf += expf_vlen8_avx2(1.0);
+ resf += powf_vlen8_avx2(1.1, 1.1);
+
+ return 0;
+}
+*/