mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 20:34:58 +00:00
simd128: inline _mm_rcp_ps
This commit is contained in:
@@ -40,12 +40,6 @@ _mm_sqrt_ss(glmm_128 __a)
|
||||
return wasm_i32x4_shuffle(__a, wasm_f32x4_sqrt(__a), 4, 1, 2, 3);
|
||||
}
|
||||
|
||||
static __inline__ glmm_128 __attribute__((__always_inline__, __nodebug__))
|
||||
_mm_rcp_ps(glmm_128 __a)
|
||||
{
|
||||
return (glmm_128)wasm_f32x4_div((glmm_128)wasm_f32x4_splat(1.0f), (glmm_128)__a);
|
||||
}
|
||||
|
||||
#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \
|
||||
do { \
|
||||
glmm_128 __row0 = (row0); \
|
||||
|
||||
@@ -286,7 +286,9 @@ glm_mat4_inv_fast_wasm(mat4 mat, mat4 dest) {
|
||||
x1 = wasm_i32x4_shuffle(v2, v3, 0, 0, 4, 4);
|
||||
x0 = wasm_i32x4_shuffle(x0, x1, 0, 2, 4, 6);
|
||||
|
||||
x0 = _mm_rcp_ps(glmm_vhadd(wasm_f32x4_mul(x0, r0)));
|
||||
// x0 = _mm_rcp_ps(glmm_vhadd(wasm_f32x4_mul(x0, r0)));
|
||||
x0 = wasm_f32x4_div(wasm_f32x4_const_splat(1.0f),
|
||||
glmm_vhadd(wasm_f32x4_mul(x0, r0)));
|
||||
|
||||
glmm_store(dest[0], wasm_f32x4_mul(v0, x0));
|
||||
glmm_store(dest[1], wasm_f32x4_mul(v1, x0));
|
||||
|
||||
Reference in New Issue
Block a user