I am using Intel Intrinsics and getting this odd error.
src/header/header.c:18:3: error: can’t convert value to a vector
18 | int has_value = (int)_mm_cmpestrc(buffer, 4, u_str.vec, 4,
| ^~~
I have tried the below without the (int)
cast, i have tried with <nmmintrin.h>
as well
#include "./header.h"
#ifdef __SIMD__
#include <x86intrin.h>
#endif
static inline void parse_with_simd(const char *buffer, const int buffer_len) {
union {
__m128i vec;
char * str;
} u_str = {.str = "GET "};
int has_value = (int)_mm_cmpestrc(buffer, 4, u_str.vec, 4,
_SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_EACH); // <-- this line
My CPPFLAGS and CFLAGS
CFLAGS = -Wall -O0 -std=c11 -g
CPPFLAGS = -DDEBUG -D__SIMD__
When I look at the definition of _mm_cmpstrc it shows the return type is an int too!
#define _mm_cmpestrc(A, LA, B, LB, M) \
(int)__builtin_ia32_pcmpestric128((__v16qi)(__m128i)(A), (int)(LA), \
(__v16qi)(__m128i)(B), (int)(LB), \
(int)(M))