Merge pull request #1151 from comex/generic-build-fixes

Fixes for _M_GENERIC build
This commit is contained in:
comex 2014-09-25 21:51:28 -04:00
commit 5a2114bb64
4 changed files with 25 additions and 11 deletions

View File

@ -45,12 +45,13 @@ if(_M_ARM)
else()
if(_M_X86) #X86
set(SRCS ${SRCS}
x64FPURoundMode.cpp)
x64FPURoundMode.cpp
x64CPUDetect.cpp)
else() # Generic
set(SRCS ${SRCS}
GenericFPURoundMode.cpp)
GenericFPURoundMode.cpp
GenericCPUDetect.cpp)
endif()
set(SRCS ${SRCS} x64CPUDetect.cpp)
endif()
if(WIN32)
set(SRCS ${SRCS} ExtendedTrace.cpp)

View File

@ -0,0 +1,14 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include "Common/CPUDetect.h"
CPUInfo cpu_info;
CPUInfo::CPUInfo() {}
std::string CPUInfo::Summarize()
{
return "Generic";
}

View File

@ -13,9 +13,7 @@
#else
//#include <config/i386/cpuid.h>
#ifndef _M_GENERIC
#include <xmmintrin.h>
#endif
#if defined __FreeBSD__
#include <sys/types.h>
@ -24,9 +22,7 @@
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
#if defined _M_GENERIC
(*eax) = (*ebx) = (*ecx) = (*edx) = 0;
#elif defined _LP64
#if defined _LP64
// Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to
// restored at the end of the asm block.
__asm__ (
@ -71,11 +67,9 @@ static void __cpuid(int info[4], int x)
#define _XCR_XFEATURE_ENABLED_MASK 0
static unsigned long long _xgetbv(unsigned int index)
{
#ifndef _M_GENERIC
unsigned int eax, edx;
__asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
return ((unsigned long long)edx << 32) | eax;
#endif
}
#endif

View File

@ -7,7 +7,12 @@
#include "Common/CommonTypes.h"
// meh.
#if defined(_WIN32)
#if defined(_M_GENERIC)
// JitBase uses SContext; it should have no concrete implementations in a
// generic build.
struct FakeGenericContext;
typedef FakeGenericContext SContext;
#elif defined(_WIN32)
#include <windows.h>
typedef CONTEXT SContext;
#if _M_X86_64