MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / VecDot3D

Function VecDot3D

TSSimd.h:1765–1789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1763 }
1764
1765 inline vec_float VecDot3D(const vec_float& v1, const vec_float& v2)
1766 {
1767 #if defined(TERATHON_SSE)
1768
1769 #if defined(TERATHON_SSE4)
1770
1771 vec_float r = _mm_mul_ps(v1, v2);
1772 r = _mm_insert_ps(r, r, 0x08);
1773 r = _mm_hadd_ps(r, r);
1774 return (_mm_hadd_ps(r, r));
1775
1776 #else
1777
1778 vec_float d = _mm_mul_ps(v1, v2);
1779 return (_mm_add_ss(_mm_add_ss(d, VecSmearY(d)), VecSmearZ(d)));
1780
1781 #endif
1782
1783 #elif defined(TERATHON_NEON)
1784
1785 vec_float d = vmulq_f32(v1, v2);
1786 return (vaddq_f32(vpaddq_f32(d, d), vdupq_n_f32(vgetq_lane_f32(d, 2))));
1787
1788 #endif
1789 }
1790
1791 inline vec_float VecDot4D(const vec_float& v1, const vec_float& v2)
1792 {

Callers 3

VecProject3DFunction · 0.85
VecReject3DFunction · 0.85
InverseMethod · 0.85

Calls 2

VecSmearYFunction · 0.85
VecSmearZFunction · 0.85

Tested by

no test coverage detected