From 770485ad04185c93ea18b8bf86e56569d1fb8f37 Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 16 Jan 2014 22:07:48 +0100 Subject: [PATCH] VertexLoader: don't check for possible range I(index) < std::numeric_limits::max() is always true, so we don't have to check it --- .../VideoCommon/VertexLoader_Position.cpp | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index da844484ad..3206c002a9 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -90,15 +90,12 @@ void LOADERDECL Pos_ReadIndex() static_assert(N <= 3, "N > 3 is not sane!"); auto const index = DataRead(); - if (index < std::numeric_limits::max()) - { - auto const data = reinterpret_cast(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION])); + auto const data = reinterpret_cast(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION])); - for (int i = 0; i < 3; ++i) - DataWrite(i= 0x301 @@ -109,15 +106,12 @@ template void LOADERDECL Pos_ReadIndex_Float_SSSE3() { auto const index = DataRead(); - if (index < std::numeric_limits::max()) - { - const u32* pData = (const u32 *)(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION])); - GC_ALIGNED128(const __m128i a = _mm_loadu_si128((__m128i*)pData)); - GC_ALIGNED128(__m128i b = _mm_shuffle_epi8(a, three ? kMaskSwap32_3 : kMaskSwap32_2)); - _mm_storeu_si128((__m128i*)VertexManager::s_pCurBufferPointer, b); - VertexManager::s_pCurBufferPointer += sizeof(float) * 3; - LOG_VTX(); - } + const u32* pData = (const u32 *)(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION])); + GC_ALIGNED128(const __m128i a = _mm_loadu_si128((__m128i*)pData)); + GC_ALIGNED128(__m128i b = _mm_shuffle_epi8(a, three ? kMaskSwap32_3 : kMaskSwap32_2)); + _mm_storeu_si128((__m128i*)VertexManager::s_pCurBufferPointer, b); + VertexManager::s_pCurBufferPointer += sizeof(float) * 3; + LOG_VTX(); } #endif