summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-06-18 00:27:12 -0700
committerGravatar GitHub2017-06-18 00:27:12 -0700
commit7dc72daea9603ec7329aef03259b7bafc97f9209 (patch)
treeb95f0b6bd7864f73247387f7698433d98d138885
parentMerge pull request #2762 from wwylele/light-cp-tangent (diff)
parentCMake: Set MSVC flags for improved C++ standards conformance (diff)
downloadyuzu-7dc72daea9603ec7329aef03259b7bafc97f9209.tar.gz
yuzu-7dc72daea9603ec7329aef03259b7bafc97f9209.tar.xz
yuzu-7dc72daea9603ec7329aef03259b7bafc97f9209.zip
Merge pull request #2785 from yuriks/compile-flags
CMake: Set MSVC flags for improved C++ standards conformance
-rw-r--r--CMakeLists.txt9
-rw-r--r--externals/CMakeLists.txt4
m---------externals/dynarmic0
-rw-r--r--src/video_core/shader/shader_jit_x64_compiler.cpp26
4 files changed, 20 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f0af2d41..a61dee6e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,10 +92,13 @@ else()
92 # /W3 - Level 3 warnings 92 # /W3 - Level 3 warnings
93 # /MP - Multi-threaded compilation 93 # /MP - Multi-threaded compilation
94 # /Zi - Output debugging information 94 # /Zi - Output debugging information
95 # /Zo - enahnced debug info for optimized builds 95 # /Zo - enhanced debug info for optimized builds
96 set(CMAKE_C_FLAGS "/W3 /MP /Zi /Zo" CACHE STRING "" FORCE) 96 # /permissive- - enables stricter C++ standards conformance checks
97 set(CMAKE_C_FLAGS "/W3 /MP /Zi /Zo /permissive-" CACHE STRING "" FORCE)
97 # /EHsc - C++-only exception handling semantics 98 # /EHsc - C++-only exception handling semantics
98 set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /EHsc" CACHE STRING "" FORCE) 99 # /Zc:throwingNew - let codegen assume `operator new` will never return null
100 # /Zc:inline - let codegen omit inline functions in object files
101 set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /EHsc /Zc:throwingNew,inline" CACHE STRING "" FORCE)
99 102
100 # /MDd - Multi-threaded Debug Runtime DLL 103 # /MDd - Multi-threaded Debug Runtime DLL
101 set(CMAKE_C_FLAGS_DEBUG "/Od /MDd" CACHE STRING "" FORCE) 104 set(CMAKE_C_FLAGS_DEBUG "/Od /MDd" CACHE STRING "" FORCE)
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 1e04931ee..02e02350c 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -46,7 +46,5 @@ if (ARCHITECTURE_x86_64)
46 # Defined before "dynarmic" above 46 # Defined before "dynarmic" above
47 # add_library(xbyak INTERFACE) 47 # add_library(xbyak INTERFACE)
48 target_include_directories(xbyak INTERFACE ./xbyak/xbyak) 48 target_include_directories(xbyak INTERFACE ./xbyak/xbyak)
49 if (NOT MSVC) 49 target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
50 target_compile_options(xbyak INTERFACE -fno-operator-names)
51 endif()
52endif() 50endif()
diff --git a/externals/dynarmic b/externals/dynarmic
Subproject 7707ff13e981b0aecf87f3156ee0b641469f7bb Subproject 8f15e3f70cb96e56705e5de6ba97b5d09423a56
diff --git a/src/video_core/shader/shader_jit_x64_compiler.cpp b/src/video_core/shader/shader_jit_x64_compiler.cpp
index 5d9b6448c..42a57aab1 100644
--- a/src/video_core/shader/shader_jit_x64_compiler.cpp
+++ b/src/video_core/shader/shader_jit_x64_compiler.cpp
@@ -321,27 +321,27 @@ void JitShader::Compile_EvaluateCondition(Instruction instr) {
321 case Instruction::FlowControlType::Or: 321 case Instruction::FlowControlType::Or:
322 mov(eax, COND0); 322 mov(eax, COND0);
323 mov(ebx, COND1); 323 mov(ebx, COND1);
324 xor(eax, (instr.flow_control.refx.Value() ^ 1)); 324 xor_(eax, (instr.flow_control.refx.Value() ^ 1));
325 xor(ebx, (instr.flow_control.refy.Value() ^ 1)); 325 xor_(ebx, (instr.flow_control.refy.Value() ^ 1));
326 or (eax, ebx); 326 or_(eax, ebx);
327 break; 327 break;
328 328
329 case Instruction::FlowControlType::And: 329 case Instruction::FlowControlType::And:
330 mov(eax, COND0); 330 mov(eax, COND0);
331 mov(ebx, COND1); 331 mov(ebx, COND1);
332 xor(eax, (instr.flow_control.refx.Value() ^ 1)); 332 xor_(eax, (instr.flow_control.refx.Value() ^ 1));
333 xor(ebx, (instr.flow_control.refy.Value() ^ 1)); 333 xor_(ebx, (instr.flow_control.refy.Value() ^ 1));
334 and(eax, ebx); 334 and_(eax, ebx);
335 break; 335 break;
336 336
337 case Instruction::FlowControlType::JustX: 337 case Instruction::FlowControlType::JustX:
338 mov(eax, COND0); 338 mov(eax, COND0);
339 xor(eax, (instr.flow_control.refx.Value() ^ 1)); 339 xor_(eax, (instr.flow_control.refx.Value() ^ 1));
340 break; 340 break;
341 341
342 case Instruction::FlowControlType::JustY: 342 case Instruction::FlowControlType::JustY:
343 mov(eax, COND1); 343 mov(eax, COND1);
344 xor(eax, (instr.flow_control.refy.Value() ^ 1)); 344 xor_(eax, (instr.flow_control.refy.Value() ^ 1));
345 break; 345 break;
346 } 346 }
347} 347}
@@ -734,10 +734,10 @@ void JitShader::Compile_LOOP(Instruction instr) {
734 mov(LOOPCOUNT, dword[SETUP + offset]); 734 mov(LOOPCOUNT, dword[SETUP + offset]);
735 mov(LOOPCOUNT_REG, LOOPCOUNT); 735 mov(LOOPCOUNT_REG, LOOPCOUNT);
736 shr(LOOPCOUNT_REG, 4); 736 shr(LOOPCOUNT_REG, 4);
737 and(LOOPCOUNT_REG, 0xFF0); // Y-component is the start 737 and_(LOOPCOUNT_REG, 0xFF0); // Y-component is the start
738 mov(LOOPINC, LOOPCOUNT); 738 mov(LOOPINC, LOOPCOUNT);
739 shr(LOOPINC, 12); 739 shr(LOOPINC, 12);
740 and(LOOPINC, 0xFF0); // Z-component is the incrementer 740 and_(LOOPINC, 0xFF0); // Z-component is the incrementer
741 movzx(LOOPCOUNT, LOOPCOUNT.cvt8()); // X-component is iteration count 741 movzx(LOOPCOUNT, LOOPCOUNT.cvt8()); // X-component is iteration count
742 add(LOOPCOUNT, 1); // Iteration count is X-component + 1 742 add(LOOPCOUNT, 1); // Iteration count is X-component + 1
743 743
@@ -858,9 +858,9 @@ void JitShader::Compile(const std::array<u32, MAX_PROGRAM_CODE_LENGTH>* program_
858 mov(STATE, ABI_PARAM2); 858 mov(STATE, ABI_PARAM2);
859 859
860 // Zero address/loop registers 860 // Zero address/loop registers
861 xor(ADDROFFS_REG_0.cvt32(), ADDROFFS_REG_0.cvt32()); 861 xor_(ADDROFFS_REG_0.cvt32(), ADDROFFS_REG_0.cvt32());
862 xor(ADDROFFS_REG_1.cvt32(), ADDROFFS_REG_1.cvt32()); 862 xor_(ADDROFFS_REG_1.cvt32(), ADDROFFS_REG_1.cvt32());
863 xor(LOOPCOUNT_REG, LOOPCOUNT_REG); 863 xor_(LOOPCOUNT_REG, LOOPCOUNT_REG);
864 864
865 // Used to set a register to one 865 // Used to set a register to one
866 static const __m128 one = {1.f, 1.f, 1.f, 1.f}; 866 static const __m128 one = {1.f, 1.f, 1.f, 1.f};