mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-05 22:09:59 +03:00
First steps
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h> // For rand(). We really need a library!
|
||||
#include <float.h>
|
||||
#if !defined( _X360 )
|
||||
#if !defined( _X360 ) && !defined(__arm__)
|
||||
#include <xmmintrin.h> // For SSE
|
||||
#endif
|
||||
#include "basetypes.h" // For vec_t, put this somewhere else?
|
||||
@@ -141,8 +141,10 @@ public:
|
||||
inline void Set( vec_t X, vec_t Y, vec_t Z, vec_t W );
|
||||
inline void InitZero( void );
|
||||
|
||||
#ifndef __arm__
|
||||
inline __m128 &AsM128() { return *(__m128*)&x; }
|
||||
inline const __m128 &AsM128() const { return *(const __m128*)&x; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
// No copy constructors allowed if we're in optimal mode
|
||||
@@ -614,7 +616,9 @@ inline void Vector4DAligned::Set( vec_t X, vec_t Y, vec_t Z, vec_t W )
|
||||
|
||||
inline void Vector4DAligned::InitZero( void )
|
||||
{
|
||||
#if !defined( _X360 )
|
||||
#if defined(__arm__)
|
||||
x = y = z = w = 0.0f;
|
||||
#elif !defined( _X360 )
|
||||
this->AsM128() = _mm_set1_ps( 0.0f );
|
||||
#else
|
||||
this->AsM128() = __vspltisw( 0 );
|
||||
@@ -663,8 +667,10 @@ inline void Vector4DWeightMAD( vec_t w, Vector4DAligned const& vInA, Vector4DAli
|
||||
inline void Vector4DWeightMADSSE( vec_t w, Vector4DAligned const& vInA, Vector4DAligned& vOutA, Vector4DAligned const& vInB, Vector4DAligned& vOutB )
|
||||
{
|
||||
Assert( vInA.IsValid() && vInB.IsValid() && IsFinite(w) );
|
||||
|
||||
#if !defined( _X360 )
|
||||
|
||||
#if defined(__arm__)
|
||||
Vector4DWeightMAD( w, vInA, vOutA, vInB, vOutB );
|
||||
#elif !defined( _X360 )
|
||||
// Replicate scalar float out to 4 components
|
||||
__m128 packed = _mm_set1_ps( w );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user