wasm: replace usage of -0.f to 0x80000000

Part of https://github.com/recp/cglm/pull/291
This commit is contained in:
myfreeer
2023-04-22 10:50:54 +08:00
parent a4b8778be9
commit 6b2c91ecf7
3 changed files with 18 additions and 5 deletions

View File

@@ -164,8 +164,8 @@ glm_mat4_det_wasm(mat4 mat) {
x2 = glmm_fmadd(glmm_shuff1(r1, 2, 3, 3, 3),
wasm_i32x4_shuffle(x0, x1, 1, 3, 6, 6),
x2);
x2 = wasm_v128_xor(x2, wasm_f32x4_const(0.f, -0.f, 0.f, -0.f));
/* x2 = wasm_v128_xor(x2, wasm_f32x4_const(0.f, -0.f, 0.f, -0.f)); */
x2 = wasm_v128_xor(x2, glmm_float32x4_SIGNMASK_PNPN);
return glmm_hadd(wasm_f32x4_mul(x2, r0));
}
@@ -178,7 +178,8 @@ glm_mat4_inv_fast_wasm(mat4 mat, mat4 dest) {
t0, t1, t2, t3, t4, t5,
x0, x1, x2, x3, x4, x5, x6, x7, x8, x9;
x8 = wasm_f32x4_const(0.f, -0.f, 0.f, -0.f);
/* x8 = wasm_f32x4_const(0.f, -0.f, 0.f, -0.f); */
x8 = glmm_float32x4_SIGNMASK_PNPN;
x9 = glmm_shuff1(x8, 2, 1, 2, 1);
/* 127 <- 0 */
@@ -318,7 +319,8 @@ glm_mat4_inv_wasm(mat4 mat, mat4 dest) {
t0, t1, t2, t3, t4, t5,
x0, x1, x2, x3, x4, x5, x6, x7, x8, x9;
x8 = wasm_f32x4_const(0.f, -0.f, 0.f, -0.f);
/* x8 = wasm_f32x4_const(0.f, -0.f, 0.f, -0.f); */
x8 = glmm_float32x4_SIGNMASK_PNPN;
x9 = glmm_shuff1(x8, 2, 1, 2, 1);
/* 127 <- 0 */