From bad3126973d4c9e81acedcb28b3c78e56ab28dd2 Mon Sep 17 00:00:00 2001 From: MarcelineVQ Date: Tue, 17 Mar 2026 00:27:48 -0700 Subject: [PATCH] build: enable SSE4.1+FMA+AVX for silicon_sse compilation unit Was compiling with baseline SSE2 only. Now matches bone_sse target. Free wins: packParticleColor 1.2x->4.6x, rotateMatByQuat 3.4x->4.0x, normalizeVec3 1.1x->1.8x, mulMat3x4InPlace 1.4x->1.7x. --- build.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 244b0f5..ff40963 100644 --- a/build.zig +++ b/build.zig @@ -106,7 +106,7 @@ pub fn build(b: *std.Build) void { .name = "silicon_sse", .root_module = b.createModule(.{ .root_source_file = b.path("src/silicon/silicon_sse.zig"), - .target = target, + .target = bone_sse_target, // SSE4.1+FMA+AVX, same as bone_sse .optimize = .ReleaseFast, }), }); @@ -162,7 +162,11 @@ pub fn build(b: *std.Build) void { .name = "bench_silicon_sse", .root_module = b.createModule(.{ .root_source_file = b.path("src/silicon/silicon_sse.zig"), - .target = bench_target, + .target = b.resolveTargetQuery(.{ + .cpu_arch = .x86, + .os_tag = .linux, + .cpu_features_add = std.Target.x86.featureSet(&.{ .sse, .sse2, .sse3, .sse4_1, .fma, .avx }), + }), .optimize = .ReleaseFast, }), });