diff --git a/include/FastSIMD/ToolSet/Generic/Functions.h b/include/FastSIMD/ToolSet/Generic/Functions.h index 01978bd..3cb0317 100644 --- a/include/FastSIMD/ToolSet/Generic/Functions.h +++ b/include/FastSIMD/ToolSet/Generic/Functions.h @@ -487,7 +487,7 @@ namespace FS if constexpr( IsNativeV> ) { auto ab = a / b; - return (ab - FS::Trunc( ab )) * b; + return (ab - Trunc( ab )) * b; } else { diff --git a/tests/test.inl b/tests/test.inl index a4b7e02..b3fa46c 100644 --- a/tests/test.inl +++ b/tests/test.inl @@ -406,7 +406,9 @@ class FastSIMD::DispatchClass, SIMD> : publ RegisterTest( tests, "f32 floor", []( TestRegf32 a ) { return FS::Floor( a ); } ); RegisterTest( tests, "f32 trunc", []( TestRegf32 a ) { return FS::Trunc( a ); } ); RegisterTest( tests, "f32 signbit", []( TestRegf32 a, TestRegf32 b ) { return FS::SignBit( a ) ^ b; } ); - //RegisterTest( tests, "f32 modulus", []( TestRegf32 a, TestRegf32 b ) { return FS::Modulus( a, b ); } ); +#if !FASTSIMD_IS_RELAXED + RegisterTest( tests, "f32 modulus", []( TestRegf32 a, TestRegf32 b ) { return FS::Modulus( a, b ); } ); +#endif RegisterTest( tests, "f32 sqrt", []( TestRegf32 a ) { return FS::Sqrt( FS::Min( FS::Max( FS::Abs( a ), TestRegf32( 1.e-16f ) ), TestRegf32( 1.e+16f ) ) ); } ); RegisterTest( tests, "f32 inv sqrt", []( TestRegf32 a ) { return FS::InvSqrt( FS::Min( FS::Max( FS::Abs( a ), TestRegf32( 1.e-16f ) ), TestRegf32( 1.e+16f ) ) ); } ).relaxedAccuracy = 8192; @@ -422,7 +424,7 @@ class FastSIMD::DispatchClass, SIMD> : publ RegisterTest( tests, "f32 pow", []( TestRegf32 a, TestRegf32 b ) { return FS::Pow( a, b ); } ).relaxedAccuracy = 8192; RegisterTest( tests, "i32 convert to f32", []( TestRegi32 a ) { return FS::Convert( a ); } ); - RegisterTest( tests, "f32 convert to i32", []( TestRegf32 a ) { return FS::Convert( FS::Min( FS::Max( a, TestRegf32( -2147483648 ) ), TestRegf32( 2147483520 ) ) ); } ); + RegisterTest( tests, "f32 convert to i32", []( TestRegf32 a ) { return FS::Convert( FS::Min( FS::Max( a, TestRegf32( -2147483647 - 1 ) ), TestRegf32( 2147483520 ) ) ); } ); RegisterTest( tests, "f32 cast to i32", []( TestRegf32 a ) { return FS::Cast( a ); } ); RegisterTest( tests, "i32 cast to f32", []( TestRegi32 a ) { return FS::Cast( a ); } );