[glibc/tuliom/libmvec] powerpc64: Add support for vec_cmpne for older compilers
Tulio Magno Quites Machado Filho
tuliom@sourceware.org
Thu Feb 20 19:36:00 GMT 2020
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d91313ed6fb18acfb4f7b0399fd18e87f5c00221
commit d91313ed6fb18acfb4f7b0399fd18e87f5c00221
Author: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Date: Wed Jul 3 16:17:27 2019 -0300
powerpc64: Add support for vec_cmpne for older compilers
vec_cmpne was added to GCC 7, requiring an alternative implementation
when building glibc with GCC 6.
Diff:
---
sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_dbl.h | 11 +++++++++++
sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_flt.h | 11 +++++++++++
2 files changed, 22 insertions(+)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_dbl.h b/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_dbl.h
index 7c94f5b..e1ef3a2 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_dbl.h
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_dbl.h
@@ -45,6 +45,17 @@
# define TOINT_INTRINSICS 0
#endif
+/* vec_cmpne was included in GCC 7.
+ TODO: Remove this when the minimum required GCC version is >= 7. */
+#ifndef vec_cmpne
+static inline vector bool long long
+vec_cmpne (vector unsigned long long a, vector unsigned long long b)
+{
+ vector bool long long tmp = vec_cmpeq (a, b);
+ return vec_nor (tmp, tmp);
+}
+#endif
+
#if TOINT_INTRINSICS
/* Round x to nearest int in all rounding modes, ties have to be rounded
consistently with converttoint so the results match. If the result
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_flt.h b/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_flt.h
index 18f3419..34345d5 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_flt.h
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_flt.h
@@ -44,6 +44,17 @@
# define TOINT_INTRINSICS 0
#endif
+/* vec_cmpne was included in GCC 7.
+ TODO: Remove this when the minimum required GCC version is >= 7. */
+#ifndef vec_cmpne
+static inline vector bool int
+vec_cmpne (vector unsigned a, vector unsigned b)
+{
+ vector bool int tmp = vec_cmpeq (a, b);
+ return vec_nor (tmp, tmp);
+}
+#endif
+
#if TOINT_INTRINSICS
/* Round x to nearest int in all rounding modes, ties have to be rounded
consistently with converttoint so the results match. If the result
More information about the Glibc-cvs
mailing list