mirror of
https://github.com/recp/cglm.git
synced 2026-01-01 13:16:11 +00:00
glmm, x86: define hadd function
This commit is contained in:
@@ -48,6 +48,15 @@ glmm_abs(__m128 x) {
|
||||
return _mm_andnot_ps(_mm_set1_ps(-0.0f), x);
|
||||
}
|
||||
|
||||
static inline
|
||||
__m128
|
||||
glmm_vhadd(__m128 v) {
|
||||
__m128 x0;
|
||||
x0 = _mm_add_ps(v, glmm_shuff1(v, 0, 1, 2, 3));
|
||||
x0 = _mm_add_ps(x0, glmm_shuff1(x0, 1, 0, 0, 1));
|
||||
return x0;
|
||||
}
|
||||
|
||||
static inline
|
||||
__m128
|
||||
glmm_vhadds(__m128 v) {
|
||||
|
||||
Reference in New Issue
Block a user