1
0
forked from 0ad/0ad

slight improvement, use ARCH_X86_X64 instead of ARCH_IA32||ARCH_AMD64

This was SVN commit r6411.
This commit is contained in:
janwas 2008-09-27 10:23:05 +00:00
parent aea2368300
commit 34b418e0c1
6 changed files with 17 additions and 11 deletions

View File

@ -13,7 +13,7 @@
#include "maths/MathUtil.h"
#include "graphics/SColor.h"
#if ARCH_IA32 || ARCH_AMD64
#if ARCH_X86_X64
# include <xmmintrin.h>
# include "lib/sysdep/arch/x86_x64/x86_x64.h"
#endif
@ -33,7 +33,7 @@ SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src) = fallback_ConvertRGBColo
// Assembler-optimized function for color conversion
#if ARCH_IA32 || ARCH_AMD64
#if ARCH_X86_X64
static SColor4ub sse_ConvertRGBColorTo4ub(const RGBColor& src)
{
const __m128 zero = _mm_setzero_ps();
@ -69,7 +69,7 @@ void ColorActivateFastImpl()
if(0)
{
}
#if ARCH_IA32 || ARCH_AMD64
#if ARCH_X86_X64
else if (x86_x64_cap(X86_X64_CAP_SSE))
{
ConvertRGBColorTo4ub = sse_ConvertRGBColorTo4ub;

View File

@ -49,6 +49,12 @@
# define ARCH_MIPS 0
#endif
// ensure exactly one architecture has been detected
#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_MIPS) != 1
# error "architecture not correctly detected (either none or multiple ARCH_* defined)"
#endif
// "X86_X64"-specific code requires either IA-32 or AMD64
#define ARCH_X86_X64 (ARCH_IA32|ARCH_AMD64)
#endif // #ifndef INCLUDED_ARCH

View File

@ -11,8 +11,8 @@
#ifndef INCLUDED_X86_X64
#define INCLUDED_X86_X64
#if !ARCH_IA32 && !ARCH_AMD64
#error "including x86_x64.h without ARCH_IA32=1 or ARCH_AMD64=1"
#if !ARCH_X86_X64
#error "including x86_x64.h without ARCH_X86_X64=1"
#endif
/**

View File

@ -312,7 +312,7 @@ LibError wdbg_sym_WalkStack(StackFrameCallback cb, uintptr_t cbData, const CONTE
// this MUST be done inline and not in an external function because
// compiler-generated prolog code trashes some registers.
#if ARCH_IA32 && !ARCH_AMD64
#if ARCH_IA32
ia32_asm_GetCurrentContext(&context);
#else
if(!s_RtlCaptureContext)

View File

@ -18,7 +18,7 @@
#include "lib/sysdep/os/win/win.h"
#include "lib/sysdep/os/win/wutil.h"
#if ARCH_IA32 || ARCH_AMD64
#if ARCH_X86_X64
# include "lib/sysdep/arch/x86_x64/x86_x64.h" // x86_x64_rdtsc
# include "lib/sysdep/arch/x86_x64/topology.h"
#endif
@ -36,7 +36,7 @@ enum AmdPowerNowFlags
static bool IsThrottlingPossible()
{
#if ARCH_IA32 || ARCH_AMD64
#if ARCH_X86_X64
x86_x64_CpuidRegs regs;
switch(x86_x64_Vendor())
{
@ -71,7 +71,7 @@ public:
LibError Activate()
{
#if ARCH_IA32 || ARCH_AMD64
#if ARCH_X86_X64
if(!x86_x64_cap(X86_X64_CAP_TSC))
return ERR::NO_SYS; // NOWARN (CPU doesn't support RDTSC)
#endif
@ -114,7 +114,7 @@ public:
return false;
}
#if ARCH_IA32 || ARCH_AMD64
#if ARCH_X86_X64
// recent CPU:
if(x86_x64_Generation() >= 7)
{

View File

@ -25,7 +25,7 @@
# include <unistd.h>
#endif
#include "lib/config2.h" // CONFIG2_TIMER_ALLOW_RDTSC
#if (ARCH_IA32 || ARCH_AMD64) && CONFIG2_TIMER_ALLOW_RDTSC
#if ARCH_X86_X64 && CONFIG2_TIMER_ALLOW_RDTSC
# include "lib/sysdep/arch/x86_x64/x86_x64.h" // x86_x64_rdtsc
#endif