arm64 detect marcos

This commit is contained in:
hymei
2022-06-05 01:13:12 +03:00
committed by nillerusr
parent ff588a8810
commit c7308906d1
11 changed files with 66 additions and 28 deletions
+5 -3
View File
@@ -457,6 +457,8 @@ void inline SinCos( float radians, float *sine, float *cosine )
#elif defined( PLATFORM_WINDOWS_PC64 )
*sine = sin( radians );
*cosine = cos( radians );
#elif defined( OSX )
__sincosf(radians, sine, cosine);
#elif defined( POSIX )
sincosf(radians, sine, cosine);
#endif
@@ -1213,7 +1215,7 @@ FORCEINLINE int RoundFloatToInt(float f)
};
flResult = __fctiw( f );
return pResult[1];
#elif defined (__arm__)
#elif defined (__arm__) || defined (__arm64__)
return (int)(f + 0.5f);
#else
#error Unknown architecture
@@ -1245,7 +1247,7 @@ FORCEINLINE unsigned long RoundFloatToUnsignedLong(float f)
Assert( pIntResult[1] >= 0 );
return pResult[1];
#else // !X360
#ifdef __arm__
#if defined(__arm__) || defined(__arm64__)
return (unsigned long)(f + 0.5f);
#elif defined( PLATFORM_WINDOWS_PC64 )
uint nRet = ( uint ) f;
@@ -2168,7 +2170,7 @@ inline bool CloseEnough( const Vector &a, const Vector &b, float epsilon = EQUAL
// Fast compare
// maxUlps is the maximum error in terms of Units in the Last Place. This
// specifies how big an error we are willing to accept in terms of the value
// of the least significant digit of the floating point numbers
// of the least significant digit of the floating point numbers
// representation. maxUlps can also be interpreted in terms of how many
// representable floats we are willing to accept between A and B.
// This function will allow maxUlps-1 floats between A and B.