diff 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
line wrap: on
line diff
--- a/src/impl/x86/sse41.c	Sun Nov 24 02:52:40 2024 -0500
+++ b/src/impl/x86/sse41.c	Sun Nov 24 03:32:53 2024 -0500
@@ -35,6 +35,9 @@
 		__m128i sse; \
 	}; \
 	\
+	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"); \
+	VEC_STATIC_ASSERT(sizeof(__m128i) <= sizeof(v##sign##int32x4), "vec: v" #sign "int32x4 needs to be expanded to fit intrinsic type size"); \
+	\
 	static v##sign##int32x4 v##sign##int32x4_sse41_mul(v##sign##int32x4 vec1, v##sign##int32x4 vec2) \
 	{ \
 		union v##sign##int32x4_impl_data *vec1d = (union v##sign##int32x4_impl_data *)&vec1; \