summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2015-08-14 22:29:08 -0400
committerGravatar bunnei2015-08-15 18:03:27 -0400
commitb39c053785abc4a94ce380885a846c5d8be89675 (patch)
tree42911208a051652a7452c8bbbd35ec91aa2d4e20 /src
parentCommon: Cleanup CPU capability detection code. (diff)
downloadyuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar.gz
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar.xz
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.zip
Rename ARCHITECTURE_X64 definition to ARCHITECTURE_x86_64.
Diffstat (limited to 'src')
-rw-r--r--src/common/CMakeLists.txt2
-rw-r--r--src/common/common_funcs.h2
-rw-r--r--src/common/memory_util.cpp8
-rw-r--r--src/common/platform.h2
-rw-r--r--src/common/x64/abi.cpp4
-rw-r--r--src/common/x64/abi.h2
-rw-r--r--src/common/x64/emitter.cpp6
-rw-r--r--src/common/x64/emitter.h2
-rw-r--r--src/video_core/CMakeLists.txt2
-rw-r--r--src/video_core/shader/shader.cpp11
10 files changed, 20 insertions, 21 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 53c915606..e743a026d 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -58,7 +58,7 @@ set(HEADERS
58 vector_math.h 58 vector_math.h
59 ) 59 )
60 60
61if(ARCHITECTURE_X64) 61if(ARCHITECTURE_x86_64)
62 set(SRCS ${SRCS} 62 set(SRCS ${SRCS}
63 x64/abi.cpp 63 x64/abi.cpp
64 x64/cpu_detect.cpp 64 x64/cpu_detect.cpp
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 948070e62..88e452a16 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -35,7 +35,7 @@
35 35
36#ifndef _MSC_VER 36#ifndef _MSC_VER
37 37
38#if defined(__x86_64__) || defined(ARCHITECTURE_X64) 38#ifdef ARCHITECTURE_x86_64
39#define Crash() __asm__ __volatile__("int $3") 39#define Crash() __asm__ __volatile__("int $3")
40#elif defined(_M_ARM) 40#elif defined(_M_ARM)
41#define Crash() __asm__ __volatile__("trap") 41#define Crash() __asm__ __volatile__("trap")
diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp
index 2b3ace528..5ef784224 100644
--- a/src/common/memory_util.cpp
+++ b/src/common/memory_util.cpp
@@ -16,7 +16,7 @@
16 #include <sys/mman.h> 16 #include <sys/mman.h>
17#endif 17#endif
18 18
19#if !defined(_WIN32) && defined(__x86_64__) && !defined(MAP_32BIT) 19#if !defined(_WIN32) && defined(ARCHITECTURE_X64) && !defined(MAP_32BIT)
20#include <unistd.h> 20#include <unistd.h>
21#define PAGE_MASK (getpagesize() - 1) 21#define PAGE_MASK (getpagesize() - 1)
22#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) 22#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK))
@@ -31,7 +31,7 @@ void* AllocateExecutableMemory(size_t size, bool low)
31 void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); 31 void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
32#else 32#else
33 static char *map_hint = 0; 33 static char *map_hint = 0;
34#if defined(__x86_64__) && !defined(MAP_32BIT) 34#if defined(ARCHITECTURE_X64) && !defined(MAP_32BIT)
35 // This OS has no flag to enforce allocation below the 4 GB boundary, 35 // This OS has no flag to enforce allocation below the 4 GB boundary,
36 // but if we hint that we want a low address it is very likely we will 36 // but if we hint that we want a low address it is very likely we will
37 // get one. 37 // get one.
@@ -43,7 +43,7 @@ void* AllocateExecutableMemory(size_t size, bool low)
43#endif 43#endif
44 void* ptr = mmap(map_hint, size, PROT_READ | PROT_WRITE | PROT_EXEC, 44 void* ptr = mmap(map_hint, size, PROT_READ | PROT_WRITE | PROT_EXEC,
45 MAP_ANON | MAP_PRIVATE 45 MAP_ANON | MAP_PRIVATE
46#if defined(__x86_64__) && defined(MAP_32BIT) 46#if defined(ARCHITECTURE_X64) && defined(MAP_32BIT)
47 | (low ? MAP_32BIT : 0) 47 | (low ? MAP_32BIT : 0)
48#endif 48#endif
49 , -1, 0); 49 , -1, 0);
@@ -62,7 +62,7 @@ void* AllocateExecutableMemory(size_t size, bool low)
62#endif 62#endif
63 LOG_ERROR(Common_Memory, "Failed to allocate executable memory"); 63 LOG_ERROR(Common_Memory, "Failed to allocate executable memory");
64 } 64 }
65#if !defined(_WIN32) && defined(__x86_64__) && !defined(MAP_32BIT) 65#if !defined(_WIN32) && defined(ARCHITECTURE_X64) && !defined(MAP_32BIT)
66 else 66 else
67 { 67 {
68 if (low) 68 if (low)
diff --git a/src/common/platform.h b/src/common/platform.h
index 118a9ed3b..9ba4db11b 100644
--- a/src/common/platform.h
+++ b/src/common/platform.h
@@ -27,7 +27,7 @@
27//////////////////////////////////////////////////////////////////////////////////////////////////// 27////////////////////////////////////////////////////////////////////////////////////////////////////
28// Platform detection 28// Platform detection
29 29
30#if defined(__x86_64__) || defined(ARCHITECTURE_X64) || defined(__aarch64__) 30#if defined(ARCHITECTURE_x86_64) || defined(__aarch64__)
31 #define EMU_ARCH_BITS 64 31 #define EMU_ARCH_BITS 64
32#elif defined(__i386) || defined(_M_IX86) || defined(__arm__) || defined(_M_ARM) 32#elif defined(__i386) || defined(_M_IX86) || defined(__arm__) || defined(_M_ARM)
33 #define EMU_ARCH_BITS 32 33 #define EMU_ARCH_BITS 32
diff --git a/src/common/x64/abi.cpp b/src/common/x64/abi.cpp
index 598e7f335..4c07a6ebe 100644
--- a/src/common/x64/abi.cpp
+++ b/src/common/x64/abi.cpp
@@ -27,7 +27,7 @@ void XEmitter::ABI_EmitPrologue(int maxCallParams)
27{ 27{
28#ifdef _M_IX86 28#ifdef _M_IX86
29 // Don't really need to do anything 29 // Don't really need to do anything
30#elif defined(ARCHITECTURE_X64) 30#elif defined(ARCHITECTURE_x86_64)
31#if _WIN32 31#if _WIN32
32 int stacksize = ((maxCallParams + 1) & ~1) * 8 + 8; 32 int stacksize = ((maxCallParams + 1) & ~1) * 8 + 8;
33 // Set up a stack frame so that we can call functions 33 // Set up a stack frame so that we can call functions
@@ -43,7 +43,7 @@ void XEmitter::ABI_EmitEpilogue(int maxCallParams)
43{ 43{
44#ifdef _M_IX86 44#ifdef _M_IX86
45 RET(); 45 RET();
46#elif defined(ARCHITECTURE_X64) 46#elif defined(ARCHITECTURE_x86_64)
47#ifdef _WIN32 47#ifdef _WIN32
48 int stacksize = ((maxCallParams+1)&~1)*8 + 8; 48 int stacksize = ((maxCallParams+1)&~1)*8 + 8;
49 ADD(64, R(RSP), Imm8(stacksize)); 49 ADD(64, R(RSP), Imm8(stacksize));
diff --git a/src/common/x64/abi.h b/src/common/x64/abi.h
index 0ee189d45..7e9c156ae 100644
--- a/src/common/x64/abi.h
+++ b/src/common/x64/abi.h
@@ -55,7 +55,7 @@
55// 32-bit bog standard cdecl, shared between linux and windows 55// 32-bit bog standard cdecl, shared between linux and windows
56// MacOSX 32-bit is same as System V with a few exceptions that we probably don't care much about. 56// MacOSX 32-bit is same as System V with a few exceptions that we probably don't care much about.
57 57
58#elif ARCHITECTURE_X64 // 64 bit calling convention 58#elif ARCHITECTURE_x86_64 // 64 bit calling convention
59 59
60#ifdef _WIN32 // 64-bit Windows - the really exotic calling convention 60#ifdef _WIN32 // 64-bit Windows - the really exotic calling convention
61 61
diff --git a/src/common/x64/emitter.cpp b/src/common/x64/emitter.cpp
index 030c73918..4b79acd1f 100644
--- a/src/common/x64/emitter.cpp
+++ b/src/common/x64/emitter.cpp
@@ -164,7 +164,7 @@ void XEmitter::WriteSIB(int scale, int index, int base)
164void OpArg::WriteRex(XEmitter *emit, int opBits, int bits, int customOp) const 164void OpArg::WriteRex(XEmitter *emit, int opBits, int bits, int customOp) const
165{ 165{
166 if (customOp == -1) customOp = operandReg; 166 if (customOp == -1) customOp = operandReg;
167#ifdef ARCHITECTURE_X64 167#ifdef ARCHITECTURE_x86_64
168 u8 op = 0x40; 168 u8 op = 0x40;
169 // REX.W (whether operation is a 64-bit operation) 169 // REX.W (whether operation is a 64-bit operation)
170 if (opBits == 64) op |= 8; 170 if (opBits == 64) op |= 8;
@@ -236,7 +236,7 @@ void OpArg::WriteRest(XEmitter *emit, int extraBytes, X64Reg _operandReg,
236 _offsetOrBaseReg = 5; 236 _offsetOrBaseReg = 5;
237 emit->WriteModRM(0, _operandReg, _offsetOrBaseReg); 237 emit->WriteModRM(0, _operandReg, _offsetOrBaseReg);
238 //TODO : add some checks 238 //TODO : add some checks
239#ifdef ARCHITECTURE_X64 239#ifdef ARCHITECTURE_x86_64
240 u64 ripAddr = (u64)emit->GetCodePtr() + 4 + extraBytes; 240 u64 ripAddr = (u64)emit->GetCodePtr() + 4 + extraBytes;
241 s64 distance = (s64)offset - (s64)ripAddr; 241 s64 distance = (s64)offset - (s64)ripAddr;
242 ASSERT_MSG( 242 ASSERT_MSG(
@@ -1463,7 +1463,7 @@ void XEmitter::MOVD_xmm(const OpArg &arg, X64Reg src) {WriteSSEOp(0x66, 0x7E, sr
1463 1463
1464void XEmitter::MOVQ_xmm(X64Reg dest, OpArg arg) 1464void XEmitter::MOVQ_xmm(X64Reg dest, OpArg arg)
1465{ 1465{
1466#ifdef ARCHITECTURE_X64 1466#ifdef ARCHITECTURE_x86_64
1467 // Alternate encoding 1467 // Alternate encoding
1468 // This does not display correctly in MSVC's debugger, it thinks it's a MOVD 1468 // This does not display correctly in MSVC's debugger, it thinks it's a MOVD
1469 arg.operandReg = dest; 1469 arg.operandReg = dest;
diff --git a/src/common/x64/emitter.h b/src/common/x64/emitter.h
index aaebb56f6..e9c924126 100644
--- a/src/common/x64/emitter.h
+++ b/src/common/x64/emitter.h
@@ -21,7 +21,7 @@
21#include "common/common_types.h" 21#include "common/common_types.h"
22#include "common/code_block.h" 22#include "common/code_block.h"
23 23
24#if defined(ARCHITECTURE_X64) && !defined(_ARCH_64) 24#if defined(ARCHITECTURE_x86_64) && !defined(_ARCH_64)
25#define _ARCH_64 25#define _ARCH_64
26#endif 26#endif
27 27
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index 221abc160..183709d8b 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -42,7 +42,7 @@ set(HEADERS
42 video_core.h 42 video_core.h
43 ) 43 )
44 44
45if(ARCHITECTURE_X64) 45if(ARCHITECTURE_x86_64)
46 set(SRCS ${SRCS} 46 set(SRCS ${SRCS}
47 shader/shader_jit_x64.cpp) 47 shader/shader_jit_x64.cpp)
48 48
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp
index f7459e2ad..06c1fe653 100644
--- a/src/video_core/shader/shader.cpp
+++ b/src/video_core/shader/shader.cpp
@@ -16,20 +16,18 @@
16#include "shader.h" 16#include "shader.h"
17#include "shader_interpreter.h" 17#include "shader_interpreter.h"
18 18
19#ifdef ARCHITECTURE_X64 19#ifdef ARCHITECTURE_x86_64
20#include "shader_jit_x64.h" 20#include "shader_jit_x64.h"
21#endif // ARCHITECTURE_X64 21#endif // ARCHITECTURE_x86_64
22 22
23namespace Pica { 23namespace Pica {
24 24
25namespace Shader { 25namespace Shader {
26 26
27#ifdef ARCHITECTURE_x86_64 27#ifdef ARCHITECTURE_x86_64
28
29static std::unordered_map<u64, CompiledShader*> shader_map; 28static std::unordered_map<u64, CompiledShader*> shader_map;
30static JitCompiler jit; 29static JitCompiler jit;
31static CompiledShader* jit_shader; 30static CompiledShader* jit_shader;
32
33#endif // ARCHITECTURE_x86_64 31#endif // ARCHITECTURE_x86_64
34 32
35void Setup(UnitState& state) { 33void Setup(UnitState& state) {
@@ -46,7 +44,8 @@ void Setup(UnitState& state) {
46 jit_shader = jit.Compile(); 44 jit_shader = jit.Compile();
47 shader_map.emplace(cache_key, jit_shader); 45 shader_map.emplace(cache_key, jit_shader);
48 } 46 }
49#endif // ARCHITECTURE_X64 47 }
48#endif // ARCHITECTURE_x86_64
50} 49}
51 50
52void Shutdown() { 51void Shutdown() {
@@ -95,7 +94,7 @@ OutputVertex Run(UnitState& state, const InputVertex& input, int num_attributes)
95 RunInterpreter(state); 94 RunInterpreter(state);
96#else 95#else
97 RunInterpreter(state); 96 RunInterpreter(state);
98#endif // ARCHITECTURE_X64 97#endif // ARCHITECTURE_x86_64
99 98
100#if PICA_DUMP_SHADERS 99#if PICA_DUMP_SHADERS
101 DebugUtils::DumpShader(setup.program_code.data(), state.debug.max_offset, setup.swizzle_data.data(), 100 DebugUtils::DumpShader(setup.program_code.data(), state.debug.max_offset, setup.swizzle_data.data(),