mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[idd] wcwrite: gate SIMD stores on SSE2
This commit is contained in:
@@ -44,7 +44,7 @@ namespace WCWrite
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_M_IX86) || defined(_M_X64)
|
#if defined(_M_IX86) || defined(_M_X64)
|
||||||
__declspec(noinline) void CopySSE41(
|
__declspec(noinline) void CopySSE2(
|
||||||
void * destination, const void * source, size_t size)
|
void * destination, const void * source, size_t size)
|
||||||
{
|
{
|
||||||
uint8_t * dst = static_cast<uint8_t *>(destination);
|
uint8_t * dst = static_cast<uint8_t *>(destination);
|
||||||
@@ -104,7 +104,7 @@ namespace WCWrite
|
|||||||
return &CopyFallback;
|
return &CopyFallback;
|
||||||
|
|
||||||
__cpuidex(registers, 1, 0);
|
__cpuidex(registers, 1, 0);
|
||||||
const bool sse41 = (registers[2] & (1 << 19)) != 0;
|
const bool sse2 = (registers[3] & (1 << 26)) != 0;
|
||||||
const bool avx = (registers[2] & (1 << 28)) != 0;
|
const bool avx = (registers[2] & (1 << 28)) != 0;
|
||||||
const bool osxsave = (registers[2] & (1 << 27)) != 0;
|
const bool osxsave = (registers[2] & (1 << 27)) != 0;
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ namespace WCWrite
|
|||||||
return &Detail::CopyAVX2;
|
return &Detail::CopyAVX2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sse41 ? &CopySSE41 : &CopyFallback;
|
return sse2 ? &CopySSE2 : &CopyFallback;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
CopyFn SelectCopy()
|
CopyFn SelectCopy()
|
||||||
|
|||||||
Reference in New Issue
Block a user