new compute kernel design, less mem read delay

This commit is contained in:
Nitload
2026-04-07 01:04:05 +08:00
parent d702b3224c
commit 12a216d404
47 changed files with 225 additions and 145 deletions
@@ -5,6 +5,13 @@
#include "sn_intrinsic.h"
#include "sn_intrinsic.std.h"
#ifndef SN_X86_TARGET_ATTR_sse
#define SN_X86_TARGET_ATTR_sse SN_CLANG_TARGET_ATTR("sse2")
#define SN_X86_TARGET_ATTR_avx SN_CLANG_TARGET_ATTR("avx")
#define SN_X86_TARGET_ATTR_avx_fma SN_CLANG_TARGET_ATTR("avx,fma")
#define SN_X86_TARGET_ATTR_512 SN_CLANG_TARGET_ATTR("avx512f,avx512vl")
#endif
// -----------------------------------------------------------------------------
// SIMDID layout helpers (see SIMDID.x86.md)
// bits [3..0] : Root ISA
@@ -105,8 +112,7 @@
* Higher numeric value == stronger / higher-capability topology. */
#define SIMDID_UARCH_HYBRID_E (1U << 0) /* E-core (efficiency/small) in a hybrid topology */
#define SIMDID_UARCH_HYBRID_P (1U << 1) /* P-core (performance/big) in a hybrid topology */
#define SIMDID_UARCH_SIMD_DUAL \
(1U << 2) /* SIMD is glued/dual (summary: AVX_DUAL or AVX512_IMPL=DUAL) */
#define SIMDID_UARCH_SIMD_DUAL (1U << 2) /* SIMD is glued/dual (summary: AVX_DUAL or AVX512_IMPL=DUAL) */
#endif
// Pack helpers (define locally to avoid missing macros when included standalone)
@@ -239,8 +245,8 @@ INTERNAL uint64_t SN_DECL factorial_simd_sse(int n);
#pragma region dot_product
INTERNAL void FORCEINLINE SN_DECL dot_41_sse(
MAT_KERNEL(float) const *transpose, __m128 const *vector, __m128 *ans);
INTERNAL void FORCEINLINE SN_DECL dot_41_sse(MAT_KERNEL(float) const *transpose,
__m128 const *vector, __m128 *ans);
INTERNAL void SN_DECL dot_41_avx(MAT_KERNEL(float) const *transpose, __m128 const *vector,
__m128 *ans);
INTERNAL void SN_DECL dot_42_sse(MAT_KERNEL(float) const *transpose, __m128 const *vector,