SSE related includes reorganized

git-svn-id: svn://ultimatepp.org/upp/trunk@14492 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-05-22 11:10:22 +00:00
parent 175eda6c88
commit fdfa8dcf23
4 changed files with 8 additions and 3 deletions

View file

@ -1,7 +1,4 @@
#ifdef CPU_X86
#include <emmintrin.h>
void huge_memsetd(void *p, dword data, size_t len);
void memsetd_l(dword *t, dword data, size_t len);

View file

@ -61,6 +61,10 @@
#include <math.h>
#include <ctype.h>
#ifdef CPU_X86
#include <immintrin.h>
#endif
#if defined(PLATFORM_POSIX)
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64

View file

@ -14,6 +14,7 @@ static bool sHasMMX;
static bool sHasSSE;
static bool sHasSSE2;
static bool sHasSSE3;
static bool sHasAVX;
static bool sHypervisor;
static void sCheckCPU()
@ -38,6 +39,7 @@ static void sCheckCPU()
sHasSSE = edx & (1 << 25);
sHasSSE2 = edx & (1 << 26);
sHasSSE3 = ecx & 1;
sHasAVX = ecx & (1 << 28);
sHypervisor = ecx & (1 << 31);
}
}
@ -50,6 +52,7 @@ bool CpuMMX() { sCheckCPU(); return sHasMMX; }
bool CpuSSE() { sCheckCPU(); return sHasSSE; }
bool CpuSSE2() { sCheckCPU(); return sHasSSE2; }
bool CpuSSE3() { sCheckCPU(); return sHasSSE3; }
bool CpuAVX() { sCheckCPU(); return sHasAVX; }
bool CpuHypervisor() { sCheckCPU(); return sHypervisor; }
#ifdef PLATFORM_POSIX

View file

@ -479,6 +479,7 @@ bool CpuSSE();
bool CpuSSE2();
bool CpuSSE3();
bool CpuHypervisor();
bool CpuAVX();
#endif
int CPU_Cores();