mpl going on good process

This commit is contained in:
Youmu Liu
2025-09-24 20:38:15 +08:00
parent 8abc82ae08
commit 0cafe9fd4d
15 changed files with 179 additions and 104 deletions
+2 -2
View File
@@ -2,11 +2,11 @@
#pragma once
#endif
#include <xmmintrin.h>
#ifndef SN_INTERNAL
#define SN_INTERNAL
#include <xmmintrin.h>
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS 1
#define WIN32_LEAN_AND_MEAN
+1 -1
View File
@@ -59,7 +59,7 @@ typedef uint64_t(SN_DECL *FACTORIALROC)(int n);
#pragma region matix function
INTERNAL void normalize(__m128 *source, __m128 *target);
INTERNAL void f32_normalize(VEC(float) * source, VEC(float) * target);
INTERNAL void SN_DECL f32_add_sse(MAT_KERNEL(float) const *left, MAT_KERNEL(float) const *right,
MAT_KERNEL(float) *restrict ans);
+16 -1
View File
@@ -9,11 +9,26 @@
#define ZMMCOUNT(T) sizeof(T) / 4
#define MAT_KERNEL(T) \
union { \
union mat_kernel_##T##{ \
__m128 xmm[XMMCOUNT(T)]; \
__m256 ymm[YMMCOUNT(T)]; \
__m512 zmm[ZMMCOUNT(T)]; \
T m[4][4]; \
}
#define VEC(T) \
union vec_##T##{ \
__m128 xmm[XMMCOUNT(T) / 4]; \
__m256 ymm[YMMCOUNT(T) / 4]; \
__m512 zmm[ZMMCOUNT(T) / 4]; \
T v[4]; \
}
/*
#undef ELEMENTSIZE
#undef XMMCOUNT
#undef YMMCOUNT
#undef ZMMCOUNT
/**/
#endif