adding generated opengl function binding

This commit is contained in:
Youmu Liu
2025-12-29 17:06:04 +08:00
parent b3dcd1b5c0
commit f9288c1b3d
47 changed files with 61260 additions and 3101 deletions
+17 -24
View File
@@ -295,38 +295,31 @@ INTERNAL int SN_DECL index_pair_sse(short const *str, uint32_t target, int lengt
#pragma endregion
typedef struct mat_intrinsic {
BUF_PROC_LRA buffer_add;
BUF_PROC_AS buffer_fill;
BUF_PROC_RAS buffer_scalar_mul;
BUF_PROC_LRA buffer_sub;
KER_PROC_RA buffer_transpose;
PANEL_PROC build_panel;
PANEL_PROC clear_panel;
PNL_PROC_LRA panel_fma;
PIVOTPROC pivot;
PANEL_PROC store_panel;
} mat_intrinsic;
// Mirrors C# IntrinsicContext field order so managed/unmanaged layouts stay in sync.
typedef struct sn_intrinsic {
HASH city_hash_simplify;
FACTORIALROC factorial_simd;
INDEX_PAIR index_pair;
BUF_PROC_LRA mat_f32_buffer_add;
BUF_PROC_AS mat_f32_buffer_fill;
BUF_PROC_RAS mat_f32_buffer_scalar_mul;
BUF_PROC_LRA mat_f32_buffer_sub;
KER_PROC_RA mat_f32_buffer_transpose;
PANEL_PROC mat_f32_build_panel;
PANEL_PROC mat_f32_clear_panel;
PNL_PROC_LRA mat_f32_panel_fma;
PIVOTPROC mat_f32_pivot;
PANEL_PROC mat_f32_store_panel;
// f64 slots (currently unimplemented; filled with NULL in loader)
BUF_PROC_LRA mat_f64_buffer_add;
BUF_PROC_AS mat_f64_buffer_fill;
BUF_PROC_RAS mat_f64_buffer_scalar_mul;
BUF_PROC_LRA mat_f64_buffer_sub;
KER_PROC_RA mat_f64_buffer_transpose;
PANEL_PROC mat_f64_build_panel;
PANEL_PROC mat_f64_clear_panel;
PNL_PROC_LRA mat_f64_panel_fma;
PIVOTPROC mat_f64_pivot;
PANEL_PROC mat_f64_store_panel;
mat_intrinsic mat[4];
VECTORNORMALIZEPROC vec_f32_normalize_3;
} sn_intrinsic;
typedef enum elment_type { F32 = 0, F64 = 1, I32 = 2, I64 = 3 } element_type;
typedef enum most_advanced_instruction {
#ifdef _MSC_VER
SSE = __IA_SUPPORT_SSE42,
+60 -60
View File
@@ -66,27 +66,27 @@ void load_intrinsic_sse(sn_intrinsic *context)
context->factorial_simd = factorial_simd_sse;
context->index_pair = index_pair_sse;
context->mat_f32_buffer_add = BUF_PROC(float, sse, add);
context->mat_f32_buffer_fill = BUF_PROC(float, sse, fill);
context->mat_f32_buffer_scalar_mul = BUF_PROC(float, sse, scalar_mul);
context->mat_f32_buffer_sub = BUF_PROC(float, sse, sub);
context->mat_f32_buffer_transpose = KER_PROC(float, sse, transpose);
context->mat_f32_build_panel = NULL;
context->mat_f32_clear_panel = PNL_PROC(float, sse, clear);
context->mat_f32_panel_fma = PNL_PROC(float, sse, fma);
context->mat_f32_pivot = pivot_float;
context->mat_f32_store_panel = NULL;
context->mat[F32].buffer_add = BUF_PROC(float, sse, add);
context->mat[F32].buffer_fill = BUF_PROC(float, sse, fill);
context->mat[F32].buffer_scalar_mul = BUF_PROC(float, sse, scalar_mul);
context->mat[F32].buffer_sub = BUF_PROC(float, sse, sub);
context->mat[F32].buffer_transpose = KER_PROC(float, sse, transpose);
context->mat[F32].build_panel = NULL;
context->mat[F32].clear_panel = PNL_PROC(float, sse, clear);
context->mat[F32].panel_fma = PNL_PROC(float, sse, fma);
context->mat[F32].pivot = pivot_float;
context->mat[F32].store_panel = NULL;
context->mat_f64_buffer_add = BUF_PROC(double, sse, add);
context->mat_f64_buffer_fill = BUF_PROC(double, sse, fill);
context->mat_f64_buffer_scalar_mul = BUF_PROC(double, sse, scalar_mul);
context->mat_f64_buffer_sub = BUF_PROC(double, sse, sub);
context->mat_f64_buffer_transpose = NULL;
context->mat_f64_build_panel = NULL;
context->mat_f64_clear_panel = PNL_PROC(double, sse, clear);
context->mat_f64_panel_fma = NULL;
context->mat_f64_pivot = NULL;
context->mat_f64_store_panel = NULL;
context->mat[F64].buffer_add = BUF_PROC(double, sse, add);
context->mat[F64].buffer_fill = BUF_PROC(double, sse, fill);
context->mat[F64].buffer_scalar_mul = BUF_PROC(double, sse, scalar_mul);
context->mat[F64].buffer_sub = BUF_PROC(double, sse, sub);
context->mat[F64].buffer_transpose = NULL;
context->mat[F64].build_panel = NULL;
context->mat[F64].clear_panel = PNL_PROC(double, sse, clear);
context->mat[F64].panel_fma = NULL;
context->mat[F64].pivot = NULL;
context->mat[F64].store_panel = NULL;
context->vec_f32_normalize_3 = f32_normalize;
}
@@ -97,27 +97,27 @@ void load_intrinsic_avx(sn_intrinsic *context)
context->factorial_simd = factorial_simd_sse;
context->index_pair = index_pair_sse;
context->mat_f32_buffer_add = BUF_PROC(float, avx, add);
context->mat_f32_buffer_fill = BUF_PROC(float, avx, fill);
context->mat_f32_buffer_scalar_mul = BUF_PROC(float, avx, scalar_mul);
context->mat_f32_buffer_sub = BUF_PROC(float, avx, sub);
context->mat_f32_buffer_transpose = KER_PROC(float, avx, transpose);
context->mat_f32_build_panel = BUILD_PANEL(avx, float);
context->mat_f32_clear_panel = PNL_PROC(float, avx, clear);
context->mat_f32_panel_fma = PNL_PROC(float, avx, fma);
context->mat_f32_pivot = pivot_float;
context->mat_f32_store_panel = STORE_PANEL(avx, float);
context->mat[F32].buffer_add = BUF_PROC(float, avx, add);
context->mat[F32].buffer_fill = BUF_PROC(float, avx, fill);
context->mat[F32].buffer_scalar_mul = BUF_PROC(float, avx, scalar_mul);
context->mat[F32].buffer_sub = BUF_PROC(float, avx, sub);
context->mat[F32].buffer_transpose = KER_PROC(float, avx, transpose);
context->mat[F32].build_panel = BUILD_PANEL(avx, float);
context->mat[F32].clear_panel = PNL_PROC(float, avx, clear);
context->mat[F32].panel_fma = PNL_PROC(float, avx, fma);
context->mat[F32].pivot = pivot_float;
context->mat[F32].store_panel = STORE_PANEL(avx, float);
context->mat_f64_buffer_add = BUF_PROC(double, avx, add);
context->mat_f64_buffer_fill = BUF_PROC(double, avx, fill);
context->mat_f64_buffer_scalar_mul = BUF_PROC(double, avx, scalar_mul);
context->mat_f64_buffer_sub = BUF_PROC(double, avx, sub);
context->mat_f64_buffer_transpose = NULL;
context->mat_f64_build_panel = NULL;
context->mat_f64_clear_panel = PNL_PROC(double, avx, clear);
context->mat_f64_panel_fma = NULL;
context->mat_f64_pivot = NULL;
context->mat_f64_store_panel = NULL;
context->mat[F64].buffer_add = BUF_PROC(double, avx, add);
context->mat[F64].buffer_fill = BUF_PROC(double, avx, fill);
context->mat[F64].buffer_scalar_mul = BUF_PROC(double, avx, scalar_mul);
context->mat[F64].buffer_sub = BUF_PROC(double, avx, sub);
context->mat[F64].buffer_transpose = NULL;
context->mat[F64].build_panel = NULL;
context->mat[F64].clear_panel = PNL_PROC(double, avx, clear);
context->mat[F64].panel_fma = NULL;
context->mat[F64].pivot = NULL;
context->mat[F64].store_panel = NULL;
context->vec_f32_normalize_3 = f32_normalize;
}
@@ -128,27 +128,27 @@ void load_intrinsic_512(sn_intrinsic *context)
context->factorial_simd = factorial_simd_sse;
context->index_pair = index_pair_sse;
context->mat_f32_buffer_add = BUF_PROC(float, 512, add);
context->mat_f32_buffer_fill = BUF_PROC(float, 512, fill);
context->mat_f32_buffer_scalar_mul = BUF_PROC(float, 512, scalar_mul);
context->mat_f32_buffer_sub = BUF_PROC(float, 512, sub);
context->mat_f32_buffer_transpose = KER_PROC(float, 512, transpose);
context->mat_f32_build_panel = BUILD_PANEL(512, float);
context->mat_f32_clear_panel = PNL_PROC(float, 512, clear);
context->mat_f32_panel_fma = PNL_PROC(float, 512, fma);
context->mat_f32_pivot = pivot_float;
context->mat_f32_store_panel = STORE_PANEL(512, float);
context->mat[F32].buffer_add = BUF_PROC(float, 512, add);
context->mat[F32].buffer_fill = BUF_PROC(float, 512, fill);
context->mat[F32].buffer_scalar_mul = BUF_PROC(float, 512, scalar_mul);
context->mat[F32].buffer_sub = BUF_PROC(float, 512, sub);
context->mat[F32].buffer_transpose = KER_PROC(float, 512, transpose);
context->mat[F32].build_panel = BUILD_PANEL(512, float);
context->mat[F32].clear_panel = PNL_PROC(float, 512, clear);
context->mat[F32].panel_fma = PNL_PROC(float, 512, fma);
context->mat[F32].pivot = pivot_float;
context->mat[F32].store_panel = STORE_PANEL(512, float);
context->mat_f64_buffer_add = NULL;
context->mat_f64_buffer_fill = NULL;
context->mat_f64_buffer_scalar_mul = NULL;
context->mat_f64_buffer_sub = NULL;
context->mat_f64_buffer_transpose = NULL;
context->mat_f64_build_panel = NULL;
context->mat_f64_clear_panel = NULL;
context->mat_f64_panel_fma = NULL;
context->mat_f64_pivot = NULL;
context->mat_f64_store_panel = NULL;
context->mat[F64].buffer_add = BUF_PROC(double, 512, add);
context->mat[F64].buffer_fill = BUF_PROC(double, 512, fill);
context->mat[F64].buffer_scalar_mul = BUF_PROC(double, 512, scalar_mul);
context->mat[F64].buffer_sub = BUF_PROC(double, 512, sub);
context->mat[F64].buffer_transpose = NULL;
context->mat[F64].build_panel = BUILD_PANEL(512, double);
context->mat[F64].clear_panel = PNL_PROC(double, 512, clear);
context->mat[F64].panel_fma = NULL;
context->mat[F64].pivot = NULL;
context->mat[F64].store_panel = STORE_PANEL(512, double);
context->vec_f32_normalize_3 = f32_normalize;
}