- 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.

This commit is contained in:
Christoph Oelckers 2017-04-23 11:52:32 +02:00
parent 63e0310961
commit ace0568d09
5 changed files with 11 additions and 42 deletions

View file

@ -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__)

View file

@ -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()

View file

@ -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;

View file

@ -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;

View file

@ -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;