Skip to content

Commit

Permalink
client: studio: another NEON type fix for AngleQuaternion, static-ize…
Browse files Browse the repository at this point in the history
… global NEON vectors
  • Loading branch information
a1batross committed Jul 22, 2023
1 parent b4bd066 commit d4995df
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions cl_dll/studio_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,7 @@ AngleQuaternion
====================
*/
#if XASH_SIMD_NEON
static const float32x4_t AngleQuaternion_sign2 =
vzipq_f32(
vreinterpretq_f32_u32(vdupq_n_u32(0x80000000)),
vreinterpretq_f32_u32(vdupq_n_u32(0x00000000))
).val[0]; // { 0x80000000, 0x00000000, 0x80000000, 0x00000000 };
static const uint32x4_t AngleQuaternion_sign2 = vzipq_u32(vdupq_n_u32(0x80000000), vdupq_n_u32(0x00000000)).val[0]; // { 0x80000000, 0x00000000, 0x80000000, 0x00000000 };
#endif
void AngleQuaternion( float *angles, vec4_t quaternion )
{
Expand Down Expand Up @@ -411,12 +407,12 @@ QuaternionMatrix
====================
*/
#if XASH_SIMD_NEON
const uint32x4_t QuaternionMatrix_sign1 = vsetq_lane_u32(0x80000000, vdupq_n_u32(0x00000000), 0); // { 0x80000000, 0x00000000, 0x00000000, 0x00000000 };
const uint32x4_t QuaternionMatrix_sign2 = vsetq_lane_u32(0x80000000, vdupq_n_u32(0x00000000), 1); // { 0x00000000, 0x80000000, 0x00000000, 0x00000000 };
const uint32x4_t QuaternionMatrix_sign3 = vsetq_lane_u32(0x00000000, vdupq_n_u32(0x80000000), 2); // { 0x80000000, 0x80000000, 0x00000000, 0x80000000 };
const float32x4_t matrix3x4_identity_0 = vsetq_lane_f32(1, vdupq_n_f32(0), 0); // { 1, 0, 0, 0 }
const float32x4_t matrix3x4_identity_1 = vsetq_lane_f32(1, vdupq_n_f32(0), 1); // { 0, 1, 0, 0 }
const float32x4_t matrix3x4_identity_2 = vsetq_lane_f32(1, vdupq_n_f32(0), 2); // { 0, 0, 1, 0 }
static const uint32x4_t QuaternionMatrix_sign1 = vsetq_lane_u32(0x80000000, vdupq_n_u32(0x00000000), 0); // { 0x80000000, 0x00000000, 0x00000000, 0x00000000 };
static const uint32x4_t QuaternionMatrix_sign2 = vsetq_lane_u32(0x80000000, vdupq_n_u32(0x00000000), 1); // { 0x00000000, 0x80000000, 0x00000000, 0x00000000 };
static const uint32x4_t QuaternionMatrix_sign3 = vsetq_lane_u32(0x00000000, vdupq_n_u32(0x80000000), 2); // { 0x80000000, 0x80000000, 0x00000000, 0x80000000 };
static const float32x4_t matrix3x4_identity_0 = vsetq_lane_f32(1, vdupq_n_f32(0), 0); // { 1, 0, 0, 0 }
static const float32x4_t matrix3x4_identity_1 = vsetq_lane_f32(1, vdupq_n_f32(0), 1); // { 0, 1, 0, 0 }
static const float32x4_t matrix3x4_identity_2 = vsetq_lane_f32(1, vdupq_n_f32(0), 2); // { 0, 0, 1, 0 }
#endif

void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] )
Expand Down

0 comments on commit d4995df

Please sign in to comment.