diff --git a/desmume/src/OGLRender.h b/desmume/src/OGLRender.h index ee37e1ddd..b75f8f146 100755 --- a/desmume/src/OGLRender.h +++ b/desmume/src/OGLRender.h @@ -670,8 +670,8 @@ public: void SetUpscalingBuffer(void *upscaleBuffer); }; -#if defined(ENABLE_AVX2) -class OpenGLRenderer : public Render3D_AVX2 +#if defined(ENABLE_AVX) +class OpenGLRenderer : public Render3D_AVX #elif defined(ENABLE_SSE2) class OpenGLRenderer : public Render3D_SSE2 #elif defined(ENABLE_ALTIVEC) diff --git a/desmume/src/matrix.h b/desmume/src/matrix.h index d7517d996..d400e2481 100644 --- a/desmume/src/matrix.h +++ b/desmume/src/matrix.h @@ -34,7 +34,11 @@ #endif #ifdef ENABLE_SSE4_1 -#include "smmintrin.h" +#include +#endif + +#ifdef ENABLE_AVX +#include #endif enum MatrixMode @@ -155,7 +159,7 @@ FORCEINLINE s32 sfx32_shiftdown(const s64 a) // SIMD Functions //------------- -#if defined(ENABLE_AVX2) +#if defined(ENABLE_AVX) static void memset_u16(void *dst, const u16 val, const size_t elementCount) { diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index 809132768..9b9858b2b 100755 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -1419,8 +1419,8 @@ static void* SoftRasterizer_RunClearUsingValues(void *arg) static Render3D* SoftRasterizerRendererCreate() { -#if defined(ENABLE_AVX2) - return new SoftRasterizerRenderer_AVX2; +#if defined(ENABLE_AVX) + return new SoftRasterizerRenderer_AVX; #elif defined(ENABLE_SSE2) return new SoftRasterizerRenderer_SSE2; #elif defined(ENABLE_ALTIVEC) @@ -1434,8 +1434,8 @@ static void SoftRasterizerRendererDestroy() { if (CurrentRenderer != BaseRenderer) { -#if defined(ENABLE_AVX2) - SoftRasterizerRenderer_AVX2 *oldRenderer = (SoftRasterizerRenderer_AVX2 *)CurrentRenderer; +#if defined(ENABLE_AVX) + SoftRasterizerRenderer_AVX *oldRenderer = (SoftRasterizerRenderer_AVX *)CurrentRenderer; #elif defined(ENABLE_SSE2) SoftRasterizerRenderer_SSE2 *oldRenderer = (SoftRasterizerRenderer_SSE2 *)CurrentRenderer; #elif defined(ENABLE_ALTIVEC) @@ -2492,7 +2492,7 @@ Render3DError SoftRasterizerRenderer::SetFramebufferSize(size_t w, size_t h) return RENDER3DERROR_NOERR; } -#if defined(ENABLE_AVX2) || defined(ENABLE_SSE2) || defined(ENABLE_ALTIVEC) +#if defined(ENABLE_AVX) || defined(ENABLE_SSE2) || defined(ENABLE_ALTIVEC) template SoftRasterizer_SIMD::SoftRasterizer_SIMD() @@ -2604,9 +2604,9 @@ Render3DError SoftRasterizer_SIMD::SetFramebufferSize(size_t w, size_ #endif -#if defined(ENABLE_AVX2) +#if defined(ENABLE_AVX) -void SoftRasterizerRenderer_AVX2::LoadClearValues(const FragmentColor &clearColor6665, const FragmentAttributes &clearAttributes) +void SoftRasterizerRenderer_AVX::LoadClearValues(const FragmentColor &clearColor6665, const FragmentAttributes &clearAttributes) { this->_clearColor_v256u32 = _mm256_set1_epi32(clearColor6665.color); this->_clearDepth_v256u32 = _mm256_set1_epi32(clearAttributes.depth); @@ -2618,7 +2618,7 @@ void SoftRasterizerRenderer_AVX2::LoadClearValues(const FragmentColor &clearColo this->_clearAttrPolyFacing_v256u8 = _mm256_set1_epi8(clearAttributes.polyFacing); } -void SoftRasterizerRenderer_AVX2::ClearUsingValues_Execute(const size_t startPixel, const size_t endPixel) +void SoftRasterizerRenderer_AVX::ClearUsingValues_Execute(const size_t startPixel, const size_t endPixel) { for (size_t i = startPixel; i < endPixel; i+=32) { diff --git a/desmume/src/rasterize.h b/desmume/src/rasterize.h index 636c94062..419793352 100644 --- a/desmume/src/rasterize.h +++ b/desmume/src/rasterize.h @@ -134,8 +134,8 @@ public: template FORCEINLINE void Render(); }; -#if defined(ENABLE_AVX2) -class SoftRasterizerRenderer : public Render3D_AVX2 +#if defined(ENABLE_AVX) +class SoftRasterizerRenderer : public Render3D_AVX #elif defined(ENABLE_SSE2) class SoftRasterizerRenderer : public Render3D_SSE2 #elif defined(ENABLE_ALTIVEC) @@ -218,7 +218,7 @@ template class SoftRasterizer_SIMD : public SoftRasterizerRenderer { protected: -#if defined(ENABLE_AVX2) +#if defined(ENABLE_AVX) v256u32 _clearColor_v256u32; v256u32 _clearDepth_v256u32; v256u8 _clearAttrOpaquePolyID_v256u8; @@ -247,8 +247,8 @@ public: virtual Render3DError SetFramebufferSize(size_t w, size_t h); }; -#if defined(ENABLE_AVX2) -class SoftRasterizerRenderer_AVX2 : public SoftRasterizer_SIMD<32> +#if defined(ENABLE_AVX) +class SoftRasterizerRenderer_AVX : public SoftRasterizer_SIMD<32> { protected: virtual void LoadClearValues(const FragmentColor &clearColor6665, const FragmentAttributes &clearAttributes); diff --git a/desmume/src/render3D.cpp b/desmume/src/render3D.cpp index d7da980ae..3ebdaa641 100755 --- a/desmume/src/render3D.cpp +++ b/desmume/src/render3D.cpp @@ -773,10 +773,10 @@ Render3DError Render3D_SIMD::SetFramebufferSize(size_t w, size_t h) return error; } -#if defined(ENABLE_AVX2) || defined(ENABLE_SSE2) +#if defined(ENABLE_AVX) || defined(ENABLE_SSE2) -#if defined(ENABLE_AVX2) -Render3DError Render3D_AVX2::ClearFramebuffer(const GFX3D_State &renderState) +#if defined(ENABLE_AVX) +Render3DError Render3D_AVX::ClearFramebuffer(const GFX3D_State &renderState) #elif defined(ENABLE_SSE2) Render3DError Render3D_SSE2::ClearFramebuffer(const GFX3D_State &renderState) #endif @@ -974,7 +974,7 @@ Render3DError Render3D_SSE2::ClearFramebuffer(const GFX3D_State &renderState) return error; } -#endif // defined(ENABLE_AVX2) || defined(ENABLE_SSE2) +#endif // defined(ENABLE_AVX) || defined(ENABLE_SSE2) template Render3D_SIMD<16>::Render3D_SIMD(); template Render3D_SIMD<32>::Render3D_SIMD(); diff --git a/desmume/src/render3D.h b/desmume/src/render3D.h index 641c18473..587affc22 100644 --- a/desmume/src/render3D.h +++ b/desmume/src/render3D.h @@ -281,9 +281,9 @@ public: virtual Render3DError SetFramebufferSize(size_t w, size_t h); }; -#if defined(ENABLE_AVX2) +#if defined(ENABLE_AVX) -class Render3D_AVX2 : public Render3D_SIMD<32> +class Render3D_AVX : public Render3D_SIMD<32> { public: virtual Render3DError ClearFramebuffer(const GFX3D_State &renderState); diff --git a/desmume/src/types.h b/desmume/src/types.h index 55238cf9c..689608166 100755 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -245,7 +245,7 @@ typedef __m128i v128u32; typedef __m128i v128s32; #endif -#ifdef ENABLE_AVX2 +#ifdef ENABLE_AVX #include typedef __m256i v256u8; typedef __m256i v256s8;