Merge branch 'master' into vec2_mat2

This commit is contained in:
Recep Aslantas
2019-08-30 21:34:23 +03:00
committed by GitHub
22 changed files with 1178 additions and 56 deletions

View File

@@ -37,5 +37,11 @@ glmm_norm(float32x4_t a) {
return sqrtf(glmm_dot(a, a));
}
static inline
float
glmm_norm2(float32x4_t a) {
return glmm_dot(a, a);
}
#endif
#endif /* cglm_simd_arm_h */

View File

@@ -113,6 +113,12 @@ glmm_norm(__m128 a) {
return _mm_cvtss_f32(_mm_sqrt_ss(glmm_vhadds(_mm_mul_ps(a, a))));
}
static inline
float
glmm_norm2(__m128 a) {
return _mm_cvtss_f32(glmm_vhadds(_mm_mul_ps(a, a)));
}
static inline
__m128
glmm_load3(float v[3]) {
@@ -127,7 +133,7 @@ glmm_load3(float v[3]) {
static inline
void
glmm_store3(__m128 vx, float v[3]) {
glmm_store3(float v[3], __m128 vx) {
_mm_storel_pi((__m64 *)&v[0], vx);
_mm_store_ss(&v[2], glmm_shuff1(vx, 2, 2, 2, 2));
}