# endif
#endif
+/* Intrinsics macros start. */
+
#if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET)
# define ZEND_INTRIN_HAVE_IFUNC_TARGET 1
#endif
# define ZEND_INTRIN_SSE4_2_FUNC_PTR 1
#endif
+#if ZEND_INTRIN_SSE4_2_RESOLVER
+# if defined(HAVE_FUNC_ATTRIBUTE_TARGET)
+# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) ZEND_API func __attribute__((target("sse4.2")))
+# else
+# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) func
+# endif
+#else
+# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func)
+#endif
+
+/* Intrinsics macros end. */
+
#ifdef ZEND_WIN32
# define ZEND_SET_ALIGNED(alignment, decl) __declspec(align(alignment)) decl
#elif HAVE_ATTRIBUTE_ALIGNED
# include "Zend/zend_bitset.h"
# include "Zend/zend_cpuinfo.h"
+ZEND_INTRIN_SSE4_2_FUNC_DECL(zend_string *php_addslashes_sse42(zend_string *str, int should_free));
+zend_string *php_addslashes_default(zend_string *str, int should_free);
+
# if ZEND_INTRIN_SSE4_2_FUNC_PROTO
PHPAPI zend_string *php_addslashes(zend_string *str, int should_free) __attribute__((ifunc("resolve_addslashes")));
-zend_string *php_addslashes_sse42(zend_string *str, int should_free) __attribute__((target("sse4.2")));
-zend_string *php_addslashes_default(zend_string *str, int should_free);
static void *resolve_addslashes() {
if (zend_cpu_supports(ZEND_CPU_FEATURE_SSE42)) {
return php_addslashes_default;
}
# else /* ZEND_INTRIN_SSE4_2_FUNC_PTR */
-zend_string *php_addslashes_sse42(zend_string *str, int should_free);
-zend_string *php_addslashes_default(zend_string *str, int should_free);
PHPAPI zend_string *(*php_addslashes)(zend_string *str, int should_free) = NULL;