detect if AVX is supported
This commit is contained in:
parent
537b8605b0
commit
f4ee6128c4
5 changed files with 25 additions and 2 deletions
|
@ -4,13 +4,15 @@
|
|||
#include "blt.h"
|
||||
|
||||
|
||||
BOOL g_blt_use_avx;
|
||||
|
||||
void blt_copy(
|
||||
unsigned char* dst,
|
||||
unsigned char* src,
|
||||
size_t size)
|
||||
{
|
||||
#ifdef __AVX__
|
||||
if (size >= 1024 * 1536 && !((DWORD)dst % 32) && !((DWORD)src % 32))
|
||||
if (size >= 1024 * 4096 && g_blt_use_avx && !((DWORD)dst % 32) && !((DWORD)src % 32))
|
||||
{
|
||||
while (size >= 256)
|
||||
{
|
||||
|
@ -45,7 +47,7 @@ void blt_copy(
|
|||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif // __AVX__
|
||||
|
||||
if (size >= 1024 * 100)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue