mirror of
https://github.com/php/php-src.git
synced 2024-11-23 09:54:15 +08:00
Sync #if/ifdef/defined (#14511)
These are either undefined or defined to value 1: - ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE - ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER - ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PROTO - ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PTR Follow up of GH-5526 (-Wundef)
This commit is contained in:
parent
01887afdfa
commit
0dcb467dae
@ -29,7 +29,7 @@ PHP_HASH_API void PHP_CRC32Update(PHP_CRC32_CTX *context, const unsigned char *i
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE) || defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
|
||||
i += crc32_x86_simd_update(X86_CRC32, &context->state, input, len);
|
||||
#endif
|
||||
|
||||
@ -42,7 +42,7 @@ PHP_HASH_API void PHP_CRC32BUpdate(PHP_CRC32_CTX *context, const unsigned char *
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE) || defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
|
||||
i += crc32_x86_simd_update(X86_CRC32B, &context->state, input, len);
|
||||
#endif
|
||||
|
||||
@ -55,7 +55,7 @@ PHP_HASH_API void PHP_CRC32CUpdate(PHP_CRC32_CTX *context, const unsigned char *
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE) || defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
|
||||
i += crc32_x86_simd_update(X86_CRC32C, &context->state, input, len);
|
||||
#endif
|
||||
|
||||
|
@ -115,7 +115,7 @@ PHPAPI uint32_t php_crc32_bulk_update(uint32_t crc, const char *p, size_t nr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE) || defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
|
||||
size_t nr_simd = crc32_x86_simd_update(X86_CRC32B, &crc, (const unsigned char *)p, nr);
|
||||
nr -= nr_simd;
|
||||
p += nr_simd;
|
||||
|
@ -19,16 +19,16 @@
|
||||
|
||||
#include "crc32_x86.h"
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE) || defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
|
||||
# include <nmmintrin.h>
|
||||
# include <wmmintrin.h>
|
||||
#endif
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#ifdef ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
# include "Zend/zend_cpuinfo.h"
|
||||
#endif
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE) || defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
|
||||
|
||||
typedef struct _crc32_pclmul_bit_consts {
|
||||
uint64_t k1k2[2];
|
||||
@ -287,7 +287,7 @@ size_t crc32_pclmul_reflected_batch(uint32_t *crc, const unsigned char *p, size_
|
||||
return (nr_in - nr); /* the nr processed */
|
||||
}
|
||||
|
||||
# if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE
|
||||
# if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE)
|
||||
size_t crc32_x86_simd_update(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr)
|
||||
# else /* ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER */
|
||||
size_t crc32_sse42_pclmul_update(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr)
|
||||
@ -310,13 +310,13 @@ size_t crc32_sse42_pclmul_update(X86_CRC32_TYPE type, uint32_t *crc, const unsig
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#ifdef ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
static size_t crc32_x86_simd_update_default(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
# if ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PROTO
|
||||
# ifdef ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PROTO
|
||||
size_t crc32_x86_simd_update(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr) __attribute__((ifunc("resolve_crc32_x86_simd_update")));
|
||||
|
||||
typedef size_t (*crc32_x86_simd_func_t)(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr);
|
||||
|
@ -35,11 +35,11 @@ typedef enum {
|
||||
X86_CRC32_MAX,
|
||||
} X86_CRC32_TYPE;
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PTR
|
||||
#ifdef ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PTR
|
||||
PHP_MINIT_FUNCTION(crc32_x86_intrin);
|
||||
#endif
|
||||
|
||||
#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER
|
||||
#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE) || defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER)
|
||||
/* Return the size processed by SIMD routine */
|
||||
size_t crc32_x86_simd_update(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user