| 940 | |
| 941 | COVERAGE(HMM_DotV4, 1) |
| 942 | static inline float HMM_DotV4(HMM_Vec4 Left, HMM_Vec4 Right) |
| 943 | { |
| 944 | ASSERT_COVERED(HMM_DotV4); |
| 945 | |
| 946 | float Result; |
| 947 | |
| 948 | // NOTE(zak): IN the future if we wanna check what version SSE is support |
| 949 | // we can use _mm_dp_ps (4.3) but for now we will use the old way. |
| 950 | // Or a r = _mm_mul_ps(v1, v2), r = _mm_hadd_ps(r, r), r = _mm_hadd_ps(r, r) for SSE3 |
| 951 | #ifdef HANDMADE_MATH__USE_SSE |
| 952 | __m128 SSEResultOne = _mm_mul_ps(Left.SSE, Right.SSE); |
| 953 | __m128 SSEResultTwo = _mm_shuffle_ps(SSEResultOne, SSEResultOne, _MM_SHUFFLE(2, 3, 0, 1)); |
| 954 | SSEResultOne = _mm_add_ps(SSEResultOne, SSEResultTwo); |
| 955 | SSEResultTwo = _mm_shuffle_ps(SSEResultOne, SSEResultOne, _MM_SHUFFLE(0, 1, 2, 3)); |
| 956 | SSEResultOne = _mm_add_ps(SSEResultOne, SSEResultTwo); |
| 957 | _mm_store_ss(&Result, SSEResultOne); |
| 958 | #else |
| 959 | Result = ((Left.X * Right.X) + (Left.Z * Right.Z)) + ((Left.Y * Right.Y) + (Left.W * Right.W)); |
| 960 | #endif |
| 961 | |
| 962 | return Result; |
| 963 | } |
| 964 | |
| 965 | COVERAGE(HMM_Cross, 1) |
| 966 | static inline HMM_Vec3 HMM_Cross(HMM_Vec3 Left, HMM_Vec3 Right) |
no outgoing calls
no test coverage detected