mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-27 01:22:37 -06:00
common/cpu_detect: Add missing include and fix namespace scope
This commit is contained in:
parent
eb435816e3
commit
6ca816e011
1 changed files with 7 additions and 5 deletions
|
@ -8,9 +8,9 @@
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "cpu_detect.h"
|
#include "cpu_detect.h"
|
||||||
|
|
||||||
namespace Common {
|
#ifdef _MSC_VER
|
||||||
|
#include <intrin.h>
|
||||||
#ifndef _MSC_VER
|
#else
|
||||||
|
|
||||||
#if defined(__DragonFly__) || defined(__FreeBSD__)
|
#if defined(__DragonFly__) || defined(__FreeBSD__)
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@ -37,13 +37,15 @@ static inline void __cpuid(int info[4], int function_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define _XCR_XFEATURE_ENABLED_MASK 0
|
#define _XCR_XFEATURE_ENABLED_MASK 0
|
||||||
static u64 _xgetbv(u32 index) {
|
static inline u64 _xgetbv(u32 index) {
|
||||||
u32 eax, edx;
|
u32 eax, edx;
|
||||||
__asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
|
__asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
|
||||||
return ((u64)edx << 32) | eax;
|
return ((u64)edx << 32) | eax;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ifndef _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
|
namespace Common {
|
||||||
|
|
||||||
// Detects the various CPU features
|
// Detects the various CPU features
|
||||||
static CPUCaps Detect() {
|
static CPUCaps Detect() {
|
||||||
|
|
Loading…
Reference in a new issue