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

Function VecDot4D

TSSimd.h:1791–1814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1789 }
1790
1791 inline vec_float VecDot4D(const vec_float& v1, const vec_float& v2)
1792 {
1793 #if defined(TERATHON_SSE)
1794
1795 #if defined(TERATHON_SSE4)
1796
1797 vec_float r = _mm_mul_ps(v1, v2);
1798 r = _mm_hadd_ps(r, r);
1799 return (_mm_hadd_ps(r, r));
1800
1801 #else
1802
1803 vec_float d = _mm_mul_ps(v1, v2);
1804 return (_mm_add_ss(_mm_add_ss(_mm_add_ss(d, VecSmearY(d)), VecSmearZ(d)), VecSmearW(d)));
1805
1806 #endif
1807
1808 #elif defined(TERATHON_NEON)
1809
1810 vec_float d = vmulq_f32(v1, v2);
1811 return (vaddq_f32(vaddq_f32(vpaddq_f32(d, d), vdupq_n_f32(vgetq_lane_f32(d, 2))), vdupq_n_f32(vgetq_lane_f32(d, 3))));
1812
1813 #endif
1814 }
1815
1816 inline vec_float VecPlaneDotPoint3D(const vec_float& v1, const vec_float& v2)
1817 {

Callers

nothing calls this directly

Calls 3

VecSmearYFunction · 0.85
VecSmearZFunction · 0.85
VecSmearWFunction · 0.85

Tested by

no test coverage detected