From 985ce847e4a992abbcb9d7a3dd9148936a914583 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 26 Oct 2020 10:19:53 +0000 Subject: [PATCH] Remove unused SSE vector from compressonator --- .../3rdparty/compressonator/cmp_math_vec4.h | 164 ------------------ 1 file changed, 164 deletions(-) diff --git a/renderdoc/3rdparty/compressonator/cmp_math_vec4.h b/renderdoc/3rdparty/compressonator/cmp_math_vec4.h index 9c0800282..a14be714f 100644 --- a/renderdoc/3rdparty/compressonator/cmp_math_vec4.h +++ b/renderdoc/3rdparty/compressonator/cmp_math_vec4.h @@ -395,170 +395,6 @@ public: #include #include #include -#include "xmmintrin.h" - -// SSE Vec4 -#ifdef _LINUX -class CMP_SSEVec4f -#else -#include "intrin.h" -class __declspec(align(16)) CMP_SSEVec4f -#endif -{ -public: - union - { - __m128 vec128; // float Vector 128 bits in total (16 Bytes) = array of 4 floats -#ifdef _LINUX - float f32[4]; -#endif - }; - - // constructors - inline CMP_SSEVec4f(){}; - inline CMP_SSEVec4f(float x, float y, float z, float w) : vec128(_mm_setr_ps(x, y, z, w)){}; - inline CMP_SSEVec4f(__m128 vec) : vec128(vec) {} - inline CMP_SSEVec4f(const float *data) : vec128(_mm_load_ps(data)){}; - inline CMP_SSEVec4f(float scalar) : vec128(_mm_load1_ps(&scalar)){}; - - // copy and assignment - inline CMP_SSEVec4f(const CMP_SSEVec4f &init) : vec128(init.vec128){}; - inline const CMP_SSEVec4f &operator=(const CMP_SSEVec4f &lhs) - { - vec128 = lhs.vec128; - return *this; - }; - - // conversion to m128 type for direct use in _mm intrinsics - inline operator __m128() { return vec128; }; - inline operator const __m128() const { return vec128; }; -// indexing -#ifdef _LINUX - inline const float &operator[](int i) const { return f32[i]; }; - inline float &operator[](int i) { return f32[i]; }; -#else - inline const float &operator[](int i) const { return vec128.m128_f32[i]; }; - inline float &operator[](int i) { return vec128.m128_f32[i]; }; -#endif - - // addition - inline CMP_SSEVec4f operator+(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_add_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f &operator+=(const CMP_SSEVec4f &rhs) - { - vec128 = _mm_add_ps(vec128, rhs.vec128); - return *this; - }; - - // multiplication - inline CMP_SSEVec4f operator*(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_mul_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f &operator*=(const CMP_SSEVec4f &rhs) - { - vec128 = _mm_mul_ps(vec128, rhs.vec128); - return *this; - }; - - // scalar multiplication - // inline CMP_SSEVec4f operator*( float rhs ) const { return CMP_SSEVec4f( _mm_mul_ps(vec128, - // _mm_load1_ps(&rhs)) ); }; - // inline CMP_SSEVec4f& operator*=( float rhs ) { vec128 = _mm_mul_ps(vec128, - // _mm_load1_ps(&rhs)); return *this; }; - - // subtraction - inline CMP_SSEVec4f operator-(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_sub_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f &operator-=(const CMP_SSEVec4f &rhs) - { - vec128 = _mm_sub_ps(vec128, rhs.vec128); - return *this; - }; - - // division - inline CMP_SSEVec4f operator/(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_div_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f &operator/=(const CMP_SSEVec4f &rhs) - { - vec128 = _mm_div_ps(vec128, rhs.vec128); - return *this; - }; - - // scalar division - inline CMP_SSEVec4f operator/(float rhs) const - { - return CMP_SSEVec4f(_mm_div_ps(vec128, _mm_load1_ps(&rhs))); - }; - inline CMP_SSEVec4f &operator/=(float rhs) - { - vec128 = _mm_div_ps(vec128, _mm_load1_ps(&rhs)); - return *this; - }; - - // comparison - // these return 0 or 0xffffffff in each component - inline CMP_SSEVec4f operator<(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_cmplt_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f operator>(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_cmpgt_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f operator<=(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_cmple_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f operator>=(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_cmpge_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f operator==(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_cmpeq_ps(vec128, rhs.vec128)); - }; - - // bitwise operators - inline CMP_SSEVec4f operator|(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_or_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f operator&(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_and_ps(vec128, rhs.vec128)); - }; - inline CMP_SSEVec4f operator^(const CMP_SSEVec4f &rhs) const - { - return CMP_SSEVec4f(_mm_xor_ps(vec128, rhs.vec128)); - }; - inline const CMP_SSEVec4f &operator|=(const CMP_SSEVec4f &rhs) - { - vec128 = _mm_or_ps(vec128, rhs.vec128); - return *this; - }; - inline const CMP_SSEVec4f &operator&=(const CMP_SSEVec4f &rhs) - { - vec128 = _mm_and_ps(vec128, rhs.vec128); - return *this; - }; - - // for some horrible reason,there's no bitwise not instruction for SSE, - // so we have to do xor with 0xfffffff in order to fake it. - // TO get a 0xffffffff, we execute 0=0 - inline CMP_SSEVec4f operator~() const - { - __m128 zero = _mm_setzero_ps(); - __m128 is_true = _mm_cmpeq_ps(zero, zero); - return _mm_xor_ps(is_true, vec128); - }; -}; typedef Vec4 CMP_Vec4f; typedef Vec4 CMP_Vec4d;