Add vectorized vec5 cubic and tree32 phase approximations + benchmark updates#65
Merged
falseywinchnet merged 2 commits intoJun 27, 2026
Conversation
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.
Motivation
Description
V2_DIV,V2_CMPGT,V2_SELECT) and aBRUUN_ALWAYS_INLINEmacro tosrc/detail/bruun_kernel.hppto support portable 2‑lane SIMD code for SSE2 and NEON.bruun_atan_leaf_cubic, a newbruun_phase_first_octant_vec5_cubicscalar implementation, and retained the previous tree32/degree7 code asbruun_phase_first_octant_tree32_degree7.bruun_phase_atan2_corethat accepts a first‑octant function, added a 2‑lane SIMD versionbruun_phase_first_octant_vec5_cubic_v2, and a paired vector entrypointbruun_phase_atan2_mag_pairthat computes two phases at once; replacedbruun_phase_atan2_magto call through the core path.forward_mag_phaseto use the paired/vectorized path when available and to write magnitude/phase back intooutputmore directly.examples/atan2_benchmark.cppto includephasein samples and to time multiple variants (std::atan2,tree32,default,vec5scalar,vec5pair whenBRUUN_LEVEL>=1, float variants, and sin+cos table), and added formatted benchmark output lines.Testing
-DBRUUN_LEVEL=1(x86_64 with SSE2) and compiledexamples/atan2_benchmark, which executed and produced benchmark output successfully.ctest/ unit tests) after the build and observed no failures.Codex Task