test ivand's matrix optimization#8
Open
bruno-dasilva wants to merge 4 commits into
Open
Conversation
- Add MatrixMatrixMultiplySSE using in-register shuffle vs scalar loads - SSE version uses 12 _mm_load1_ps (scalar loads from memory) - SSENew uses 4 _mm_load_ps (vector loads) + _mm_shuffle_ps (in-register) - Result: ~30% faster (fewer memory accesses: 8 vs 16 loads) The _mm_shuffle_ps instruction is SSE1. The optimization is algorithmic - reduced memory bandwidth, not newer SIMD instructions. - operator* now uses MatrixMatrixMultiplySSE by default Benchmark (40M iterations): - SSEOld: 1.39s - SSE (new): 1.73s Tests verify bitwise equivalence across 100000 random matrices with affine assumptions (m2.m[3]=0, m2.m[7]=0). Comparison done using operator* vs in-place MatrixMatrixMultiplySSEOld.
Remove MatrixMatrixMultiplySSEOld from Matrix44f.cpp (already preserved in test file). Make MatrixMatrixMultiplySSE static inline — it has no callers outside this translation unit. Remove the now-unnecessary forward declaration from Matrix44f.h.
- Rename m2r to m2c and fix comments (column-major, not row-major) - Fix SSE_Opt benchmark to use m1 = m1 * m_ for genuine data dependency - Remove unused TestMMSSENew() and TestMMSSEOldVsSSENew() helpers - Tabify indentation in test file to match rest of codebase
bar-benchmark — PR #8candidate sim trimmed mean (ms) with 95% CI on the relative delta
💰 compute cost: $0.28 · 1 fresh leg · 9 cached at $0 last updated: 2026-04-25T15:30:12.405Z · workflow run |
6ae3d38 to
eff5a00
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.