comparison src/impl/x86/avx512f.c @ 24:e49e70f7012f

impl/x86: add static assertions for alignment and size
author Paper <paper@tflc.us>
date Sun, 24 Nov 2024 03:32:53 -0500
parents e26874655738
children
comparison
equal deleted inserted replaced
23:e26874655738 24:e49e70f7012f
223 #define VEC_AVX512F_DEFINE_OPERATIONS_SIGN(sign, bits, size) \ 223 #define VEC_AVX512F_DEFINE_OPERATIONS_SIGN(sign, bits, size) \
224 union v##sign##int##bits##x##size##_impl_data { \ 224 union v##sign##int##bits##x##size##_impl_data { \
225 v##sign##int##bits##x##size vec; \ 225 v##sign##int##bits##x##size vec; \
226 __m512i avx512f; \ 226 __m512i avx512f; \
227 }; \ 227 }; \
228 \
229 VEC_STATIC_ASSERT(VEC_ALIGNOF(__m512i) <= VEC_ALIGNOF(v##sign##int##bits##x##size), "vec: v" #sign "int" #bits "x" #size " alignment needs to be expanded to fit intrinsic type size"); \
230 VEC_STATIC_ASSERT(sizeof(__m512i) <= sizeof(v##sign##int##bits##x##size), "vec: v" #sign "int" #bits "x" #size " needs to be expanded to fit intrinsic type size"); \
228 \ 231 \
229 static v##sign##int##bits##x##size v##sign##int##bits##x##size##_avx512f_load_aligned(const vec_##sign##int##bits in[size]) \ 232 static v##sign##int##bits##x##size v##sign##int##bits##x##size##_avx512f_load_aligned(const vec_##sign##int##bits in[size]) \
230 { \ 233 { \
231 union v##sign##int##bits##x##size##_impl_data vec; \ 234 union v##sign##int##bits##x##size##_impl_data vec; \
232 vec.avx512f = _mm512_load_si512((const __m512i *)in); \ 235 vec.avx512f = _mm512_load_si512((const __m512i *)in); \