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.
+1 -1
View File
@@ -8,7 +8,7 @@
#if defined( _X360 )
#include <xboxmath.h>
#elif defined(__arm__)
#elif defined(__arm__) || defined(__arm64__)
#include "sse2neon.h"
#else
#include <xmmintrin.h>
+3 -3
View File
@@ -654,10 +654,10 @@ inline void Vector4DWeightMAD( vec_t w, Vector4DAligned const& vInA, Vector4DAli
vOutB.z += vInB.z * w;
vOutB.w += vInB.w * w;
#else
__vector4 temp;
__vector4 temp;
temp = __lvlx( &w, 0 );
temp = __vspltw( temp, 0 );
temp = __lvlx( &w, 0 );
temp = __vspltw( temp, 0 );
vOutA.AsM128() = __vmaddfp( vInA.AsM128(), temp, vOutA.AsM128() );
vOutB.AsM128() = __vmaddfp( vInB.AsM128(), temp, vOutB.AsM128() );