Skip to content

Commit

Permalink
test 02
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto committed Aug 28, 2024
1 parent 96142bc commit e13bc93
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions include/box2d/math_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,16 @@ B2_INLINE b2Vec2 b2Clamp( b2Vec2 v, b2Vec2 a, b2Vec2 b )
#if 1
B2_INLINE float b2Sqrt( float x )
{
//return sqrtf( x );

#if defined( B2_SIMD_AVX2 ) || defined( B2_SIMD_SSE2 )
return _mm_cvtss_f32( _mm_sqrt_ss( _mm_set1_ps( x ) ) );
#elif defined( B2_SIMD_NEON )
float32x4_t v = vdupq_n_f32( x );
return vgetq_lane_f32( vsqrtq_f32( v ), 0 );
#else
return sqrtf( x );
#endif

//#if defined( B2_SIMD_AVX2 ) || defined( B2_SIMD_SSE2 )
// return _mm_cvtss_f32( _mm_sqrt_ss( _mm_set1_ps( x ) ) );
//#elif defined( B2_SIMD_NEON )
// float32x4_t v = vdupq_n_f32( x );
// return vgetq_lane_f32( vsqrtq_f32( v ), 0 );
//#else
// return sqrtf( x );
//#endif
}

B2_INLINE float b2Length( b2Vec2 v )
Expand Down

0 comments on commit e13bc93

Please sign in to comment.