Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
er2off committed Aug 14, 2023
1 parent a103391 commit 9cebd44
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion engine/l_studio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "materialsystem/materialsystem_config.h"
#include "materialsystem/itexture.h"
#include "IHammer.h"
#if defined( _WIN32 ) && !defined( _X360 ) && !defined(_M_ARM)
#if defined( _WIN32 ) && defined( _M_IX86 )
#include <xmmintrin.h>
#endif
#include "staticpropmgr.h"
Expand Down
6 changes: 3 additions & 3 deletions public/materialsystem/imesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex )
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
Assert( m_nCurrentVertex < m_nMaxVertexCount );

#if defined( _WIN32 ) && !defined( _X360 ) && defined( _M_IX86 )
#if defined( _WIN32 ) && defined( _M_IX86 )
const void *pRead = &vertex;
void *pCurrPos = m_pCurrPosition;
__asm
Expand Down Expand Up @@ -1265,7 +1265,7 @@ inline void CVertexBuilder::Fast4VerticesSSE(
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
Assert( m_nCurrentVertex < m_nMaxVertexCount-3 );

#if defined( _WIN32 ) && !defined( _X360 ) && defined( _M_IX86 )
#if defined( _WIN32 ) && defined( _M_IX86 )
void *pCurrPos = m_pCurrPosition;
__asm
{
Expand Down Expand Up @@ -1426,7 +1426,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex )
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
Assert( m_nCurrentVertex < m_nMaxVertexCount );

#if defined( _WIN32 ) && !defined( _X360 ) && defined( _M_IX86 )
#if defined( _WIN32 ) && defined( _M_IX86 )
const void *pRead = &vertex;
void *pCurrPos = m_pCurrPosition;
__asm
Expand Down
2 changes: 1 addition & 1 deletion public/mathlib/mathlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ inline float SimpleSplineRemapValClamped( float val, float A, float B, float C,

FORCEINLINE int RoundFloatToInt(float f)
{
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(PLATFORM_WINDOWS_PC64)
return _mm_cvtss_si32(_mm_load_ss(&f));
#elif defined( _X360 )
#ifdef Assert
Expand Down
8 changes: 4 additions & 4 deletions public/mathlib/ssemath.h
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ FORCEINLINE fltx4 ReplicateX4( float flValue )
FORCEINLINE float SubFloat( const fltx4 & a, int idx )
{
// NOTE: if the output goes into a register, this causes a Load-Hit-Store stall (don't mix fpu/vpu math!)
#if defined(_WIN32) && defined(__i386__) || defined(__x86_64__)
#if defined(_WIN32) && (defined(__i386__) || defined(__x86_64__))
return a.m128_f32[ idx ];
#else
return (reinterpret_cast<float const *>(&a))[idx];
Expand All @@ -1843,7 +1843,7 @@ FORCEINLINE float SubFloat( const fltx4 & a, int idx )

FORCEINLINE float & SubFloat( fltx4 & a, int idx )
{
#if defined(_WIN32) && defined(__i386__) || defined(__x86_64__)
#if defined(_WIN32) && (defined(__i386__) || defined(__x86_64__))
return a.m128_f32[ idx ];
#else
return (reinterpret_cast<float *>(&a))[idx];
Expand All @@ -1857,7 +1857,7 @@ FORCEINLINE uint32 SubFloatConvertToInt( const fltx4 & a, int idx )

FORCEINLINE uint32 SubInt( const fltx4 & a, int idx )
{
#if defined(_WIN32) && defined(__i386__) || defined(__x86_64__)
#if defined(_WIN32) && (defined(__i386__) || defined(__x86_64__))
return a.m128_u32[ idx ];
#else
return (reinterpret_cast<uint32 const *>(&a))[idx];
Expand All @@ -1866,7 +1866,7 @@ FORCEINLINE uint32 SubInt( const fltx4 & a, int idx )

FORCEINLINE uint32 & SubInt( fltx4 & a, int idx )
{
#if defined(_WIN32) && defined(__i386__) || defined(__x86_64__)
#if defined(_WIN32) && (defined(__i386__) || defined(__x86_64__))
return a.m128_u32[ idx ];
#else
return (reinterpret_cast<uint32 *>(&a))[idx];
Expand Down
1 change: 0 additions & 1 deletion public/tier0/tslist.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#if defined( PLATFORM_64BITS ) && !defined(_M_ARM64)

#if defined (PLATFORM_WINDOWS)
typedef __int128 int128;
//typedef __m128i int128;
//inline int128 int128_zero() { return _mm_setzero_si128(); }
#else // PLATFORM_WINDOWS
Expand Down
2 changes: 1 addition & 1 deletion studiorender/r_studiodraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ static matrix3x4_t *ComputeSkinMatrix( mstudioboneweight_t &boneweights, matrix3
static matrix3x4_t *ComputeSkinMatrixSSE( mstudioboneweight_t &boneweights, matrix3x4_t *pPoseToWorld, matrix3x4_t &result )
{
// NOTE: pPoseToWorld, being cache aligned, doesn't need explicit initialization
#if defined( _WIN32 ) && !defined( _X360 ) && defined(_M_IX86)
#if defined( _WIN32 ) && defined(_M_IX86)
switch( boneweights.numbones )
{
default:
Expand Down
2 changes: 1 addition & 1 deletion tier0/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const tchar* GetProcessorVendorId();

static bool cpuid(uint32 function, uint32& out_eax, uint32& out_ebx, uint32& out_ecx, uint32& out_edx)
{
#if !defined(__i386__) && !defined(__x86_64) || defined( _X360 )
#if !defined(__i386__) && !defined(__x86_64)
return false;
#elif defined(GNUC)

Expand Down
6 changes: 3 additions & 3 deletions tier0/stacktools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int GetCallStack_Fast( void **pReturnAddressesOut, int iArrayCount, int iSkipCou
{
//Only tested in windows. This function won't work with frame pointer omission enabled. "vpc /nofpo" all projects
#if (defined( TIER0_FPO_DISABLED ) || defined( _DEBUG )) &&\
(defined( WIN32 ) && !defined( _X360 ) && defined(_M_X86))
(defined( WIN32 ) && defined(_M_X86))
void *pStackCrawlEBP;
__asm
{
Expand Down Expand Up @@ -1467,7 +1467,7 @@ CStackTop_CopyParentStack::CStackTop_CopyParentStack( void * const *pParentStack
#if defined( ENABLE_RUNTIME_STACK_TRANSLATION )
//miniature version of GetCallStack_Fast()
#if (defined( TIER0_FPO_DISABLED ) || defined( _DEBUG )) &&\
(defined( WIN32 ) && !defined( _X360 ) && defined(_M_X86))
(defined( WIN32 ) && defined(_M_X86))
void *pStackCrawlEBP;
__asm
{
Expand Down Expand Up @@ -1525,7 +1525,7 @@ CStackTop_ReferenceParentStack::CStackTop_ReferenceParentStack( void * const *pP
#if defined( ENABLE_RUNTIME_STACK_TRANSLATION )
//miniature version of GetCallStack_Fast()
#if (defined( TIER0_FPO_DISABLED ) || defined( _DEBUG )) &&\
(defined( WIN32 ) && !defined( _X360 ) && defined(_M_X86))
(defined( WIN32 ) && defined(_M_X86))
void *pStackCrawlEBP;
__asm
{
Expand Down

0 comments on commit 9cebd44

Please sign in to comment.