Sean Cavanaugh wrote:
Some reference:

C++ simd intrinsic for dot product (requires SSE 4.1, very modern)
_mm_dp_ps

Good to know, thanks!


C++ simd instrinsic for horizontal add (requires SSE3, also reasonably modern)
_mm_hadd_ps

Awesome, I see XMM.HADDPS (amoung others) in core.simd now, thanks again!


If you are on SSE2 (which is the base spec for x64) and also the minimum CPU target we use at work for commercial game development, you are stuck doing shuffles and adds for dot product, which effectively process these operations as scalar).

Ideally one of the sides of the dot product is an array and you can vectorize the dot product itself (1 vector vs 4 others, or 4 v 4). This is common when setting up shapes like view frustum culling (point tested against 6-8 extruded planes in an array)

Thanks for the info.

Reply via email to