Skip to content

Commit

Permalink
Fix ARM relaxed config
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed Apr 27, 2024
1 parent 52d5875 commit 6fe19bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/FastSIMD/ToolSet/ARM/128/f32x4.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,27 +215,27 @@ namespace FS
}


template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>>
template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>, typename = EnableIfRelaxed<SIMD>>
FS_FORCEINLINE f32<4, SIMD> Reciprocal( const f32<4, SIMD>& a )
{
float32x4_t recip = vrecpeq_f32( a.native );
return vmulq_f32( recip, vrecpsq_f32( recip, a.native ) );
}

template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>>
template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>, typename = EnableIfRelaxed<SIMD>>
FS_FORCEINLINE f32<4, SIMD> InvSqrt( const f32<4, SIMD>& a )
{
float32x4_t rsqrt = vrsqrteq_f32( a.native );
return vmulq_f32( rsqrt, vrsqrtsq_f32( vmulq_f32( a.native, rsqrt ), rsqrt ) );
}

template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>, typename = std::enable_if_t<SIMD & FastSIMD::FeatureFlag::FMA>>
template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>, typename = EnableIfRelaxed<SIMD>>
FS_FORCEINLINE f32<4, SIMD> FMulAdd( const f32<4, SIMD>& a, const f32<4, SIMD>& b, const f32<4, SIMD>& c )
{
return vmlaq_f32( b.native, c.native, a.native );
}

template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>, typename = std::enable_if_t<SIMD & FastSIMD::FeatureFlag::FMA>>
template<FastSIMD::FeatureSet SIMD, typename = EnableIfNative<f32<4, SIMD>>, typename = EnableIfRelaxed<SIMD>>
FS_FORCEINLINE f32<4, SIMD> FNMulAdd( const f32<4, SIMD>& a, const f32<4, SIMD>& b, const f32<4, SIMD>& c )
{
return vmlaq_f32( b.native, c.native, a.native );
Expand Down

0 comments on commit 6fe19bb

Please sign in to comment.