Skip to content

Feat: SIMD Math support#422

Merged
FlyAndNotDown merged 4 commits into
ExplosionEngine:masterfrom
FlyAndNotDown:master
Jun 19, 2026
Merged

Feat: SIMD Math support#422
FlyAndNotDown merged 4 commits into
ExplosionEngine:masterfrom
FlyAndNotDown:master

Conversation

@FlyAndNotDown

Copy link
Copy Markdown
Member

No description provided.

Add the benchmark/1.9.5 Conan dependency and a Benchmark support library that provides the BENCHMARK_MAIN entry point, plus an exp_add_benchmark CMake helper mirroring exp_add_test. Benchmarks are plain executables placed under the Benchmark folder and are not registered with ctest.
Assert took its name/file/reason as const std::string&, so every call site
materialized a std::string from __FILE__ (a long absolute path that overflows
SSO and heap-allocates), and AssertImpl was an out-of-line, side-effecting call
the optimizer could not elide. On hot paths that went through Assert this was
brutal: a single scalar 4x4 Mat multiply (Row/Col/At each assert) spent ~14.6us
almost entirely in those allocations.

Switch the parameters to const char* / std::string_view (literals pass by
pointer, no allocation) and inline the passing branch into the header, leaving
only the actual-failure handling out of line as Debug::AssertFailed. A
compile-time-true condition now folds away entirely; a runtime one collapses to
a single predicted-not-taken branch. Semantics are unchanged in every config.

The same scalar MatMul benchmark drops from 14584ns to 49ns; Common.Test passes.
Reflected headers that pull in the math lib now transitively include
<emmintrin.h>/<arm_neon.h> through Simd.h. MirrorTool's libclang cannot
parse those (no clang resource headers on Linux, a version-mismatched
arm_neon.h on macOS), breaking reflection on Ubuntu and macOS.

Reflection only needs the declarations, never the vectorized bodies, so
define MIRROR_TOOL_PARSING during the parse and stand in a portable
scalar F32x4 instead of the intrinsic backend. Every real translation
unit still compiles the SSE2/NEON path.
@FlyAndNotDown FlyAndNotDown merged commit c75df8f into ExplosionEngine:master Jun 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant