Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Emulate vzip1q_f32 for 32-bit
  • Loading branch information
brenton-at-pieces committed Sep 30, 2024
1 parent b864f53 commit 3bbbabd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/contact_solver.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,26 @@ static inline void b2StoreW( float32_t* data, b2FloatW a )

static inline b2FloatW b2UnpackLoW( b2FloatW a, b2FloatW b )
{
#if defined(__aarch64__)
return vzip1q_f32( a, b );
#else
float32x2_t a1 = vget_low_f32(a);
float32x2_t b1 = vget_low_f32(b);
float32x2x2_t result = vzip_f32(a1, b1);
return vcombine_f32(result.val[0], result.val[1]);
#endif
}

static inline b2FloatW b2UnpackHiW( b2FloatW a, b2FloatW b )
{
#if defined(__aarch64__)
return vzip2q_f32( a, b );
#else
float32x2_t a1 = vget_high_f32(a);
float32x2_t b1 = vget_high_f32(b);
float32x2x2_t result = vzip_f32(a1, b1);
return vcombine_f32(result.val[0], result.val[1]);
#endif
}

#elif defined( B2_SIMD_SSE2 )
Expand Down

0 comments on commit 3bbbabd

Please sign in to comment.