From ace0568d0964616006f9865c0990476d119f80a5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 Apr 2017 11:52:32 +0200 Subject: [PATCH] - now that SSE2 is a required feature for compiling on x86, DoBlending_MMX has no use anymore and could be removed, as could the checks for bRDTSC, which is an older hardware feature than SSE2. There's also little point printing pre-SSE2 hardware features because they can be assumed to be present on anything the code can run on. --- src/gl/utility/gl_clock.h | 4 ---- src/stats.h | 8 +------- src/v_palette.cpp | 37 ++++++++----------------------------- src/win32/i_system.cpp | 2 +- src/win32/win32gliface.cpp | 2 +- 5 files changed, 11 insertions(+), 42 deletions(-) diff --git a/src/gl/utility/gl_clock.h b/src/gl/utility/gl_clock.h index 957090861e..fb96a69a27 100644 --- a/src/gl/utility/gl_clock.h +++ b/src/gl/utility/gl_clock.h @@ -14,11 +14,7 @@ extern double gl_MillisecPerCycle; __forceinline int64_t GetClockCycle () { -#if _M_X64 return __rdtsc(); -#else - return CPU.bRDTSC ? __rdtsc() : 0; -#endif } #elif defined __APPLE__ && (defined __i386__ || defined __x86_64__) diff --git a/src/stats.h b/src/stats.h index df61dafb0f..86a5b8f1c6 100644 --- a/src/stats.h +++ b/src/stats.h @@ -115,13 +115,7 @@ extern "C" unsigned __int64 __rdtsc(void); #pragma intrinsic(__rdtsc) inline unsigned __int64 rdtsc() { -#ifndef _M_X64 - if (CPU.bRDTSC) -#endif - { - return __rdtsc(); - } - return 0; + return __rdtsc(); } #else inline uint64_t rdtsc() diff --git a/src/v_palette.cpp b/src/v_palette.cpp index 606826d13f..11e3f69456 100644 --- a/src/v_palette.cpp +++ b/src/v_palette.cpp @@ -410,7 +410,6 @@ void InitPalette () R_InitColormaps (); } -void DoBlending_MMX (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a); void DoBlending_SSE2 (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a); void DoBlending (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a) @@ -435,37 +434,17 @@ void DoBlending (const PalEntry *from, PalEntry *to, int count, int r, int g, in return; } #if defined(_M_X64) || defined(_M_IX86) || defined(__i386__) || defined(__amd64__) - else if (CPU.bSSE2) + else if (count >= 4) { - if (count >= 4) + int not3count = count & ~3; + DoBlending_SSE2 (from, to, not3count, r, g, b, a); + count &= 3; + if (count <= 0) { - int not3count = count & ~3; - DoBlending_SSE2 (from, to, not3count, r, g, b, a); - count &= 3; - if (count <= 0) - { - return; - } - from += not3count; - to += not3count; - } - } -#endif -#if defined(_M_IX86) || defined(__i386__) - else if (CPU.bMMX) - { - if (count >= 4) - { - int not3count = count & ~3; - DoBlending_MMX (from, to, not3count, r, g, b, a); - count &= 3; - if (count <= 0) - { - return; - } - from += not3count; - to += not3count; + return; } + from += not3count; + to += not3count; } #endif int i, ia; diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 003e956628..609be23016 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -707,7 +707,7 @@ void CalculateCPUSpeed() QueryPerformanceFrequency (&freq); - if (freq.QuadPart != 0 && CPU.bRDTSC) + if (freq.QuadPart != 0) { LARGE_INTEGER count1, count2; cycle_t ClockCalibration; diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index 3d4bca30a8..614adaa2d5 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -167,7 +167,7 @@ public: Win32GLVideo::Win32GLVideo(int parm) : m_Modes(NULL), m_IsFullscreen(false) { #ifdef _WIN32 - if (CPU.bRDTSC) gl_CalculateCPUSpeed(); + gl_CalculateCPUSpeed(); #endif I_SetWndProc(); m_DisplayWidth = vid_defwidth;