Mercurial > vec
diff src/impl/x86/sse2.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 |
line wrap: on
line diff
--- a/src/impl/x86/sse2.c Sun Nov 24 02:52:40 2024 -0500 +++ b/src/impl/x86/sse2.c Sun Nov 24 03:32:53 2024 -0500 @@ -148,6 +148,9 @@ __m128i sse; \ }; \ \ + VEC_STATIC_ASSERT(VEC_ALIGNOF(__m128i) <= 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"); \ + VEC_STATIC_ASSERT(sizeof(__m128i) <= sizeof(v##sign##int##bits##x##size), "vec: v" #sign "int" #bits "x" #size " needs to be expanded to fit intrinsic type size"); \ + \ v##sign##int##bits##x##size v##sign##int##bits##x##size##_sse2_load_aligned(const vec_##sign##int##bits in[size]) \ { \ union v##sign##int##bits##x##size##_impl_data vec; \