recp / cglm

📽 Highly Optimized 2D / 3D Graphics Math (glm) for C
MIT License
2.3k stars 231 forks source link

Possible problem in glm_inv_tr SIMD implementations #241

Open pm4gh opened 2 years ago

pm4gh commented 2 years ago

A static analyzer used on code indirectly including affine.h (but not using glm_inv_tr) gives me this warning:

cglm/simd/neon/affine.h:95:8: style: Variable 'r3' is assigned a value that is never used. [unreadVariable] r3 = vmat.val[3];

I'm not familiar with SSE or NEON intrinsics and can't affirm that something is wrong, but it seems strange that the SSE version uses the r3 input argument while the NEON one doesn't.

recp commented 2 years ago

Hi @pm4gh ,

Thanks for reporting this, I'll take a look at it asap. vld4q_f32() transposes matrix on the fly but it may be slow if we want to transpose matrix which is already in SIMD registers... it may also be replaced later.

recp commented 2 years ago

The https://github.com/recp/cglm/pull/244 PR should suppress the warning but as I said before, I'll re-check the implementation later.