Mercurial > vec
comparison src/impl/x86/sse41.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 |
---|---|
33 union v##sign##int32x4_impl_data { \ | 33 union v##sign##int32x4_impl_data { \ |
34 v##sign##int32x4 vec; \ | 34 v##sign##int32x4 vec; \ |
35 __m128i sse; \ | 35 __m128i sse; \ |
36 }; \ | 36 }; \ |
37 \ | 37 \ |
38 VEC_STATIC_ASSERT(VEC_ALIGNOF(__m128i) <= VEC_ALIGNOF(v##sign##int32x4), "vec: v" #sign "int32x4 alignment needs to be expanded to fit intrinsic type size"); \ | |
39 VEC_STATIC_ASSERT(sizeof(__m128i) <= sizeof(v##sign##int32x4), "vec: v" #sign "int32x4 needs to be expanded to fit intrinsic type size"); \ | |
40 \ | |
38 static v##sign##int32x4 v##sign##int32x4_sse41_mul(v##sign##int32x4 vec1, v##sign##int32x4 vec2) \ | 41 static v##sign##int32x4 v##sign##int32x4_sse41_mul(v##sign##int32x4 vec1, v##sign##int32x4 vec2) \ |
39 { \ | 42 { \ |
40 union v##sign##int32x4_impl_data *vec1d = (union v##sign##int32x4_impl_data *)&vec1; \ | 43 union v##sign##int32x4_impl_data *vec1d = (union v##sign##int32x4_impl_data *)&vec1; \ |
41 union v##sign##int32x4_impl_data *vec2d = (union v##sign##int32x4_impl_data *)&vec2; \ | 44 union v##sign##int32x4_impl_data *vec2d = (union v##sign##int32x4_impl_data *)&vec2; \ |
42 \ | 45 \ |