Skip to content

Commit

Permalink
client: studio: fix types in AArch64 NEON code
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Jul 22, 2023
1 parent 8180cf6 commit f00a8f4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cl_dll/studio_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ AngleMatrix
====================
*/
#if XASH_SIMD_NEON
const uint32x4_t AngleMatrix_sign0 = vreinterpretq_f32_u32(vsetq_lane_u32(0x80000000, vdupq_n_u32(0), 0));
const uint32x4_t AngleMatrix_sign1 = vreinterpretq_f32_u32(vsetq_lane_u32(0x80000000, vdupq_n_u32(0), 1));
const uint32x4_t AngleMatrix_sign2 = vreinterpretq_f32_u32(vsetq_lane_u32(0x80000000, vdupq_n_u32(0), 2));
static const uint32x4_t AngleMatrix_sign0 = vsetq_lane_u32(0x80000000, vdupq_n_u32(0), 0);
static const uint32x4_t AngleMatrix_sign1 = vsetq_lane_u32(0x80000000, vdupq_n_u32(0), 1);
static const uint32x4_t AngleMatrix_sign2 = vsetq_lane_u32(0x80000000, vdupq_n_u32(0), 2);
#endif
void AngleMatrix( const float *angles, float (*matrix)[4] )
{
Expand Down Expand Up @@ -254,7 +254,11 @@ AngleQuaternion
====================
*/
#if XASH_SIMD_NEON
const float32x4_t AngleQuaternion_sign2 = vzipq_f32(vdupq_n_u32(0x80000000), vdupq_n_u32(0x00000000)).val[0]; // { 0x80000000, 0x00000000, 0x80000000, 0x00000000 };
static const float32x4_t AngleQuaternion_sign2 =
vzipq_f32(
vreinterpret_f32_u32(vdupq_n_u32(0x80000000)),
vreinterpret_f32_u32(vdupq_n_u32(0x00000000))
).val[0]; // { 0x80000000, 0x00000000, 0x80000000, 0x00000000 };
#endif
void AngleQuaternion( float *angles, vec4_t quaternion )
{
Expand All @@ -272,7 +276,7 @@ void AngleQuaternion( float *angles, vec4_t quaternion )
float32x4_t sy_cr_cy_sr = vextq_f32(sr_sy_cr_cy_sp_0_cp_1.val[0], sr_sy_cr_cy_sp_0_cp_1.val[0], 1);
float32x4_t cr_cy_sr_sy = vextq_f32(sr_sy_cr_cy_sp_0_cp_1.val[0], sr_sy_cr_cy_sp_0_cp_1.val[0], 2);
float32x4_t cy_sr_sy_cr = vextq_f32(sr_sy_cr_cy_sp_0_cp_1.val[0], sr_sy_cr_cy_sp_0_cp_1.val[0], 3);
float32x4_t sp_sp_sp_sp_signed = veorq_u32(sp_sp_sp_sp, AngleQuaternion_sign2);
float32x4_t sp_sp_sp_sp_signed = veorq_u32(vreinterpret_u32_f32(sp_sp_sp_sp), AngleQuaternion_sign2);

float32x4_t left = vmulq_f32(vmulq_f32(sr_sy_cr_cy, cp_cp_cp_cp), cy_sr_sy_cr);

Expand Down

0 comments on commit f00a8f4

Please sign in to comment.