First steps

This commit is contained in:
JusicP
2020-11-19 22:37:27 +02:00
parent 6920a3bd08
commit 3434111923
1341 changed files with 883624 additions and 46746 deletions
+28 -4
View File
@@ -3316,6 +3316,28 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
// FIXME: Hook SSE into VectorAligned + Vector4DAligned
#if defined(ANDROID)
s_b3DNowEnabled = bAllow3DNow = false;
s_bSSEEnabled = bAllowSSE = false;
s_bSSE2Enabled = bAllowSSE2 = false;
s_bMMXEnabled = bAllowMMX = false;
// Select the default generic routines.
pfSqrt = _sqrtf;
pfRSqrt = _rsqrtf;
pfRSqrtFast = _rsqrtf;
pfVectorNormalize = _VectorNormalize;
pfVectorNormalizeFast = _VectorNormalizeFast;
pfInvRSquared = _InvRSquared;
pfFastSinCos = SinCos;
pfFastCos = cosf;
s_bMathlibInitialized = true;
InitSinCosTable();
BuildGammaTable( gamma, texGamma, brightness, overbright );
#else
#if !defined( _X360 )
// Grab the processor information:
const CPUInformation& pi = *GetCPUInformation();
@@ -3343,7 +3365,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
// SSE Generally performs better than 3DNow when present, so this is placed
// first to allow SSE to override these settings.
#if !defined( OSX ) && !defined( PLATFORM_WINDOWS_PC64 ) && !defined(LINUX)
#if !defined( OSX ) && !defined( PLATFORM_WINDOWS_PC64 ) && !defined(LINUX) && !defined(__arm__)
if ( bAllow3DNow && pi.m_b3DNow )
{
s_b3DNowEnabled = true;
@@ -3366,7 +3388,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
{
s_bSSEEnabled = true;
#ifndef PLATFORM_WINDOWS_PC64
#if !defined(PLATFORM_WINDOWS_PC64) && !defined(__arm__)
// These are not yet available.
// Select the SSE specific routines if available
pfVectorNormalize = _VectorNormalize;
@@ -3376,7 +3398,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
pfRSqrt = _SSE_RSqrtAccurate;
pfRSqrtFast = _SSE_RSqrtFast;
#endif
#ifdef PLATFORM_WINDOWS_PC32
#if defined(PLATFORM_WINDOWS_PC32) && !defined(__arm__)
pfFastSinCos = _SSE_SinCos;
pfFastCos = _SSE_cos;
#endif
@@ -3389,7 +3411,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
if ( bAllowSSE2 && pi.m_bSSE2 )
{
s_bSSE2Enabled = true;
#ifdef PLATFORM_WINDOWS_PC32
#if defined(PLATFORM_WINDOWS_PC32) && !defined(__arm__)
pfFastSinCos = _SSE2_SinCos;
pfFastCos = _SSE2_cos;
#endif
@@ -3404,6 +3426,8 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
InitSinCosTable();
BuildGammaTable( gamma, texGamma, brightness, overbright );
#endif // ANDROID
}
bool MathLib_3DNowEnabled( void )
+1 -1
View File
@@ -16,7 +16,7 @@
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#ifndef COMPILER_MSVC64
#if !defined(COMPILER_MSVC64) && !defined(__arm__)
// Implement for 64-bit Windows if needed.
static const uint32 _sincos_masks[] = { (uint32)0x0, (uint32)~0x0 };