[med-svn] [Git][med-team/last-align][simde] update SIMDe to 37c74d3
Michael R. Crusoe
gitlab at salsa.debian.org
Fri Dec 20 17:29:55 GMT 2019
Michael R. Crusoe pushed to branch simde at Debian Med / last-align
Commits:
0bc28754 by Michael R. Crusoe at 2019-12-20T17:23:36Z
update SIMDe to 37c74d3
- - - - -
8 changed files:
- debian/include/simde/hedley.h
- debian/include/simde/simde-common.h
- debian/include/simde/x86/avx.h
- debian/include/simde/x86/mmx.h
- debian/include/simde/x86/sse.h
- debian/include/simde/x86/sse2.h
- debian/include/simde/x86/sse4.1.h
- debian/include/simde/x86/ssse3.h
Changes:
=====================================
debian/include/simde/hedley.h
=====================================
@@ -10,11 +10,11 @@
* SPDX-License-Identifier: CC0-1.0
*/
-#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 10)
+#if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 12)
#if defined(HEDLEY_VERSION)
# undef HEDLEY_VERSION
#endif
-#define HEDLEY_VERSION 10
+#define HEDLEY_VERSION 12
#if defined(HEDLEY_STRINGIFY_EX)
# undef HEDLEY_STRINGIFY_EX
@@ -211,8 +211,16 @@
#if defined(HEDLEY_TI_VERSION)
# undef HEDLEY_TI_VERSION
#endif
-#if defined(__TI_COMPILER_VERSION__)
-# define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+#if \
+ defined(__TI_COMPILER_VERSION__) && \
+ ( \
+ defined(__TMS470__) || defined(__TI_ARM__) || \
+ defined(__MSP430__) || \
+ defined(__TMS320C2000__) \
+ )
+# if (__TI_COMPILER_VERSION__ >= 16000000)
+# define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+# endif
#endif
#if defined(HEDLEY_TI_VERSION_CHECK)
@@ -224,6 +232,102 @@
# define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0)
#endif
+#if defined(HEDLEY_TI_CL2000_VERSION)
+# undef HEDLEY_TI_CL2000_VERSION
+#endif
+#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__)
+# define HEDLEY_TI_CL2000_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+#endif
+
+#if defined(HEDLEY_TI_CL2000_VERSION_CHECK)
+# undef HEDLEY_TI_CL2000_VERSION_CHECK
+#endif
+#if defined(HEDLEY_TI_CL2000_VERSION)
+# define HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL2000_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
+#else
+# define HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0)
+#endif
+
+#if defined(HEDLEY_TI_CL430_VERSION)
+# undef HEDLEY_TI_CL430_VERSION
+#endif
+#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__)
+# define HEDLEY_TI_CL430_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+#endif
+
+#if defined(HEDLEY_TI_CL430_VERSION_CHECK)
+# undef HEDLEY_TI_CL430_VERSION_CHECK
+#endif
+#if defined(HEDLEY_TI_CL430_VERSION)
+# define HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL430_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
+#else
+# define HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0)
+#endif
+
+#if defined(HEDLEY_TI_ARMCL_VERSION)
+# undef HEDLEY_TI_ARMCL_VERSION
+#endif
+#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__))
+# define HEDLEY_TI_ARMCL_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+#endif
+
+#if defined(HEDLEY_TI_ARMCL_VERSION_CHECK)
+# undef HEDLEY_TI_ARMCL_VERSION_CHECK
+#endif
+#if defined(HEDLEY_TI_ARMCL_VERSION)
+# define HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_ARMCL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
+#else
+# define HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0)
+#endif
+
+#if defined(HEDLEY_TI_CL6X_VERSION)
+# undef HEDLEY_TI_CL6X_VERSION
+#endif
+#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__)
+# define HEDLEY_TI_CL6X_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+#endif
+
+#if defined(HEDLEY_TI_CL6X_VERSION_CHECK)
+# undef HEDLEY_TI_CL6X_VERSION_CHECK
+#endif
+#if defined(HEDLEY_TI_CL6X_VERSION)
+# define HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL6X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
+#else
+# define HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0)
+#endif
+
+#if defined(HEDLEY_TI_CL7X_VERSION)
+# undef HEDLEY_TI_CL7X_VERSION
+#endif
+#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__)
+# define HEDLEY_TI_CL7X_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+#endif
+
+#if defined(HEDLEY_TI_CL7X_VERSION_CHECK)
+# undef HEDLEY_TI_CL7X_VERSION_CHECK
+#endif
+#if defined(HEDLEY_TI_CL7X_VERSION)
+# define HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL7X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
+#else
+# define HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0)
+#endif
+
+#if defined(HEDLEY_TI_CLPRU_VERSION)
+# undef HEDLEY_TI_CLPRU_VERSION
+#endif
+#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__)
+# define HEDLEY_TI_CLPRU_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
+#endif
+
+#if defined(HEDLEY_TI_CLPRU_VERSION_CHECK)
+# undef HEDLEY_TI_CLPRU_VERSION_CHECK
+#endif
+#if defined(HEDLEY_TI_CLPRU_VERSION)
+# define HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CLPRU_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
+#else
+# define HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0)
+#endif
+
#if defined(HEDLEY_CRAY_VERSION)
# undef HEDLEY_CRAY_VERSION
#endif
@@ -338,6 +442,12 @@
!defined(HEDLEY_PGI_VERSION) && \
!defined(HEDLEY_ARM_VERSION) && \
!defined(HEDLEY_TI_VERSION) && \
+ !defined(HEDLEY_TI_ARMCL_VERSION) && \
+ !defined(HEDLEY_TI_CL430_VERSION) && \
+ !defined(HEDLEY_TI_CL2000_VERSION) && \
+ !defined(HEDLEY_TI_CL6X_VERSION) && \
+ !defined(HEDLEY_TI_CL7X_VERSION) && \
+ !defined(HEDLEY_TI_CLPRU_VERSION) && \
!defined(__COMPCERT__)
# define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION
#endif
@@ -381,12 +491,30 @@
#if defined(HEDLEY_HAS_CPP_ATTRIBUTE)
# undef HEDLEY_HAS_CPP_ATTRIBUTE
#endif
-#if defined(__has_cpp_attribute) && defined(__cplusplus)
+#if \
+ defined(__has_cpp_attribute) && \
+ defined(__cplusplus) && \
+ (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0))
# define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)
#else
# define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0)
#endif
+#if defined(HEDLEY_HAS_CPP_ATTRIBUTE_NS)
+# undef HEDLEY_HAS_CPP_ATTRIBUTE_NS
+#endif
+#if !defined(__cplusplus) || !defined(__has_cpp_attribute)
+# define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
+#elif \
+ !defined(HEDLEY_PGI_VERSION) && \
+ !defined(HEDLEY_IAR_VERSION) && \
+ (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \
+ (!defined(HEDLEY_MSVC_VERSION) || HEDLEY_MSVC_VERSION_CHECK(19,20,0))
+# define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute)
+#else
+# define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
+#endif
+
#if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE)
# undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE
#endif
@@ -540,6 +668,92 @@
# define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
#endif
+/* HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for
+ HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
+#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
+# undef HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_
+#endif
+#if defined(__cplusplus)
+# if HEDLEY_HAS_WARNING("-Wc++98-compat")
+# if HEDLEY_HAS_WARNING("-Wc++17-extensions")
+# define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
+ HEDLEY_DIAGNOSTIC_PUSH \
+ _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
+ _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
+ xpr \
+ HEDLEY_DIAGNOSTIC_POP
+# else
+# define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
+ HEDLEY_DIAGNOSTIC_PUSH \
+ _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
+ xpr \
+ HEDLEY_DIAGNOSTIC_POP
+# endif
+# endif
+#endif
+#if !defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
+# define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x
+#endif
+
+#if defined(HEDLEY_CONST_CAST)
+# undef HEDLEY_CONST_CAST
+#endif
+#if defined(__cplusplus)
+# define HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))
+#elif \
+ HEDLEY_HAS_WARNING("-Wcast-qual") || \
+ HEDLEY_GCC_VERSION_CHECK(4,6,0) || \
+ HEDLEY_INTEL_VERSION_CHECK(13,0,0)
+# define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \
+ HEDLEY_DIAGNOSTIC_PUSH \
+ HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
+ ((T) (expr)); \
+ HEDLEY_DIAGNOSTIC_POP \
+ }))
+#else
+# define HEDLEY_CONST_CAST(T, expr) ((T) (expr))
+#endif
+
+#if defined(HEDLEY_REINTERPRET_CAST)
+# undef HEDLEY_REINTERPRET_CAST
+#endif
+#if defined(__cplusplus)
+# define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))
+#else
+# define HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr))
+#endif
+
+#if defined(HEDLEY_STATIC_CAST)
+# undef HEDLEY_STATIC_CAST
+#endif
+#if defined(__cplusplus)
+# define HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))
+#else
+# define HEDLEY_STATIC_CAST(T, expr) ((T) (expr))
+#endif
+
+#if defined(HEDLEY_CPP_CAST)
+# undef HEDLEY_CPP_CAST
+#endif
+#if defined(__cplusplus)
+# if HEDLEY_HAS_WARNING("-Wold-style-cast")
+# define HEDLEY_CPP_CAST(T, expr) \
+ HEDLEY_DIAGNOSTIC_PUSH \
+ _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \
+ ((T) (expr)) \
+ HEDLEY_DIAGNOSTIC_POP
+# elif HEDLEY_IAR_VERSION_CHECK(8,3,0)
+# define HEDLEY_CPP_CAST(T, expr) \
+ HEDLEY_DIAGNOSTIC_PUSH \
+ _Pragma("diag_suppress=Pe137") \
+ HEDLEY_DIAGNOSTIC_POP \
+# else
+# define HEDLEY_CPP_CAST(T, expr) ((T) (expr))
+# endif
+#else
+# define HEDLEY_CPP_CAST(T, expr) (expr)
+#endif
+
#if \
(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
defined(__clang__) || \
@@ -548,7 +762,13 @@
HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
- HEDLEY_TI_VERSION_CHECK(6,0,0) || \
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \
HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \
HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \
@@ -581,7 +801,13 @@
#elif HEDLEY_ARM_VERSION_CHECK(5,6,0)
# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push")
# define HEDLEY_DIAGNOSTIC_POP _Pragma("pop")
-#elif HEDLEY_TI_VERSION_CHECK(8,1,0)
+#elif \
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push")
# define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop")
#elif HEDLEY_PELLES_VERSION_CHECK(2,90,0)
@@ -605,7 +831,18 @@
# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0)
# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996))
-#elif HEDLEY_TI_VERSION_CHECK(8,0,0)
+#elif \
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718")
#elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus)
# define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)")
@@ -632,7 +869,13 @@
# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"")
#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0)
# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068))
-#elif HEDLEY_TI_VERSION_CHECK(8,0,0)
+#elif \
+ HEDLEY_TI_VERSION_CHECK(16,9,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
+#elif HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0)
# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
#elif HEDLEY_IAR_VERSION_CHECK(8,0,0)
# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161")
@@ -640,6 +883,32 @@
# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
#endif
+#if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES)
+# undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
+#endif
+#if HEDLEY_HAS_WARNING("-Wunknown-attributes")
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"")
+#elif HEDLEY_GCC_VERSION_CHECK(4,6,0)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+#elif HEDLEY_INTEL_VERSION_CHECK(17,0,0)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)")
+#elif HEDLEY_MSVC_VERSION_CHECK(19,0,0)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030))
+#elif HEDLEY_PGI_VERSION_CHECK(17,10,0)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097")
+#elif HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)")
+#elif \
+ HEDLEY_TI_VERSION_CHECK(18,1,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173")
+#elif HEDLEY_IAR_VERSION_CHECK(8,0,0)
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097")
+#else
+# define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
+#endif
+
#if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL)
# undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
#endif
@@ -660,8 +929,8 @@
# undef HEDLEY_DEPRECATED_FOR
#endif
#if defined(__cplusplus) && (__cplusplus >= 201402L)
-# define HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]]
-# define HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]]
+# define HEDLEY_DEPRECATED(since) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]])
+# define HEDLEY_DEPRECATED_FOR(since, replacement) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]])
#elif \
HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \
HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
@@ -669,15 +938,28 @@
HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \
HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
- HEDLEY_TI_VERSION_CHECK(8,3,0)
+ HEDLEY_TI_VERSION_CHECK(18,1,0) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0)
# define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since)))
# define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement)))
#elif \
HEDLEY_HAS_ATTRIBUTE(deprecated) || \
HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__))
# define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__))
#elif HEDLEY_MSVC_VERSION_CHECK(14,0,0)
@@ -711,21 +993,40 @@
#if defined(HEDLEY_WARN_UNUSED_RESULT)
# undef HEDLEY_WARN_UNUSED_RESULT
#endif
-#if defined(__cplusplus) && (__cplusplus >= 201703L)
-# define HEDLEY_WARN_UNUSED_RESULT [[nodiscard]]
+#if defined(HEDLEY_WARN_UNUSED_RESULT_MSG)
+# undef HEDLEY_WARN_UNUSED_RESULT_MSG
+#endif
+#if (HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L)
+# define HEDLEY_WARN_UNUSED_RESULT HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
+# define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]])
+#elif HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard)
+# define HEDLEY_WARN_UNUSED_RESULT HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
+# define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
#elif \
HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \
HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
(HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
HEDLEY_PGI_VERSION_CHECK(17,10,0)
# define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
+# define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__))
#elif defined(_Check_return_) /* SAL */
# define HEDLEY_WARN_UNUSED_RESULT _Check_return_
+# define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_
#else
# define HEDLEY_WARN_UNUSED_RESULT
+# define HEDLEY_WARN_UNUSED_RESULT_MSG(msg)
#endif
#if defined(HEDLEY_SENTINEL)
@@ -751,21 +1052,30 @@
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
# define HEDLEY_NO_RETURN _Noreturn
#elif defined(__cplusplus) && (__cplusplus >= 201103L)
-# define HEDLEY_NO_RETURN [[noreturn]]
+# define HEDLEY_NO_RETURN HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]])
#elif \
HEDLEY_HAS_ATTRIBUTE(noreturn) || \
HEDLEY_GCC_VERSION_CHECK(3,2,0) || \
HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
- HEDLEY_TI_VERSION_CHECK(18,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(17,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_NO_RETURN __attribute__((__noreturn__))
#elif HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
# define HEDLEY_NO_RETURN _Pragma("does_not_return")
#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0)
# define HEDLEY_NO_RETURN __declspec(noreturn)
-#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus)
+#elif HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
# define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;")
#elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0)
# define HEDLEY_NO_RETURN __attribute((noreturn))
@@ -775,37 +1085,21 @@
# define HEDLEY_NO_RETURN
#endif
+#if defined(HEDLEY_NO_ESCAPE)
+# undef HEDLEY_NO_ESCAPE
+#endif
+#if HEDLEY_HAS_ATTRIBUTE(noescape)
+# define HEDLEY_NO_ESCAPE __attribute__((__noescape__))
+#else
+# define HEDLEY_NO_ESCAPE
+#endif
+
#if defined(HEDLEY_UNREACHABLE)
# undef HEDLEY_UNREACHABLE
#endif
#if defined(HEDLEY_UNREACHABLE_RETURN)
# undef HEDLEY_UNREACHABLE_RETURN
#endif
-#if \
- (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \
- HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
- HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
- HEDLEY_IBM_VERSION_CHECK(13,1,5)
-# define HEDLEY_UNREACHABLE() __builtin_unreachable()
-#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0)
-# define HEDLEY_UNREACHABLE() __assume(0)
-#elif HEDLEY_TI_VERSION_CHECK(6,0,0)
-# if defined(__cplusplus)
-# define HEDLEY_UNREACHABLE() std::_nassert(0)
-# else
-# define HEDLEY_UNREACHABLE() _nassert(0)
-# endif
-# define HEDLEY_UNREACHABLE_RETURN(value) return value
-#elif defined(EXIT_FAILURE)
-# define HEDLEY_UNREACHABLE() abort()
-#else
-# define HEDLEY_UNREACHABLE()
-# define HEDLEY_UNREACHABLE_RETURN(value) return value
-#endif
-#if !defined(HEDLEY_UNREACHABLE_RETURN)
-# define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE()
-#endif
-
#if defined(HEDLEY_ASSUME)
# undef HEDLEY_ASSUME
#endif
@@ -815,27 +1109,55 @@
# define HEDLEY_ASSUME(expr) __assume(expr)
#elif HEDLEY_HAS_BUILTIN(__builtin_assume)
# define HEDLEY_ASSUME(expr) __builtin_assume(expr)
-#elif HEDLEY_TI_VERSION_CHECK(6,0,0)
+#elif \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
# if defined(__cplusplus)
# define HEDLEY_ASSUME(expr) std::_nassert(expr)
# else
# define HEDLEY_ASSUME(expr) _nassert(expr)
# endif
-#elif \
- (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(HEDLEY_ARM_VERSION)) || \
+#endif
+#if \
+ (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \
HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
+ HEDLEY_PGI_VERSION_CHECK(18,10,0) || \
HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
HEDLEY_IBM_VERSION_CHECK(13,1,5)
-# define HEDLEY_ASSUME(expr) ((void) ((expr) ? 1 : (__builtin_unreachable(), 1)))
+# define HEDLEY_UNREACHABLE() __builtin_unreachable()
+#elif defined(HEDLEY_ASSUME)
+# define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0)
+#endif
+#if !defined(HEDLEY_ASSUME)
+# if defined(HEDLEY_UNREACHABLE)
+# define HEDLEY_ASSUME(expr) HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (HEDLEY_UNREACHABLE(), 1)))
+# else
+# define HEDLEY_ASSUME(expr) HEDLEY_STATIC_CAST(void, expr)
+# endif
+#endif
+#if defined(HEDLEY_UNREACHABLE)
+# if \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
+# define HEDLEY_UNREACHABLE_RETURN(value) return (HEDLEY_STATIC_CAST(void, HEDLEY_ASSUME(0)), (value))
+# else
+# define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE()
+# endif
#else
-# define HEDLEY_ASSUME(expr) ((void) (expr))
+# define HEDLEY_UNREACHABLE_RETURN(value) return (value)
+#endif
+#if !defined(HEDLEY_UNREACHABLE)
+# define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0)
#endif
-
HEDLEY_DIAGNOSTIC_PUSH
-#if \
- HEDLEY_HAS_WARNING("-Wvariadic-macros") || \
- HEDLEY_GCC_VERSION_CHECK(4,0,0)
+#if HEDLEY_HAS_WARNING("-Wpedantic")
+# pragma clang diagnostic ignored "-Wpedantic"
+#endif
+#if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus)
+# pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
+#endif
+#if HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0)
# if defined(__clang__)
# pragma clang diagnostic ignored "-Wvariadic-macros"
# elif defined(HEDLEY_GCC_VERSION)
@@ -869,8 +1191,17 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check)))
#elif HEDLEY_PELLES_VERSION_CHECK(6,0,0)
# define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check))
@@ -883,7 +1214,7 @@ HEDLEY_DIAGNOSTIC_POP
#endif
#if defined(__cplusplus)
# if __cplusplus >= 201103L
-# define HEDLEY_CONSTEXPR constexpr
+# define HEDLEY_CONSTEXPR HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr)
# endif
#endif
#if !defined(HEDLEY_CONSTEXPR)
@@ -903,19 +1234,16 @@ HEDLEY_DIAGNOSTIC_POP
# undef HEDLEY_UNPREDICTABLE
#endif
#if HEDLEY_HAS_BUILTIN(__builtin_unpredictable)
-# define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr))
+# define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr))
#endif
#if \
HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \
HEDLEY_GCC_VERSION_CHECK(9,0,0)
-# define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability)
-# define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability)
-# define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability)
-# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)
-# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
-# if !defined(HEDLEY_BUILTIN_UNPREDICTABLE)
-# define HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5)
-# endif
+# define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability))
+# define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability))
+# define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability))
+# define HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 )
+# define HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 )
#elif \
HEDLEY_HAS_BUILTIN(__builtin_expect) || \
HEDLEY_GCC_VERSION_CHECK(3,0,0) || \
@@ -923,24 +1251,31 @@ HEDLEY_DIAGNOSTIC_POP
(HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
- HEDLEY_TI_VERSION_CHECK(6,1,0) || \
- HEDLEY_TINYC_VERSION_CHECK(0,9,27)
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
+ HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \
+ HEDLEY_CRAY_VERSION_CHECK(8,1,0)
# define HEDLEY_PREDICT(expr, expected, probability) \
- (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void) (expected)), !!(expr)))
+ (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (HEDLEY_STATIC_CAST(void, expected), (expr)))
# define HEDLEY_PREDICT_TRUE(expr, probability) \
(__extension__ ({ \
- HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \
+ double hedley_probability_ = (probability); \
((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \
}))
# define HEDLEY_PREDICT_FALSE(expr, probability) \
(__extension__ ({ \
- HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \
+ double hedley_probability_ = (probability); \
((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \
}))
# define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)
# define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
#else
-# define HEDLEY_PREDICT(expr, expected, probability) (((void) (expected)), !!(expr))
+# define HEDLEY_PREDICT(expr, expected, probability) (HEDLEY_STATIC_CAST(void, expected), (expr))
# define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr))
# define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr))
# define HEDLEY_LIKELY(expr) (!!(expr))
@@ -960,8 +1295,17 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_MALLOC __attribute__((__malloc__))
#elif HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
# define HEDLEY_MALLOC _Pragma("returns_new_memory")
@@ -981,13 +1325,27 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
HEDLEY_PGI_VERSION_CHECK(17,10,0)
# define HEDLEY_PURE __attribute__((__pure__))
#elif HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
# define HEDLEY_PURE _Pragma("does_not_write_global_data")
-#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus)
+#elif defined(__cplusplus) && \
+ ( \
+ HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \
+ )
# define HEDLEY_PURE _Pragma("FUNC_IS_PURE;")
#else
# define HEDLEY_PURE
@@ -1003,8 +1361,17 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
HEDLEY_PGI_VERSION_CHECK(17,10,0)
# define HEDLEY_CONST __attribute__((__const__))
#elif \
@@ -1026,7 +1393,10 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
(HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \
HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
defined(__clang__)
@@ -1051,7 +1421,12 @@ HEDLEY_DIAGNOSTIC_POP
#elif \
HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0)
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_INLINE __inline
#else
# define HEDLEY_INLINE
@@ -1067,12 +1442,29 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE
#elif HEDLEY_MSVC_VERSION_CHECK(12,0,0)
# define HEDLEY_ALWAYS_INLINE __forceinline
-#elif HEDLEY_TI_VERSION_CHECK(7,0,0) && defined(__cplusplus)
+#elif defined(__cplusplus) && \
+ ( \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \
+ )
# define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;")
#elif HEDLEY_IAR_VERSION_CHECK(8,0,0)
# define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced")
@@ -1090,14 +1482,23 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+ HEDLEY_TI_VERSION_CHECK(15,12,0) || \
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
+ (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
+ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
# define HEDLEY_NEVER_INLINE __attribute__((__noinline__))
#elif HEDLEY_MSVC_VERSION_CHECK(13,10,0)
# define HEDLEY_NEVER_INLINE __declspec(noinline)
#elif HEDLEY_PGI_VERSION_CHECK(10,2,0)
# define HEDLEY_NEVER_INLINE _Pragma("noinline")
-#elif HEDLEY_TI_VERSION_CHECK(6,0,0) && defined(__cplusplus)
+#elif HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
# define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;")
#elif HEDLEY_IAR_VERSION_CHECK(8,0,0)
# define HEDLEY_NEVER_INLINE _Pragma("inline=never")
@@ -1130,8 +1531,13 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
- HEDLEY_TI_VERSION_CHECK(8,0,0) || \
- (HEDLEY_TI_VERSION_CHECK(7,3,0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+ ( \
+ defined(__TI_EABI__) && \
+ ( \
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \
+ ) \
+ )
# define HEDLEY_PRIVATE __attribute__((__visibility__("hidden")))
# define HEDLEY_PUBLIC __attribute__((__visibility__("default")))
# else
@@ -1158,30 +1564,18 @@ HEDLEY_DIAGNOSTIC_POP
#endif
#if defined(HEDLEY_FALL_THROUGH)
-# undef HEDLEY_FALL_THROUGH
+# undef HEDLEY_FALL_THROUGH
#endif
-#if \
- defined(__cplusplus) && \
- (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \
- !defined(HEDLEY_PGI_VERSION)
-# if \
- (__cplusplus >= 201703L) || \
- ((__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough))
-# define HEDLEY_FALL_THROUGH [[fallthrough]]
-# elif (__cplusplus >= 201103L) && HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough)
-# define HEDLEY_FALL_THROUGH [[clang::fallthrough]]
-# elif (__cplusplus >= 201103L) && HEDLEY_GCC_VERSION_CHECK(7,0,0)
-# define HEDLEY_FALL_THROUGH [[gnu::fallthrough]]
-# endif
-#endif
-#if !defined(HEDLEY_FALL_THROUGH)
-# if HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(HEDLEY_PGI_VERSION)
-# define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__))
-# elif defined(__fallthrough) /* SAL */
-# define HEDLEY_FALL_THROUGH __fallthrough
-# else
-# define HEDLEY_FALL_THROUGH
-# endif
+#if HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough,7,0,0) && !defined(HEDLEY_PGI_VERSION)
+# define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__))
+#elif HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough)
+# define HEDLEY_FALL_THROUGH HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]])
+#elif HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)
+# define HEDLEY_FALL_THROUGH HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]])
+#elif defined(__fallthrough) /* SAL */
+# define HEDLEY_FALL_THROUGH __fallthrough
+#else
+# define HEDLEY_FALL_THROUGH
#endif
#if defined(HEDLEY_RETURNS_NON_NULL)
@@ -1217,12 +1611,11 @@ HEDLEY_DIAGNOSTIC_POP
#if defined(HEDLEY_REQUIRE_CONSTEXPR)
# undef HEDLEY_REQUIRE_CONSTEXPR
#endif
-/* Note the double-underscore. For internal use only; no API
- * guarantees! */
-#if defined(HEDLEY__IS_CONSTEXPR)
-# undef HEDLEY__IS_CONSTEXPR
+/* HEDLEY_IS_CONSTEXPR_ is for
+ HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
+#if defined(HEDLEY_IS_CONSTEXPR_)
+# undef HEDLEY_IS_CONSTEXPR_
#endif
-
#if \
HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \
HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
@@ -1230,7 +1623,7 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \
HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
- HEDLEY_TI_VERSION_CHECK(6,1,0) || \
+ HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
(HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \
HEDLEY_CRAY_VERSION_CHECK(8,1,0)
# define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr)
@@ -1245,31 +1638,40 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_ARM_VERSION_CHECK(5,4,0) || \
HEDLEY_TINYC_VERSION_CHECK(0,9,24)
# if defined(__INTPTR_TYPE__)
-# define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*)
+# define HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*)
# else
# include <stdint.h>
-# define HEDLEY__IS_CONSTEXPR(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*)
+# define HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*)
# endif
# elif \
- (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(HEDLEY_SUNPRO_VERSION) && !defined(HEDLEY_PGI_VERSION)) || \
+ ( \
+ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \
+ !defined(HEDLEY_SUNPRO_VERSION) && \
+ !defined(HEDLEY_PGI_VERSION) && \
+ !defined(HEDLEY_IAR_VERSION)) || \
HEDLEY_HAS_EXTENSION(c_generic_selections) || \
HEDLEY_GCC_VERSION_CHECK(4,9,0) || \
HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \
HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
HEDLEY_ARM_VERSION_CHECK(5,3,0)
# if defined(__INTPTR_TYPE__)
-# define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0)
+# define HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0)
# else
# include <stdint.h>
-# define HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0)
+# define HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0)
# endif
# elif \
defined(HEDLEY_GCC_VERSION) || \
defined(HEDLEY_INTEL_VERSION) || \
defined(HEDLEY_TINYC_VERSION) || \
- defined(HEDLEY_TI_VERSION) || \
+ defined(HEDLEY_TI_ARMCL_VERSION) || \
+ HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \
+ defined(HEDLEY_TI_CL2000_VERSION) || \
+ defined(HEDLEY_TI_CL6X_VERSION) || \
+ defined(HEDLEY_TI_CL7X_VERSION) || \
+ defined(HEDLEY_TI_CLPRU_VERSION) || \
defined(__clang__)
-# define HEDLEY__IS_CONSTEXPR(expr) ( \
+# define HEDLEY_IS_CONSTEXPR_(expr) ( \
sizeof(void) != \
sizeof(*( \
1 ? \
@@ -1280,11 +1682,11 @@ HEDLEY_DIAGNOSTIC_POP
)
# endif
#endif
-#if defined(HEDLEY__IS_CONSTEXPR)
+#if defined(HEDLEY_IS_CONSTEXPR_)
# if !defined(HEDLEY_IS_CONSTANT)
-# define HEDLEY_IS_CONSTANT(expr) HEDLEY__IS_CONSTEXPR(expr)
+# define HEDLEY_IS_CONSTANT(expr) HEDLEY_IS_CONSTEXPR_(expr)
# endif
-# define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1))
+# define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1))
#else
# if !defined(HEDLEY_IS_CONSTANT)
# define HEDLEY_IS_CONSTANT(expr) (0)
@@ -1325,57 +1727,27 @@ HEDLEY_DIAGNOSTIC_POP
# define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message)
#elif \
(defined(__cplusplus) && (__cplusplus >= 201103L)) || \
- HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \
- (defined(__cplusplus) && HEDLEY_TI_VERSION_CHECK(8,3,0))
-# define HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message)
+ HEDLEY_MSVC_VERSION_CHECK(16,0,0)
+# define HEDLEY_STATIC_ASSERT(expr, message) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message))
#else
# define HEDLEY_STATIC_ASSERT(expr, message)
#endif
-#if defined(HEDLEY_CONST_CAST)
-# undef HEDLEY_CONST_CAST
-#endif
-#if defined(__cplusplus)
-# define HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))
-#elif \
- HEDLEY_HAS_WARNING("-Wcast-qual") || \
- HEDLEY_GCC_VERSION_CHECK(4,6,0) || \
- HEDLEY_INTEL_VERSION_CHECK(13,0,0)
-# define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \
- HEDLEY_DIAGNOSTIC_PUSH \
- HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
- ((T) (expr)); \
- HEDLEY_DIAGNOSTIC_POP \
- }))
-#else
-# define HEDLEY_CONST_CAST(T, expr) ((T) (expr))
-#endif
-
-#if defined(HEDLEY_REINTERPRET_CAST)
-# undef HEDLEY_REINTERPRET_CAST
+#if defined(HEDLEY_NULL)
+# undef HEDLEY_NULL
#endif
#if defined(__cplusplus)
-# define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))
-#else
-# define HEDLEY_REINTERPRET_CAST(T, expr) (*((T*) &(expr)))
-#endif
-
-#if defined(HEDLEY_STATIC_CAST)
-# undef HEDLEY_STATIC_CAST
-#endif
-#if defined(__cplusplus)
-# define HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))
-#else
-# define HEDLEY_STATIC_CAST(T, expr) ((T) (expr))
-#endif
-
-#if defined(HEDLEY_CPP_CAST)
-# undef HEDLEY_CPP_CAST
-#endif
-#if defined(__cplusplus)
-# define HEDLEY_CPP_CAST(T, expr) static_cast<T>(expr)
+# if __cplusplus >= 201103L
+# define HEDLEY_NULL HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr)
+# elif defined(NULL)
+# define HEDLEY_NULL NULL
+# else
+# define HEDLEY_NULL HEDLEY_STATIC_CAST(void*, 0)
+# endif
+#elif defined(NULL)
+# define HEDLEY_NULL NULL
#else
-# define HEDLEY_CPP_CAST(T, expr) (expr)
+# define HEDLEY_NULL ((void*) 0)
#endif
#if defined(HEDLEY_MESSAGE)
@@ -1412,7 +1784,8 @@ HEDLEY_DIAGNOSTIC_POP
HEDLEY_DIAGNOSTIC_POP
#elif \
HEDLEY_GCC_VERSION_CHECK(4,8,0) || \
- HEDLEY_PGI_VERSION_CHECK(18,4,0)
+ HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
+ HEDLEY_INTEL_VERSION_CHECK(13,0,0)
# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg)
#elif HEDLEY_MSVC_VERSION_CHECK(15,0,0)
# define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg))
@@ -1420,27 +1793,32 @@ HEDLEY_DIAGNOSTIC_POP
# define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg)
#endif
+#if defined(HEDLEY_REQUIRE)
+# undef HEDLEY_REQUIRE
+#endif
#if defined(HEDLEY_REQUIRE_MSG)
# undef HEDLEY_REQUIRE_MSG
#endif
#if HEDLEY_HAS_ATTRIBUTE(diagnose_if)
# if HEDLEY_HAS_WARNING("-Wgcc-compat")
-# define HEDLEY_REQUIRE_MSG(expr, msg) \
- HEDLEY_DIAGNOSTIC_PUSH \
- _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
- __attribute__((__diagnose_if__(!(expr), msg, "error"))) \
- HEDLEY_DIAGNOSTIC_POP
+# define HEDLEY_REQUIRE(expr) \
+ HEDLEY_DIAGNOSTIC_PUSH \
+ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
+ __attribute__((diagnose_if(!(expr), #expr, "error"))) \
+ HEDLEY_DIAGNOSTIC_POP
+# define HEDLEY_REQUIRE_MSG(expr,msg) \
+ HEDLEY_DIAGNOSTIC_PUSH \
+ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
+ __attribute__((diagnose_if(!(expr), msg, "error"))) \
+ HEDLEY_DIAGNOSTIC_POP
# else
-# define HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error")))
+# define HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error")))
+# define HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error")))
# endif
#else
-# define HEDLEY_REQUIRE_MSG(expr, msg)
-#endif
-
-#if defined(HEDLEY_REQUIRE)
-# undef HEDLEY_REQUIRE
+# define HEDLEY_REQUIRE(expr)
+# define HEDLEY_REQUIRE_MSG(expr,msg)
#endif
-#define HEDLEY_REQUIRE(expr) HEDLEY_REQUIRE_MSG(expr, #expr)
#if defined(HEDLEY_FLAGS)
# undef HEDLEY_FLAGS
=====================================
debian/include/simde/simde-common.h
=====================================
@@ -39,7 +39,7 @@
HEDLEY_TINYC_VERSION_CHECK(0,9,24) || \
HEDLEY_TI_VERSION_CHECK(8,1,0)
# define SIMDE_ALIGN(alignment) __attribute__((aligned(alignment)))
-#elif defined(_MSC_VER) && (!defined(_M_IX86) || defined(_M_AMD64))
+#elif defined(_MSC_VER) && !(defined(_M_ARM) && !defined(_M_ARM64))
# define SIMDE_ALIGN(alignment) __declspec(align(alignment))
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
# define SIMDE_ALIGN(alignment) _Alignas(alignment)
@@ -50,22 +50,22 @@
#endif
#define simde_assert_aligned(alignment, val) \
- simde_assert_int(((uintptr_t) (val)) % (alignment), ==, 0)
+ simde_assert_int(HEDLEY_REINTERPRET_CAST(const uintptr_t, (val)) % (alignment), ==, 0)
/* TODO: this should really do something like
HEDLEY_STATIC_CAST(T, (simde_assert_int(alignment, v), v))
but I need to think about how to handle it in all compilers...
may end up moving to Hedley, too. */
#if HEDLEY_HAS_BUILTIN(__builtin_assume_aligned)
-# define SIMDE_CAST_ALIGN(alignment, T, v) ((T) __builtin_assume_aligned(v, alignment))
+# define SIMDE_CAST_ALIGN(alignment, T, v) HEDLEY_REINTERPRET_CAST(T, __builtin_assume_aligned(v, alignment))
#elif HEDLEY_HAS_WARNING("-Wcast-align")
# define SIMDE_CAST_ALIGN(alignment, T, v) \
HEDLEY_DIAGNOSTIC_PUSH \
_Pragma("clang diagnostic ignored \"-Wcast-align\"") \
- ((T) (v)) \
+ HEDLEY_REINTERPRET_CAST(T, (v)) \
HEDLEY_DIAGNOSTIC_POP
#else
-# define SIMDE_CAST_ALIGN(alignment, T, v) ((T) (v))
+# define SIMDE_CAST_ALIGN(alignment, T, v) HEDLEY_REINTERPRET_CAST(T, (v))
#endif
#if HEDLEY_GCC_HAS_ATTRIBUTE(vector_size,4,6,0)
@@ -145,10 +145,21 @@
# define SIMDE__END_DECLS HEDLEY_END_C_DECLS
#endif
+#if HEDLEY_HAS_WARNING("-Wpedantic")
+# define SIMDE_DIAGNOSTIC_DISABLE_INT128 _Pragma("clang diagnostic ignored \"-Wpedantic\"")
+#elif defined(HEDLEY_GCC_VERSION)
+# define SIMDE_DIAGNOSTIC_DISABLE_INT128 _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
+#else
+# define SIMDE_DIAGNOSTIC_DISABLE_INT128
+#endif
+
#if defined(__SIZEOF_INT128__)
# define SIMDE__HAVE_INT128
+HEDLEY_DIAGNOSTIC_PUSH
+SIMDE_DIAGNOSTIC_DISABLE_INT128
typedef __int128 simde_int128;
typedef unsigned __int128 simde_uint128;
+HEDLEY_DIAGNOSTIC_POP
#endif
/* TODO: we should at least make an attempt to detect the correct
@@ -211,7 +222,10 @@ HEDLEY_STATIC_ASSERT(sizeof(simde_float64) == 8, "Unable to find 64-bit floating
#if HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
# define SIMDE__SHUFFLE_VECTOR(elem_size, vec_size, a, b, ...) __builtin_shufflevector(a, b, __VA_ARGS__)
#elif HEDLEY_GCC_HAS_BUILTIN(__builtin_shuffle,4,7,0) && !defined(__INTEL_COMPILER)
-# define SIMDE__SHUFFLE_VECTOR(elem_size, vec_size, a, b, ...) __builtin_shuffle(a, b, (int##elem_size##_t __attribute__((__vector_size__(vec_size)))) { __VA_ARGS__ })
+# define SIMDE__SHUFFLE_VECTOR(elem_size, vec_size, a, b, ...) (__extension__ ({ \
+ int##elem_size##_t __attribute__((__vector_size__(vec_size))) simde_shuffle_ = { __VA_ARGS__ }; \
+ __builtin_shuffle(a, b, simde_shuffle_); \
+ }))
#endif
#if HEDLEY_GCC_HAS_BUILTIN(__builtin_convertvector,9,0,0)
@@ -222,12 +236,21 @@ HEDLEY_STATIC_ASSERT(sizeof(simde_float64) == 8, "Unable to find 64-bit floating
# define SIMDE_CONVERT_FTOI(T,v) \
HEDLEY_DIAGNOSTIC_PUSH \
_Pragma("clang diagnostic ignored \"-Wbad-function-cast\"") \
- ((T) (v)) \
+ HEDLEY_STATIC_CAST(T, (v)) \
HEDLEY_DIAGNOSTIC_POP
#else
# define SIMDE_CONVERT_FTOI(T,v) ((T) (v))
#endif
+
+#if HEDLEY_HAS_WARNING("-Wfloat-equal")
+# define SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL _Pragma("clang diagnostic ignored \"-Wfloat-equal\"")
+#elif HEDLEY_GCC_VERSION_CHECK(3,0,0)
+# define SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL _Pragma("GCC diagnostic ignored \"-Wfloat-equal\"")
+#else
+# define SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL
+#endif
+
/* Some algorithms are iterative, and fewer iterations means less
accuracy. Lower values here will result in faster, but less
accurate, calculations for some functions. */
@@ -305,21 +328,29 @@ HEDLEY_STATIC_ASSERT(sizeof(simde_float64) == 8, "Unable to find 64-bit floating
# endif
#endif
-#if !defined(__cplusplus)
-#define SIMDE_F64_ALL_SET (((union { uint64_t u64; simde_float64 f64; }) { .u64 = ~UINT64_C(0x0) }).f64)
-#define SIMDE_F64_ALL_UNSET (((union { uint64_t u64; simde_float64 f64; }) { .u64 = UINT64_C(0x0) }).f64)
-#define SIMDE_F32_ALL_SET (((union { uint32_t u32; simde_float32 f32; }) { .u32 = ~UINT32_C(0x0) }).f32)
-#define SIMDE_F32_ALL_UNSET (((union { uint32_t u32; simde_float32 f32; }) { .u32 = UINT32_C(0x0) }).f32)
-#else
-static const union { uint64_t u64; simde_float64 f64; } simde_f64_all_set = { .u64 = ~UINT64_C(0) };
-static const union { uint64_t u64; simde_float64 f64; } simde_f64_all_unset = { .u64 = UINT64_C(0) };
-static const union { uint64_t u32; simde_float64 f32; } simde_f32_all_set = { .u32 = ~UINT32_C(0) };
-static const union { uint64_t u32; simde_float64 f32; } simde_f32_all_unset = { .u32 = UINT32_C(0) };
-
-# define SIMDE_F64_ALL_SET (simde_f64_all_set.f64)
-# define SIMDE_F64_ALL_UNSET (simde_f64_all_unset.f64)
-# define SIMDE_F32_ALL_SET (simde_f32_all_set.f32)
-# define SIMDE_F32_ALL_UNSET (simde_f32_all_unset.f32)
-#endif
+HEDLEY_ALWAYS_INLINE static
+simde_float32 simde_u32_to_f32(uint32_t val) {
+ union {
+ uint32_t u32;
+ simde_float32 f32;
+ } u;
+ u.u32 = val;
+ return u.f32;
+}
+
+HEDLEY_ALWAYS_INLINE static
+simde_float64 simde_u64_to_f64(uint64_t val) {
+ union {
+ uint64_t u64;
+ simde_float64 f64;
+ } u;
+ u.u64 = val;
+ return u.f64;
+}
+
+#define SIMDE_F32_ALL_SET (simde_u32_to_f32(~UINT32_C(0)))
+#define SIMDE_F32_ALL_UNSET (simde_u32_to_f32( UINT32_C(0)))
+#define SIMDE_F64_ALL_SET (simde_u64_to_f64(~UINT64_C(0)))
+#define SIMDE_F64_ALL_UNSET (simde_u64_to_f64( UINT64_C(0)))
#endif /* !defined(SIMDE_COMMON_H) */
=====================================
debian/include/simde/x86/avx.h
=====================================
@@ -1100,7 +1100,7 @@ simde_mm256_castpd_ps (simde__m256d a) {
#if defined(SIMDE_AVX_NATIVE)
return SIMDE__M256_FROM_NATIVE(_mm256_castpd_ps(a.n));
#else
- return *((simde__m256*) &a);
+ return *HEDLEY_REINTERPRET_CAST(simde__m256*, &a);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -1113,7 +1113,7 @@ simde_mm256_castpd_si256 (simde__m256d a) {
#if defined(SIMDE_AVX_NATIVE)
return SIMDE__M256I_FROM_NATIVE(_mm256_castpd_si256(a.n));
#else
- return *((simde__m256i*) &a);
+ return *HEDLEY_REINTERPRET_CAST(simde__m256i*, &a);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -1162,7 +1162,7 @@ simde_mm256_castps_pd (simde__m256 a) {
#if defined(SIMDE_AVX_NATIVE)
return SIMDE__M256D_FROM_NATIVE(_mm256_castps_pd(a.n));
#else
- return *((simde__m256d*) &a);
+ return *HEDLEY_REINTERPRET_CAST(simde__m256d*, &a);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -1175,7 +1175,7 @@ simde_mm256_castps_si256 (simde__m256 a) {
#if defined(SIMDE_AVX_NATIVE)
return SIMDE__M256I_FROM_NATIVE(_mm256_castps_si256(a.n));
#else
- return *((simde__m256i*) &a);
+ return *HEDLEY_REINTERPRET_CAST(simde__m256i*, &a);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -1260,7 +1260,7 @@ simde_mm256_castsi256_pd (simde__m256i a) {
#if defined(SIMDE_AVX_NATIVE)
return SIMDE__M256D_FROM_NATIVE(_mm256_castsi256_pd(a.n));
#else
- return *((simde__m256d*) &a);
+ return *HEDLEY_REINTERPRET_CAST(simde__m256d*, &a);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -1273,7 +1273,7 @@ simde_mm256_castsi256_ps (simde__m256i a) {
#if defined(SIMDE_AVX_NATIVE)
return SIMDE__M256_FROM_NATIVE(_mm256_castsi256_ps(a.n));
#else
- return *((simde__m256*) &a);
+ return *HEDLEY_REINTERPRET_CAST(simde__m256*, &a);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -1320,6 +1320,9 @@ simde_mm256_ceil_ps (simde__m256 a) {
# define _mm256_ceil_ps(a) SIMDE__M256_TO_NATIVE(simde_mm256_ceil_ps(SIMDE__M256_FROM_NATIVE(a)))
#endif
+HEDLEY_DIAGNOSTIC_PUSH
+SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL
+
/* This implementation does not support signaling NaNs (yet?) */
SIMDE__FUNCTION_ATTRIBUTES
simde__m128d
@@ -2457,6 +2460,8 @@ simde_mm256_cmp_ps (simde__m256 a, simde__m256 b, const int imm8)
# define _mm256_cmp_ps(a, b, imm8) SIMDE__M256_TO_NATIVE(simde_mm256_cmp_ps(SIMDE__M256_FROM_NATIVE(a), SIMDE__M256_FROM_NATIVE(b), imm8))
#endif
+HEDLEY_DIAGNOSTIC_POP /* -Wfloat-equal */
+
SIMDE__FUNCTION_ATTRIBUTES
simde__m256d
simde_mm256_cvtepi32_pd (simde__m128i a) {
@@ -2467,7 +2472,7 @@ simde_mm256_cvtepi32_pd (simde__m128i a) {
#else
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.f64) / sizeof(r.f64[0])) ; i++) {
- r.f64[i] = (simde_float64) a.i32[i];
+ r.f64[i] = HEDLEY_STATIC_CAST(simde_float64, a.i32[i]);
}
#endif
@@ -2487,7 +2492,7 @@ simde_mm256_cvtepi32_ps (simde__m256i a) {
#else
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.f32) / sizeof(r.f32[0])) ; i++) {
- r.f32[i] = (simde_float32) a.i32[i];
+ r.f32[i] = HEDLEY_STATIC_CAST(simde_float32, a.i32[i]);
}
#endif
@@ -2527,7 +2532,7 @@ simde_mm256_cvtpd_ps (simde__m256d a) {
#else
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.f32) / sizeof(r.f32[0])) ; i++) {
- r.f32[i] = (simde_float32) a.f64[i];
+ r.f32[i] = HEDLEY_STATIC_CAST(simde_float32, a.f64[i]);
}
#endif
@@ -2984,7 +2989,7 @@ simde_mm256_load_pd (const double a[HEDLEY_ARRAY_PARAM(4)]) {
#if defined(SIMDE_AVX_NATIVE)
r.n = _mm256_load_pd(a);
#else
- r = *SIMDE_CAST_ALIGN(32, simde__m256d*, a);
+ r = *SIMDE_CAST_ALIGN(32, simde__m256d const*, a);
#endif
return r;
@@ -3003,7 +3008,7 @@ simde_mm256_load_ps (const float a[HEDLEY_ARRAY_PARAM(8)]) {
#if defined(SIMDE_AVX_NATIVE)
r.n = _mm256_load_ps(a);
#else
- r = *SIMDE_CAST_ALIGN(32, simde__m256*, a);
+ r = *SIMDE_CAST_ALIGN(32, simde__m256 const*, a);
#endif
return r;
@@ -3125,7 +3130,7 @@ simde_mm_maskload_pd (const simde_float64 mem_addr[HEDLEY_ARRAY_PARAM(4)], simde
#else
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.f64) / sizeof(r.f64[0])) ; i++) {
- r.i64[i] = ((int64_t*) mem_addr)[i] & (mask.i64[i] >> 63);
+ r.i64[i] = HEDLEY_REINTERPRET_CAST(int64_t const*, mem_addr)[i] & (mask.i64[i] >> 63);
}
#endif
@@ -3145,7 +3150,7 @@ simde_mm256_maskload_pd (const simde_float64 mem_addr[HEDLEY_ARRAY_PARAM(4)], si
#else
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.f64) / sizeof(r.f64[0])) ; i++) {
- r.i64[i] = ((int64_t*) mem_addr)[i] & (mask.i64[i] >> 63);
+ r.i64[i] = HEDLEY_REINTERPRET_CAST(int64_t const*, mem_addr)[i] & (mask.i64[i] >> 63);
}
#endif
@@ -3165,7 +3170,7 @@ simde_mm_maskload_ps (const simde_float32 mem_addr[HEDLEY_ARRAY_PARAM(4)], simde
#else
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.f32) / sizeof(r.f32[0])) ; i++) {
- r.i32[i] = ((int32_t*) mem_addr)[i] & (mask.i32[i] >> 31);
+ r.i32[i] = HEDLEY_REINTERPRET_CAST(int32_t const*, mem_addr)[i] & (mask.i32[i] >> 31);
}
#endif
@@ -3185,7 +3190,7 @@ simde_mm256_maskload_ps (const simde_float32 mem_addr[HEDLEY_ARRAY_PARAM(4)], si
#else
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.f32) / sizeof(r.f32[0])) ; i++) {
- r.i32[i] = ((int32_t*) mem_addr)[i] & (mask.i32[i] >> 31);
+ r.i32[i] = HEDLEY_REINTERPRET_CAST(int32_t const*, mem_addr)[i] & (mask.i32[i] >> 31);
}
#endif
@@ -3293,7 +3298,7 @@ simde_mm256_min_pd (simde__m256d a, simde__m256d b) {
#if defined(SIMDE_AVX_NATIVE)
r.n = _mm256_min_pd(a.n,b.n);
-#elif defined(SIMDE_SSE_NATIVE)
+#elif defined(SIMDE_SSE2_NATIVE)
r.m128d[0].n = _mm_min_pd(a.m128d[0].n, b.m128d[0].n);
r.m128d[1].n = _mm_min_pd(a.m128d[1].n, b.m128d[1].n);
#else
@@ -3339,7 +3344,7 @@ simde_mm256_max_pd (simde__m256d a, simde__m256d b) {
#if defined(SIMDE_AVX_NATIVE)
r.n = _mm256_max_pd(a.n,b.n);
-#elif defined(SIMDE_SSE_NATIVE)
+#elif defined(SIMDE_SSE2_NATIVE)
r.m128d[0].n = _mm_max_pd(a.m128d[0].n, b.m128d[0].n);
r.m128d[1].n = _mm_max_pd(a.m128d[1].n, b.m128d[1].n);
#else
@@ -3493,7 +3498,7 @@ simde_mm256_mul_pd (simde__m256d a, simde__m256d b) {
#if defined(SIMDE_AVX_NATIVE)
r.n = _mm256_mul_pd(a.n,b.n);
-#elif defined(SIMDE_SSE_NATIVE)
+#elif defined(SIMDE_SSE2_NATIVE)
r.m128d[0].n = _mm_mul_pd(a.m128d[0].n, b.m128d[0].n);
r.m128d[1].n = _mm_mul_pd(a.m128d[1].n, b.m128d[1].n);
#elif defined(SIMDE__ENABLE_GCC_VEC_EXT)
@@ -3543,7 +3548,7 @@ simde_mm256_or_pd (simde__m256d a, simde__m256d b) {
#if defined(SIMDE_AVX_NATIVE)
r.n = _mm256_or_pd(a.n,b.n);
-#elif defined(SIMDE_SSE_NATIVE)
+#elif defined(SIMDE_SSE2_NATIVE)
r.m128d[0].n = _mm_or_pd(a.m128d[0].n, b.m128d[0].n);
r.m128d[1].n = _mm_or_pd(a.m128d[1].n, b.m128d[1].n);
#elif defined(SIMDE__ENABLE_GCC_VEC_EXT)
@@ -4688,7 +4693,7 @@ simde_mm_testc_ps (simde__m128 a, simde__m128 b) {
r |= ~a.u32[i] & b.u32[i];
}
- return (int) ((~r >> 31) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 31) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4708,7 +4713,7 @@ simde_mm_testc_pd (simde__m128d a, simde__m128d b) {
r |= ~a.u64[i] & b.u64[i];
}
- return (int) ((~r >> 63) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 63) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4728,7 +4733,7 @@ simde_mm256_testc_ps (simde__m256 a, simde__m256 b) {
r |= ~a.u32[i] & b.u32[i];
}
- return (int) ((~r >> 31) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 31) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4748,7 +4753,7 @@ simde_mm256_testc_pd (simde__m256d a, simde__m256d b) {
r |= ~a.u64[i] & b.u64[i];
}
- return (int) ((~r >> 63) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 63) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4768,7 +4773,7 @@ simde_mm256_testc_si256 (simde__m256i a, simde__m256i b) {
r |= ~a.i32f[i] & b.i32f[i];
}
- return (int) !r;
+ return HEDLEY_STATIC_CAST(int, !r);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4788,7 +4793,7 @@ simde_mm_testz_ps (simde__m128 a, simde__m128 b) {
r |= a.u32[i] & b.u32[i];
}
- return (int) ((~r >> 31) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 31) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4808,7 +4813,7 @@ simde_mm_testz_pd (simde__m128d a, simde__m128d b) {
r |= a.u64[i] & b.u64[i];
}
- return (int) ((~r >> 63) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 63) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4828,7 +4833,7 @@ simde_mm256_testz_ps (simde__m256 a, simde__m256 b) {
r |= a.u32[i] & b.u32[i];
}
- return (int) ((~r >> 31) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 31) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4848,7 +4853,7 @@ simde_mm256_testz_pd (simde__m256d a, simde__m256d b) {
r |= a.u64[i] & b.u64[i];
}
- return (int) ((~r >> 63) & 1);
+ return HEDLEY_STATIC_CAST(int, ((~r >> 63) & 1));
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
@@ -4868,7 +4873,7 @@ simde_mm256_testz_si256 (simde__m256i a, simde__m256i b) {
r |= a.i32f[i] & b.i32f[i];
}
- return (int) !r;
+ return HEDLEY_STATIC_CAST(int, !r);
#endif
}
#if defined(SIMDE_AVX_ENABLE_NATIVE_ALIASES)
=====================================
debian/include/simde/x86/mmx.h
=====================================
@@ -29,7 +29,7 @@
# if defined(SIMDE_MMX_FORCE_NATIVE)
# define SIMDE_MMX_NATIVE
-# elif defined(__MMX__) && !defined(SIMDE_MMX_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
+# elif (defined(__MMX__) || (defined(_MSC_VER) && defined(_M_IX86))) && !defined(SIMDE_MMX_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
# define SIMDE_MMX_NATIVE
# elif defined(__ARM_NEON) && !defined(SIMDE_MMX_NO_NEON) && !defined(SIMDE_NO_NEON)
# define SIMDE_MMX_NEON
@@ -101,6 +101,13 @@ typedef union {
#endif
HEDLEY_STATIC_ASSERT(8 == sizeof(simde__m64), "__m64 size incorrect");
+HEDLEY_DIAGNOSTIC_PUSH
+
+/* Function has no EMMS instruction */
+#if defined(HEDLEY_MSVC_VERSION)
+#pragma warning(disable:4799)
+#endif
+
#if defined(SIMDE_MMX_NATIVE)
SIMDE__FUNCTION_ATTRIBUTES simde__m64 SIMDE__M64_FROM_NATIVE(__m64 v) { simde__m64 r; r.n = v; return r; }
# define SIMDE__M64_TO_NATIVE(v) (v.n)
@@ -721,11 +728,19 @@ simde_mm_set_pi8 (int8_t e7, int8_t e6, int8_t e5, int8_t e4, int8_t e3, int8_t
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_x_mm_set_pu8 (uint8_t e7, uint8_t e6, uint8_t e5, uint8_t e4, uint8_t e3, uint8_t e2, uint8_t e1, uint8_t e0) {
+ simde__m64 r;
+
#if defined(SIMDE_MMX_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_set_pi8((int8_t) e7, (int8_t) e6, (int8_t) e5, (int8_t) e4,
- (int8_t) e3, (int8_t) e2, (int8_t) e1, (int8_t) e0));
+ r.n = _mm_set_pi8(
+ HEDLEY_STATIC_CAST(int8_t, e7),
+ HEDLEY_STATIC_CAST(int8_t, e6),
+ HEDLEY_STATIC_CAST(int8_t, e5),
+ HEDLEY_STATIC_CAST(int8_t, e4),
+ HEDLEY_STATIC_CAST(int8_t, e3),
+ HEDLEY_STATIC_CAST(int8_t, e2),
+ HEDLEY_STATIC_CAST(int8_t, e1),
+ HEDLEY_STATIC_CAST(int8_t, e0));
#else
- simde__m64 r;
r.u8[0] = e0;
r.u8[1] = e1;
r.u8[2] = e2;
@@ -734,8 +749,9 @@ simde_x_mm_set_pu8 (uint8_t e7, uint8_t e6, uint8_t e5, uint8_t e4, uint8_t e3,
r.u8[5] = e5;
r.u8[6] = e6;
r.u8[7] = e7;
- return r;
#endif
+
+ return r;
}
SIMDE__FUNCTION_ATTRIBUTES
@@ -759,29 +775,40 @@ simde_mm_set_pi16 (int16_t e3, int16_t e2, int16_t e1, int16_t e0) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_x_mm_set_pu16 (uint16_t e3, uint16_t e2, uint16_t e1, uint16_t e0) {
+ simde__m64 r;
+
#if defined(SIMDE_MMX_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_set_pi16((int16_t) e3, (int16_t) e2, (int16_t) e1, (int16_t) e0));
+ r.n = _mm_set_pi16(
+ HEDLEY_STATIC_CAST(int16_t, e3),
+ HEDLEY_STATIC_CAST(int16_t, e2),
+ HEDLEY_STATIC_CAST(int16_t, e1),
+ HEDLEY_STATIC_CAST(int16_t, e0)
+ );
#else
- simde__m64 r;
r.u16[0] = e0;
r.u16[1] = e1;
r.u16[2] = e2;
r.u16[3] = e3;
- return r;
#endif
+
+ return r;
}
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_x_mm_set_pu32 (uint32_t e1, uint32_t e0) {
+ simde__m64 r;
+
#if defined(SIMDE_MMX_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_set_pi32((int32_t) e1, (int32_t) e0));
+ r.n = _mm_set_pi32(
+ HEDLEY_STATIC_CAST(int32_t, e1),
+ HEDLEY_STATIC_CAST(int32_t, e0));
#else
- simde__m64 r;
r.u32[0] = e0;
r.u32[1] = e1;
- return r;
#endif
+
+ return r;
}
SIMDE__FUNCTION_ATTRIBUTES
@@ -1574,6 +1601,8 @@ simde_m_to_int (simde__m64 a) {
# define _m_to_int(a) simde_m_to_int(SIMDE__M64_FROM_NATIVE(a))
#endif
+HEDLEY_DIAGNOSTIC_POP
+
SIMDE__END_DECLS
#endif /* !defined(SIMDE__MMX_H) */
=====================================
debian/include/simde/x86/sse.h
=====================================
@@ -38,6 +38,10 @@
# define SIMDE_SSE_NATIVE
# elif defined(__SSE__) && !defined(SIMDE_SSE_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
# define SIMDE_SSE_NATIVE
+# elif defined(_M_IX86_FP) && !defined(SIMDE_SSE_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
+# if (_M_IX86_FP >= 1)
+# define SIMDE_SSE_NATIVE
+# endif
# elif defined(__ARM_NEON) && !defined(SIMDE_SSE_NO_NEON) && !defined(SIMDE_NO_NEON)
# define SIMDE_SSE_NEON
# endif
@@ -1584,7 +1588,7 @@ simde_mm_loadh_pi (simde__m128 a, simde__m64 const* mem_addr) {
simde__m128 r;
#if defined(SIMDE_SSE_NATIVE)
- r.n = _mm_loadh_pi(a.n, (__m64*) mem_addr);
+ r.n = _mm_loadh_pi(a.n, HEDLEY_REINTERPRET_CAST(__m64 const*, mem_addr));
#else
r.f32[0] = a.f32[0];
r.f32[1] = a.f32[1];
@@ -1604,7 +1608,7 @@ simde_mm_loadl_pi (simde__m128 a, simde__m64 const* mem_addr) {
simde__m128 r;
#if defined(SIMDE_SSE_NATIVE)
- r.n = _mm_loadl_pi(a.n, (__m64*) mem_addr);
+ r.n = _mm_loadl_pi(a.n, HEDLEY_REINTERPRET_CAST(__m64 const*, mem_addr));
#else
r.f32[0] = mem_addr->f32[0];
r.f32[1] = mem_addr->f32[1];
=====================================
debian/include/simde/x86/sse2.h
=====================================
@@ -2027,7 +2027,7 @@ simde_mm_extract_epi16 (simde__m128i a, const int imm8) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_insert_epi16 (simde__m128i a, int32_t i, const int imm8) {
- a.i16[imm8 & 7] = (int16_t) i;
+ a.i16[imm8 & 7] = HEDLEY_STATIC_CAST(int16_t, i);
return a;
}
#if defined(SIMDE_SSE2_NATIVE) && !defined(__PGI)
@@ -2270,7 +2270,7 @@ SIMDE__FUNCTION_ATTRIBUTES
void
simde_mm_maskmoveu_si128 (simde__m128i a, simde__m128i mask, int8_t mem_addr[HEDLEY_ARRAY_PARAM(16)]) {
#if defined(SIMDE_SSE2_NATIVE)
- _mm_maskmoveu_si128(a.n, mask.n, (char*) mem_addr);
+ _mm_maskmoveu_si128(a.n, mask.n, HEDLEY_REINTERPRET_CAST(char*, mem_addr));
#else
for (size_t i = 0 ; i < 16 ; i++) {
if (mask.u8[i] & 0x80) {
@@ -3821,7 +3821,7 @@ simde_mm_sra_epi32 (simde__m128i a, simde__m128i count) {
#if defined(SIMDE_SSE2_NATIVE) && !defined(SIMDE_BUG_GCC_BAD_MM_SRA_EPI32)
r.n = _mm_sra_epi32(a.n, count.n);
#else
- const int cnt = count.u64[0] > 31 ? 31 : ((int) count.u64[0]);
+ const int cnt = count.u64[0] > 31 ? 31 : HEDLEY_STATIC_CAST(int, count.u64[0]);
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i32) / sizeof(r.i32[0])) ; i++) {
@@ -3839,11 +3839,13 @@ SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_slli_epi16 (simde__m128i a, const int imm8) {
simde__m128i r;
- const int s = (imm8 > ((int) sizeof(r.i16[0]) * CHAR_BIT) - 1) ? 0 : imm8;
+
+ const int s = (imm8 > HEDLEY_STATIC_CAST(int, sizeof(r.i16[0]) * CHAR_BIT) - 1) ? 0 : imm8;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
- r.i16[i] = (int16_t) (a.i16[i] << s);
+ r.i16[i] = HEDLEY_STATIC_CAST(int16_t, a.i16[i] << s);
}
+
return r;
}
#if defined(SIMDE_SSE2_NATIVE)
@@ -3860,7 +3862,8 @@ SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_slli_epi32 (simde__m128i a, const int imm8) {
simde__m128i r;
- const int s = (imm8 > ((int) sizeof(r.i32[0]) * CHAR_BIT) - 1) ? 0 : imm8;
+
+ const int s = (imm8 > HEDLEY_STATIC_CAST(int, sizeof(r.i32[0]) * CHAR_BIT) - 1) ? 0 : imm8;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i32) / sizeof(r.i32[0])) ; i++) {
r.i32[i] = a.i32[i] << s;
@@ -3881,11 +3884,13 @@ SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_slli_epi64 (simde__m128i a, const int imm8) {
simde__m128i r;
- const int s = (imm8 > ((int) sizeof(r.i64[0]) * CHAR_BIT) - 1) ? 0 : imm8;
+
+ const int s = (imm8 > HEDLEY_STATIC_CAST(int, sizeof(r.i64[0]) * CHAR_BIT) - 1) ? 0 : imm8;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i64) / sizeof(r.i64[0])) ; i++) {
r.i64[i] = a.i64[i] << s;
}
+
return r;
}
#if defined(SIMDE_SSE2_NATIVE)
@@ -3899,11 +3904,13 @@ SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_srli_epi16 (simde__m128i a, const int imm8) {
simde__m128i r;
- const int s = (imm8 > ((int) sizeof(r.i16[0]) * CHAR_BIT) - 1) ? 0 : imm8;
+
+ const int s = (imm8 > HEDLEY_STATIC_CAST(int, sizeof(r.i16[0]) * CHAR_BIT) - 1) ? 0 : imm8;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
r.u16[i] = a.u16[i] >> s;
}
+
return r;
}
#if defined(SIMDE_SSE2_NATIVE)
@@ -3920,11 +3927,13 @@ SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_srli_epi32 (simde__m128i a, const int imm8) {
simde__m128i r;
- const int s = (imm8 > ((int) sizeof(r.i32[0]) * CHAR_BIT) - 1) ? 0 : imm8;
+
+ const int s = (imm8 > HEDLEY_STATIC_CAST(int, sizeof(r.i32[0]) * CHAR_BIT) - 1) ? 0 : imm8;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i32) / sizeof(r.i32[0])) ; i++) {
r.u32[i] = a.u32[i] >> s;
}
+
return r;
}
#if defined(SIMDE_SSE2_NATIVE)
@@ -4162,7 +4171,7 @@ simde_mm_stream_si64 (int64_t* mem_addr, int64_t a) {
#if \
(!defined(HEDLEY_GCC_VERSION) || HEDLEY_GCC_VERSION_CHECK(5,3,0)) && \
(!defined(HEDLEY_PGI_VERSION))
- _mm_stream_si64((long long*) mem_addr, a);
+ _mm_stream_si64(HEDLEY_REINTERPRET_CAST(long long*, mem_addr), a);
#else
*mem_addr = a;
#endif
=====================================
debian/include/simde/x86/sse4.1.h
=====================================
@@ -709,7 +709,7 @@ simde_mm_floor_ss (simde__m128 a, simde__m128 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_insert_epi8 (simde__m128i a, int i, const int imm8) {
- a.i8[imm8] = (int8_t) i;
+ a.i8[imm8] = HEDLEY_STATIC_CAST(int8_t, i);
return a;
}
#if defined(SIMDE_SSE4_1_NATIVE)
@@ -722,7 +722,7 @@ simde_mm_insert_epi8 (simde__m128i a, int i, const int imm8) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_insert_epi32 (simde__m128i a, int i, const int imm8) {
- a.i32[imm8] = (int32_t) i;
+ a.i32[imm8] = HEDLEY_STATIC_CAST(int32_t, i);
return a;
}
#if defined(SIMDE_SSE4_1_NATIVE)
@@ -938,7 +938,7 @@ simde_mm_minpos_epu16 (simde__m128i a) {
for (size_t i = 0 ; i < (sizeof(r.u16) / sizeof(r.u16[0])) ; i++) {
if (a.u16[i] < r.u16[0]) {
r.u16[0] = a.u16[i];
- r.u16[1] = (uint16_t) i;
+ r.u16[1] = HEDLEY_STATIC_CAST(uint16_t, i);
}
}
@@ -956,12 +956,12 @@ simde_mm_mpsadbw_epu8 (simde__m128i a, simde__m128i b, const int imm8) {
const int a_offset = imm8 & 4;
const int b_offset = (imm8 & 3) << 2;
- for (int i = 0 ; i < ((int) (sizeof(r.u16) / sizeof(r.u16[0]))) ; i++) {
+ for (int i = 0 ; i < HEDLEY_STATIC_CAST(int, (sizeof(r.u16) / sizeof(r.u16[0]))) ; i++) {
r.u16[i] =
- ((uint16_t) abs(a.u8[a_offset + i + 0] - b.u8[b_offset + 0])) +
- ((uint16_t) abs(a.u8[a_offset + i + 1] - b.u8[b_offset + 1])) +
- ((uint16_t) abs(a.u8[a_offset + i + 2] - b.u8[b_offset + 2])) +
- ((uint16_t) abs(a.u8[a_offset + i + 3] - b.u8[b_offset + 3]));
+ HEDLEY_STATIC_CAST(uint16_t, abs(a.u8[a_offset + i + 0] - b.u8[b_offset + 0])) +
+ HEDLEY_STATIC_CAST(uint16_t, abs(a.u8[a_offset + i + 1] - b.u8[b_offset + 1])) +
+ HEDLEY_STATIC_CAST(uint16_t, abs(a.u8[a_offset + i + 2] - b.u8[b_offset + 2])) +
+ HEDLEY_STATIC_CAST(uint16_t, abs(a.u8[a_offset + i + 3] - b.u8[b_offset + 3]));
}
return r;
@@ -983,8 +983,8 @@ simde_mm_mul_epi32 (simde__m128i a, simde__m128i b) {
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i64) / sizeof(r.i64[0])) ; i++) {
r.i64[i] =
- ((int64_t) a.i32[i * 2]) *
- ((int64_t) b.i32[i * 2]);
+ HEDLEY_STATIC_CAST(int64_t, a.i32[i * 2]) *
+ HEDLEY_STATIC_CAST(int64_t, b.i32[i * 2]);
}
return r;
#endif
@@ -1004,7 +1004,7 @@ simde_mm_mullo_epi32 (simde__m128i a, simde__m128i b) {
simde__m128i r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i32) / sizeof(r.i32[0])) ; i++) {
- r.u32[i] = (uint32_t) (((uint64_t) (((int64_t) a.i32[i]) * ((int64_t) b.i32[i]))) & 0xffffffff);
+ r.u32[i] = HEDLEY_STATIC_CAST(uint32_t, (HEDLEY_STATIC_CAST(uint64_t, (HEDLEY_STATIC_CAST(int64_t, a.i32[i]) * HEDLEY_STATIC_CAST(int64_t, b.i32[i]))) & 0xffffffff));
}
return r;
#endif
@@ -1021,8 +1021,8 @@ simde_mm_packus_epi32 (simde__m128i a, simde__m128i b) {
#else
simde__m128i r;
for (size_t i = 0 ; i < (sizeof(r.i32) / sizeof(r.i32[0])) ; i++) {
- r.u16[i + 0] = (a.i32[i] < 0) ? UINT16_C(0) : ((a.i32[i] > UINT16_MAX) ? (UINT16_MAX) : ((uint16_t) a.i32[i]));
- r.u16[i + 4] = (b.i32[i] < 0) ? UINT16_C(0) : ((b.i32[i] > UINT16_MAX) ? (UINT16_MAX) : ((uint16_t) b.i32[i]));
+ r.u16[i + 0] = (a.i32[i] < 0) ? UINT16_C(0) : ((a.i32[i] > UINT16_MAX) ? (UINT16_MAX) : HEDLEY_STATIC_CAST(uint16_t, a.i32[i]));
+ r.u16[i + 4] = (b.i32[i] < 0) ? UINT16_C(0) : ((b.i32[i] > UINT16_MAX) ? (UINT16_MAX) : HEDLEY_STATIC_CAST(uint16_t, b.i32[i]));
}
return r;
#endif
@@ -1171,7 +1171,7 @@ SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_stream_load_si128 (const simde__m128i* mem_addr) {
#if defined(SIMDE_SSE4_1_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_stream_load_si128((__m128i*)(void*) &(mem_addr->n)));
+ return SIMDE__M128I_FROM_NATIVE(_mm_stream_load_si128(HEDLEY_CONST_CAST(__m128i*, &(mem_addr->n))));
#else
return *mem_addr;
#endif
@@ -1243,7 +1243,7 @@ simde_mm_testc_si128 (simde__m128i a, simde__m128i b) {
r |= ~a.i32f[i] & b.i32f[i];
}
- return (int) !r;
+ return HEDLEY_STATIC_CAST(int, !r);
#endif
}
#if defined(SIMDE_SSE4_1_ENABLE_NATIVE_ALIASES)
=====================================
debian/include/simde/x86/ssse3.h
=====================================
@@ -67,16 +67,18 @@ SIMDE__BEGIN_DECLS
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_abs_epi8 (simde__m128i a) {
+ simde__m128i r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_abs_epi8(a.n));
+ r.n = _mm_abs_epi8(a.n);
#else
- simde__m128i r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i8) / sizeof(r.i8[0])) ; i++) {
- r.u8[i] = (uint8_t) ((a.i8[i] < 0) ? (- a.i8[i]) : a.i8[i]);
+ r.u8[i] = HEDLEY_STATIC_CAST(uint8_t, (a.i8[i] < 0) ? (- a.i8[i]) : a.i8[i]);
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_abs_epi8(a) SIMDE__M128I_TO_NATIVE(simde_mm_abs_epi8(SIMDE__M128I_FROM_NATIVE(a)))
@@ -85,16 +87,18 @@ simde_mm_abs_epi8 (simde__m128i a) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_abs_epi16 (simde__m128i a) {
+ simde__m128i r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_abs_epi16(a.n));
+ r.n = _mm_abs_epi16(a.n);
#else
- simde__m128i r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
- r.u16[i] = (uint16_t) ((a.i16[i] < 0) ? (- a.i16[i]) : a.i16[i]);
+ r.u16[i] = HEDLEY_STATIC_CAST(uint16_t, (a.i16[i] < 0) ? (- a.i16[i]) : a.i16[i]);
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_abs_epi16(a) SIMDE__M128I_TO_NATIVE(simde_mm_abs_epi16(SIMDE__M128I_FROM_NATIVE(a)))
@@ -103,16 +107,18 @@ simde_mm_abs_epi16 (simde__m128i a) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_abs_epi32 (simde__m128i a) {
+ simde__m128i r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_abs_epi32(a.n));
+ r.n = _mm_abs_epi32(a.n);
#else
- simde__m128i r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i32) / sizeof(r.i32[0])) ; i++) {
- r.u32[i] = (uint32_t) ((a.i32[i] < 0) ? (- a.i32[i]) : a.i32[i]);
+ r.u32[i] = HEDLEY_STATIC_CAST(uint32_t, (a.i32[i] < 0) ? (- a.i32[i]) : a.i32[i]);
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_abs_epi32(a) SIMDE__M128I_TO_NATIVE(simde_mm_abs_epi32(SIMDE__M128I_FROM_NATIVE(a)))
@@ -121,16 +127,18 @@ simde_mm_abs_epi32 (simde__m128i a) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_abs_pi8 (simde__m64 a) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_abs_pi8(a.n));
+ r.n = _mm_abs_pi8(a.n);
#else
- simde__m64 r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i8) / sizeof(r.i8[0])) ; i++) {
- r.u8[i] = (uint8_t) ((a.i8[i] < 0) ? (- a.i8[i]) : a.i8[i]);
+ r.u8[i] = HEDLEY_STATIC_CAST(uint8_t, (a.i8[i] < 0) ? (- a.i8[i]) : a.i8[i]);
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_abs_pi8(a) SIMDE__M64_TO_NATIVE(simde_mm_abs_pi8(SIMDE__M64_FROM_NATIVE(a)))
@@ -139,16 +147,18 @@ simde_mm_abs_pi8 (simde__m64 a) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_abs_pi16 (simde__m64 a) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_abs_pi16(a.n));
+ r.n = _mm_abs_pi16(a.n);
#else
- simde__m64 r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
- r.u16[i] = (uint16_t) ((a.i16[i] < 0) ? (- a.i16[i]) : a.i16[i]);
+ r.u16[i] = HEDLEY_STATIC_CAST(uint16_t, (a.i16[i] < 0) ? (- a.i16[i]) : a.i16[i]);
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_abs_pi16(a) SIMDE__M64_TO_NATIVE(simde_mm_abs_pi16(SIMDE__M64_FROM_NATIVE(a)))
@@ -157,16 +167,18 @@ simde_mm_abs_pi16 (simde__m64 a) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_abs_pi32 (simde__m64 a) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_abs_pi32(a.n));
+ r.n = _mm_abs_pi32(a.n);
#else
- simde__m64 r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i32) / sizeof(r.i32[0])) ; i++) {
- r.u32[i] = (uint32_t) ((a.i32[i] < 0) ? (- a.i32[i]) : a.i32[i]);
+ r.u32[i] = HEDLEY_STATIC_CAST(uint32_t, (a.i32[i] < 0) ? (- a.i32[i]) : a.i32[i]);
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_abs_pi32(a) SIMDE__M64_TO_NATIVE(simde_mm_abs_pi32(SIMDE__M64_FROM_NATIVE(a)))
@@ -225,12 +237,16 @@ SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_alignr_pi8 (simde__m64 a, simde__m64 b, const int count) {
simde__m64 r;
-#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__SIZEOF_INT128__)
+
+#if defined(SIMDE__HAVE_INT128)
+HEDLEY_DIAGNOSTIC_PUSH
+SIMDE_DIAGNOSTIC_DISABLE_INT128
unsigned __int128 t = a.u64[0];
t <<= 64;
t |= b.u64[0];
t >>= count * 8;
- r.u64[0] = (uint64_t) t;
+ r.u64[0] = HEDLEY_STATIC_CAST(uint64_t, t);
+HEDLEY_DIAGNOSTIC_POP
#else
const int cb = count * 8;
@@ -240,6 +256,7 @@ simde_mm_alignr_pi8 (simde__m64 a, simde__m64 b, const int count) {
r.u64[0] = (a.u64[0] << (64 - cb)) | (b.u64[0] >> cb);
}
#endif
+
return r;
}
#if defined(SIMDE_SSSE3_NATIVE)
@@ -350,16 +367,16 @@ simde_mm_hadd_pi16 (simde__m64 a, simde__m64 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_hadd_pi32 (simde__m64 a, simde__m64 b) {
-#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_hadd_pi32(a.n, b.n));
-#else
simde__m64 r;
+#if defined(SIMDE_SSSE3_NATIVE)
+ r.n = _mm_hadd_pi32(a.n, b.n);
+#else
r.i32[0] = a.i32[0] + a.i32[1];
r.i32[1] = b.i32[0] + b.i32[1];
+#endif
return r;
-#endif
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_hadd_pi32(a, b) SIMDE__M64_TO_NATIVE(simde_mm_hadd_pi32(SIMDE__M64_FROM_NATIVE(a), SIMDE__M64_FROM_NATIVE(b)))
@@ -368,18 +385,20 @@ simde_mm_hadd_pi32 (simde__m64 a, simde__m64 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_hadds_epi16 (simde__m128i a, simde__m128i b) {
+ simde__m128i r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_hadds_epi16(a.n, b.n));
+ r.n = _mm_hadds_epi16(a.n, b.n);
#else
- simde__m128i r;
for (size_t i = 0 ; i < ((sizeof(r.i16) / sizeof(r.i16[0])) / 2) ; i++) {
- int32_t ta = ((int32_t) a.i16[i * 2]) + ((int32_t) a.i16[(i * 2) + 1]);
- r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? ((int16_t) ta) : INT16_MAX) : INT16_MIN;
- int32_t tb = ((int32_t) b.i16[i * 2]) + ((int32_t) b.i16[(i * 2) + 1]);
- r.i16[i + 4] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? ((int16_t) tb) : INT16_MAX) : INT16_MIN;
+ int32_t ta = HEDLEY_STATIC_CAST(int32_t, a.i16[i * 2]) + HEDLEY_STATIC_CAST(int32_t, a.i16[(i * 2) + 1]);
+ r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, ta) : INT16_MAX) : INT16_MIN;
+ int32_t tb = HEDLEY_STATIC_CAST(int32_t, b.i16[i * 2]) + HEDLEY_STATIC_CAST(int32_t, b.i16[(i * 2) + 1]);
+ r.i16[i + 4] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, tb) : INT16_MAX) : INT16_MIN;
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_hadds_epi16(a, b) SIMDE__M128I_TO_NATIVE(simde_mm_hadds_epi16(SIMDE__M128I_FROM_NATIVE(a), SIMDE__M128I_FROM_NATIVE(b)))
@@ -388,18 +407,20 @@ simde_mm_hadds_epi16 (simde__m128i a, simde__m128i b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_hadds_pi16 (simde__m64 a, simde__m64 b) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_hadds_pi16(a.n, b.n));
+ r.n = _mm_hadds_pi16(a.n, b.n);
#else
- simde__m64 r;
for (size_t i = 0 ; i < ((sizeof(r.i16) / sizeof(r.i16[0])) / 2) ; i++) {
- int32_t ta = ((int32_t) a.i16[i * 2]) + ((int32_t) a.i16[(i * 2) + 1]);
- r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? ((int16_t) ta) : INT16_MAX) : INT16_MIN;
- int32_t tb = ((int32_t) b.i16[i * 2]) + ((int32_t) b.i16[(i * 2) + 1]);
- r.i16[i + 2] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? ((int16_t) tb) : INT16_MAX) : INT16_MIN;
+ int32_t ta = HEDLEY_STATIC_CAST(int32_t, a.i16[i * 2]) + HEDLEY_STATIC_CAST(int32_t, a.i16[(i * 2) + 1]);
+ r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, ta) : INT16_MAX) : INT16_MIN;
+ int32_t tb = HEDLEY_STATIC_CAST(int32_t, b.i16[i * 2]) + HEDLEY_STATIC_CAST(int32_t, b.i16[(i * 2) + 1]);
+ r.i16[i + 2] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, tb) : INT16_MAX) : INT16_MIN;
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_hadds_pi16(a, b) SIMDE__M64_TO_NATIVE(simde_mm_hadds_pi16(SIMDE__M64_FROM_NATIVE(a), SIMDE__M64_FROM_NATIVE(b)))
@@ -472,16 +493,16 @@ simde_mm_hsub_pi16 (simde__m64 a, simde__m64 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_hsub_pi32 (simde__m64 a, simde__m64 b) {
-#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_hsub_pi32(a.n, b.n));
-#else
simde__m64 r;
+#if defined(SIMDE_SSSE3_NATIVE)
+ r.n = _mm_hsub_pi32(a.n, b.n);
+#else
r.i32[0] = a.i32[0] - a.i32[1];
r.i32[1] = b.i32[0] - b.i32[1];
+#endif
return r;
-#endif
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_hsub_pi32(a, b) SIMDE__M64_TO_NATIVE(simde_mm_hsub_pi32(SIMDE__M64_FROM_NATIVE(a), SIMDE__M64_FROM_NATIVE(b)))
@@ -490,18 +511,20 @@ simde_mm_hsub_pi32 (simde__m64 a, simde__m64 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_hsubs_epi16 (simde__m128i a, simde__m128i b) {
+ simde__m128i r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_hsubs_epi16(a.n, b.n));
+ r.n = _mm_hsubs_epi16(a.n, b.n);
#else
- simde__m128i r;
for (size_t i = 0 ; i < ((sizeof(r.i16) / sizeof(r.i16[0])) / 2) ; i++) {
- int32_t ta = ((int32_t) a.i16[i * 2]) - ((int32_t) a.i16[(i * 2) + 1]);
- r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? ((int16_t) ta) : INT16_MAX) : INT16_MIN;
- int32_t tb = ((int32_t) b.i16[i * 2]) - ((int32_t) b.i16[(i * 2) + 1]);
- r.i16[i + 4] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? ((int16_t) tb) : INT16_MAX) : INT16_MIN;
+ int32_t ta = HEDLEY_STATIC_CAST(int32_t, a.i16[i * 2]) - HEDLEY_STATIC_CAST(int32_t, a.i16[(i * 2) + 1]);
+ r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, ta) : INT16_MAX) : INT16_MIN;
+ int32_t tb = HEDLEY_STATIC_CAST(int32_t, b.i16[i * 2]) - HEDLEY_STATIC_CAST(int32_t, b.i16[(i * 2) + 1]);
+ r.i16[i + 4] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, tb) : INT16_MAX) : INT16_MIN;
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_hsubs_epi16(a, b) SIMDE__M128I_TO_NATIVE(simde_mm_hsubs_epi16(SIMDE__M128I_FROM_NATIVE(a), SIMDE__M128I_FROM_NATIVE(b)))
@@ -510,18 +533,20 @@ simde_mm_hsubs_epi16 (simde__m128i a, simde__m128i b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_hsubs_pi16 (simde__m64 a, simde__m64 b) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_hsubs_pi16(a.n, b.n));
+ r.n = _mm_hsubs_pi16(a.n, b.n);
#else
- simde__m64 r;
for (size_t i = 0 ; i < ((sizeof(r.i16) / sizeof(r.i16[0])) / 2) ; i++) {
- int32_t ta = ((int32_t) a.i16[i * 2]) - ((int32_t) a.i16[(i * 2) + 1]);
- r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? ((int16_t) ta) : INT16_MAX) : INT16_MIN;
- int32_t tb = ((int32_t) b.i16[i * 2]) - ((int32_t) b.i16[(i * 2) + 1]);
- r.i16[i + 2] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? ((int16_t) tb) : INT16_MAX) : INT16_MIN;
+ int32_t ta = HEDLEY_STATIC_CAST(int32_t, a.i16[i * 2]) - HEDLEY_STATIC_CAST(int32_t, a.i16[(i * 2) + 1]);
+ r.i16[ i ] = HEDLEY_LIKELY(ta > INT16_MIN) ? (HEDLEY_LIKELY(ta < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, ta) : INT16_MAX) : INT16_MIN;
+ int32_t tb = HEDLEY_STATIC_CAST(int32_t, b.i16[i * 2]) - HEDLEY_STATIC_CAST(int32_t, b.i16[(i * 2) + 1]);
+ r.i16[i + 2] = HEDLEY_LIKELY(tb > INT16_MIN) ? (HEDLEY_LIKELY(tb < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, tb) : INT16_MAX) : INT16_MIN;
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_hsubs_pi16(a, b) SIMDE__M64_TO_NATIVE(simde_mm_hsubs_pi16(SIMDE__M64_FROM_NATIVE(a), SIMDE__M64_FROM_NATIVE(b)))
@@ -530,19 +555,21 @@ simde_mm_hsubs_pi16 (simde__m64 a, simde__m64 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_maddubs_epi16 (simde__m128i a, simde__m128i b) {
+ simde__m128i r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_maddubs_epi16(a.n, b.n));
+ r.n = _mm_maddubs_epi16(a.n, b.n);
#else
- simde__m128i r;
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
- const int idx = ((int) i) << 1;
+ const int idx = HEDLEY_STATIC_CAST(int, i) << 1;
int32_t ts =
- (((int16_t) a.u8[ idx ]) * ((int16_t) b.i8[ idx ])) +
- (((int16_t) a.u8[idx + 1]) * ((int16_t) b.i8[idx + 1]));
- r.i16[i] = HEDLEY_LIKELY(ts > INT16_MIN) ? (HEDLEY_LIKELY(ts < INT16_MAX) ? ((int16_t) ts) : INT16_MAX) : INT16_MIN;
+ (HEDLEY_STATIC_CAST(int16_t, a.u8[ idx ]) * HEDLEY_STATIC_CAST(int16_t, b.i8[ idx ])) +
+ (HEDLEY_STATIC_CAST(int16_t, a.u8[idx + 1]) * HEDLEY_STATIC_CAST(int16_t, b.i8[idx + 1]));
+ r.i16[i] = HEDLEY_LIKELY(ts > INT16_MIN) ? (HEDLEY_LIKELY(ts < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, ts) : INT16_MAX) : INT16_MIN;
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_maddubs_epi16(a, b) SIMDE__M128I_TO_NATIVE(simde_mm_maddubs_epi16(SIMDE__M128I_FROM_NATIVE(a), SIMDE__M128I_FROM_NATIVE(b)))
@@ -551,19 +578,21 @@ simde_mm_maddubs_epi16 (simde__m128i a, simde__m128i b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_maddubs_pi16 (simde__m64 a, simde__m64 b) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_maddubs_pi16(a.n, b.n));
+ r.n = _mm_maddubs_pi16(a.n, b.n);
#else
- simde__m64 r;
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
- const int idx = ((int) i) << 1;
+ const int idx = HEDLEY_STATIC_CAST(int, i) << 1;
int32_t ts =
- (((int16_t) a.u8[ idx ]) * ((int16_t) b.i8[ idx ])) +
- (((int16_t) a.u8[idx + 1]) * ((int16_t) b.i8[idx + 1]));
- r.i16[i] = HEDLEY_LIKELY(ts > INT16_MIN) ? (HEDLEY_LIKELY(ts < INT16_MAX) ? ((int16_t) ts) : INT16_MAX) : INT16_MIN;
+ (HEDLEY_STATIC_CAST(int16_t, a.u8[ idx ]) * HEDLEY_STATIC_CAST(int16_t, b.i8[ idx ])) +
+ (HEDLEY_STATIC_CAST(int16_t, a.u8[idx + 1]) * HEDLEY_STATIC_CAST(int16_t, b.i8[idx + 1]));
+ r.i16[i] = HEDLEY_LIKELY(ts > INT16_MIN) ? (HEDLEY_LIKELY(ts < INT16_MAX) ? HEDLEY_STATIC_CAST(int16_t, ts) : INT16_MAX) : INT16_MIN;
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_maddubs_pi16(a, b) SIMDE__M64_TO_NATIVE(simde_mm_maddubs_pi16(SIMDE__M64_FROM_NATIVE(a), SIMDE__M64_FROM_NATIVE(b)))
@@ -572,16 +601,18 @@ simde_mm_maddubs_pi16 (simde__m64 a, simde__m64 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m128i
simde_mm_mulhrs_epi16 (simde__m128i a, simde__m128i b) {
+ simde__m128i r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M128I_FROM_NATIVE(_mm_mulhrs_epi16(a.n, b.n));
+ r.n = _mm_mulhrs_epi16(a.n, b.n);
#else
- simde__m128i r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
- r.i16[i] = (int16_t) (((((int32_t) a.i16[i]) * ((int32_t) b.i16[i])) + 0x4000) >> 15);
+ r.i16[i] = HEDLEY_STATIC_CAST(int16_t, (((HEDLEY_STATIC_CAST(int32_t, a.i16[i]) * HEDLEY_STATIC_CAST(int32_t, b.i16[i])) + 0x4000) >> 15));
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_mulhrs_epi16(a, b) SIMDE__M128I_TO_NATIVE(simde_mm_mulhrs_epi16(SIMDE__M128I_FROM_NATIVE(a), SIMDE__M128I_FROM_NATIVE(b)))
@@ -590,16 +621,18 @@ simde_mm_mulhrs_epi16 (simde__m128i a, simde__m128i b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_mulhrs_pi16 (simde__m64 a, simde__m64 b) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_mulhrs_pi16(a.n, b.n));
+ r.n = _mm_mulhrs_pi16(a.n, b.n);
#else
- simde__m64 r;
SIMDE__VECTORIZE
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
- r.i16[i] = (int16_t) (((((int32_t) a.i16[i]) * ((int32_t) b.i16[i])) + 0x4000) >> 15);
+ r.i16[i] = HEDLEY_STATIC_CAST(int16_t, (((HEDLEY_STATIC_CAST(int32_t, a.i16[i]) * HEDLEY_STATIC_CAST(int32_t, b.i16[i])) + 0x4000) >> 15));
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_mulhrs_pi16(a, b) SIMDE__M64_TO_NATIVE(simde_mm_mulhrs_pi16(SIMDE__M64_FROM_NATIVE(a), SIMDE__M64_FROM_NATIVE(b)))
@@ -676,15 +709,17 @@ simde_mm_sign_pi8 (simde__m64 a, simde__m64 b) {
SIMDE__FUNCTION_ATTRIBUTES
simde__m64
simde_mm_sign_pi16 (simde__m64 a, simde__m64 b) {
+ simde__m64 r;
+
#if defined(SIMDE_SSSE3_NATIVE)
- return SIMDE__M64_FROM_NATIVE(_mm_sign_pi16(a.n, b.n));
+ r.n = _mm_sign_pi16(a.n, b.n);
#else
- simde__m64 r;
for (size_t i = 0 ; i < (sizeof(r.i16) / sizeof(r.i16[0])) ; i++) {
r.i16[i] = (b.i16[i] < 0) ? (- a.i16[i]) : ((b.i16[i] > 0) ? (a.i16[i]) : INT16_C(0));
}
- return r;
#endif
+
+ return r;
}
#if defined(SIMDE_SSSE3_ENABLE_NATIVE_ALIASES)
# define _mm_sign_pi16(a, b) SIMDE__M64_TO_NATIVE(simde_mm_sign_pi16(SIMDE__M64_FROM_NATIVE(a), SIMDE__M64_FROM_NATIVE(b)))
View it on GitLab: https://salsa.debian.org/med-team/last-align/commit/0bc287544d762a5cb34df985396271263c23cdb4
--
View it on GitLab: https://salsa.debian.org/med-team/last-align/commit/0bc287544d762a5cb34df985396271263c23cdb4
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20191220/938e2a1d/attachment-0001.html>
More information about the debian-med-commit
mailing list