add simd id and cpu id

This commit is contained in:
Youmu Liu
2026-01-05 18:10:24 +08:00
parent d0fe4dde1a
commit 88fa653323
11 changed files with 447 additions and 286 deletions
+7 -6
View File
@@ -3,8 +3,9 @@
#if SN_IS_ARCH(SN_ARCH_X86_64)
#include "sn_intrinsic.h"
#include "sn_intrincontext.x86.h"
DECLARE_PNL_PROC_ANS(float, sse, clear)
DECLARE_PNL_PROC_ANS(float, sse, , clear)
{
register __m128 zero = _mm_setzero_ps();
for (size_t i = 0; i < 4; i++) {
@@ -12,7 +13,7 @@ DECLARE_PNL_PROC_ANS(float, sse, clear)
}
}
DECLARE_PNL_PROC_ANS(float, avx, clear)
DECLARE_PNL_PROC_ANS(float, avx, , clear)
{
register __m256 zero = _mm256_setzero_ps();
for (size_t i = 0; i < 8; i++) {
@@ -20,7 +21,7 @@ DECLARE_PNL_PROC_ANS(float, avx, clear)
}
}
DECLARE_PNL_PROC_ANS(float, 512, clear)
DECLARE_PNL_PROC_ANS(float, 512, , clear)
{
register __m512 zero = _mm512_setzero_ps();
for (size_t i = 0; i < 16; i++) {
@@ -28,7 +29,7 @@ DECLARE_PNL_PROC_ANS(float, 512, clear)
}
}
DECLARE_PNL_PROC_ANS(double, sse, clear)
DECLARE_PNL_PROC_ANS(double, sse, , clear)
{
register __m128 zero = _mm_setzero_ps();
PANEL_COL_VEC((*ans), 0, 0) = zero;
@@ -37,7 +38,7 @@ DECLARE_PNL_PROC_ANS(double, sse, clear)
PANEL_COL_VEC((*ans), 3, 0) = zero;
}
DECLARE_PNL_PROC_ANS(double, avx, clear)
DECLARE_PNL_PROC_ANS(double, avx, , clear)
{
register __m256 zero = _mm256_setzero_ps();
for (size_t i = 0; i < 8; i++) {
@@ -45,7 +46,7 @@ DECLARE_PNL_PROC_ANS(double, avx, clear)
}
}
DECLARE_PNL_PROC_ANS(double, 512, clear)
DECLARE_PNL_PROC_ANS(double, 512, , clear)
{
register __m512 zero = _mm512_setzero_ps();
for (size_t i = 0; i < 16; i++) {