diff options
| author | 2022-12-17 22:16:52 -0300 | |
|---|---|---|
| committer | 2022-12-17 17:16:52 -0800 | |
| commit | fd1ea0fd8463c65f3d266512cba04a5c9d0863da (patch) | |
| tree | 573d78a36a48d9cf439c5f65d96f5f1a63449128 | |
| parent | Merge pull request #9456 from german77/virtual_gamepad (diff) | |
| download | yuzu-fd1ea0fd8463c65f3d266512cba04a5c9d0863da.tar.gz yuzu-fd1ea0fd8463c65f3d266512cba04a5c9d0863da.tar.xz yuzu-fd1ea0fd8463c65f3d266512cba04a5c9d0863da.zip | |
Enable compiler optimizations and enforce x86-64-v2 on GCC/Clang (#9442)
* Testing LTO (#4)
* Testing LTO
* clang
* linux
* Added the rest of Blinkhawk's optimizations
* Unlikely asserts
* Removing LTO from Linux builds - GCC
* Removing LTO from Linux builds - Clang
| -rwxr-xr-x | .ci/scripts/clang/docker.sh | 1 | ||||
| -rwxr-xr-x | .ci/scripts/linux/docker.sh | 1 | ||||
| -rw-r--r-- | .ci/templates/build-msvc.yml | 2 | ||||
| -rw-r--r-- | src/common/assert.h | 4 |
4 files changed, 5 insertions, 3 deletions
diff --git a/.ci/scripts/clang/docker.sh b/.ci/scripts/clang/docker.sh index 7d3ae4a1a..51769545e 100755 --- a/.ci/scripts/clang/docker.sh +++ b/.ci/scripts/clang/docker.sh | |||
| @@ -11,6 +11,7 @@ ccache -s | |||
| 11 | mkdir build || true && cd build | 11 | mkdir build || true && cd build |
| 12 | cmake .. \ | 12 | cmake .. \ |
| 13 | -DCMAKE_BUILD_TYPE=Release \ | 13 | -DCMAKE_BUILD_TYPE=Release \ |
| 14 | -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ | ||
| 14 | -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \ | 15 | -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \ |
| 15 | -DCMAKE_C_COMPILER=/usr/lib/ccache/clang \ | 16 | -DCMAKE_C_COMPILER=/usr/lib/ccache/clang \ |
| 16 | -DCMAKE_INSTALL_PREFIX="/usr" \ | 17 | -DCMAKE_INSTALL_PREFIX="/usr" \ |
diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh index 35c4a4368..c8bc56c9a 100755 --- a/.ci/scripts/linux/docker.sh +++ b/.ci/scripts/linux/docker.sh | |||
| @@ -12,6 +12,7 @@ mkdir build || true && cd build | |||
| 12 | cmake .. \ | 12 | cmake .. \ |
| 13 | -DBoost_USE_STATIC_LIBS=ON \ | 13 | -DBoost_USE_STATIC_LIBS=ON \ |
| 14 | -DCMAKE_BUILD_TYPE=Release \ | 14 | -DCMAKE_BUILD_TYPE=Release \ |
| 15 | -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ | ||
| 15 | -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \ | 16 | -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \ |
| 16 | -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \ | 17 | -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \ |
| 17 | -DCMAKE_INSTALL_PREFIX="/usr" \ | 18 | -DCMAKE_INSTALL_PREFIX="/usr" \ |
diff --git a/.ci/templates/build-msvc.yml b/.ci/templates/build-msvc.yml index ea405e5dc..c379dd757 100644 --- a/.ci/templates/build-msvc.yml +++ b/.ci/templates/build-msvc.yml | |||
| @@ -9,7 +9,7 @@ parameters: | |||
| 9 | steps: | 9 | steps: |
| 10 | - script: choco install vulkan-sdk | 10 | - script: choco install vulkan-sdk |
| 11 | displayName: 'Install vulkan-sdk' | 11 | displayName: 'Install vulkan-sdk' |
| 12 | - script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 17 2022" -A x64 -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_CRASH_DUMPS=ON .. && cd .. | 12 | - script: refreshenv && mkdir build && cd build && cmake -E env CXXFLAGS="/Gw /GA /Gr /Ob2" cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_CRASH_DUMPS=ON .. && cd .. |
| 13 | displayName: 'Configure CMake' | 13 | displayName: 'Configure CMake' |
| 14 | - task: MSBuild@1 | 14 | - task: MSBuild@1 |
| 15 | displayName: 'Build' | 15 | displayName: 'Build' |
diff --git a/src/common/assert.h b/src/common/assert.h index 8c927fcc0..67e7e9375 100644 --- a/src/common/assert.h +++ b/src/common/assert.h | |||
| @@ -69,7 +69,7 @@ void assert_fail_impl(); | |||
| 69 | #define ASSERT_OR_EXECUTE(_a_, _b_) \ | 69 | #define ASSERT_OR_EXECUTE(_a_, _b_) \ |
| 70 | do { \ | 70 | do { \ |
| 71 | ASSERT(_a_); \ | 71 | ASSERT(_a_); \ |
| 72 | if (!(_a_)) { \ | 72 | if (!(_a_)) [[unlikely]] { \ |
| 73 | _b_ \ | 73 | _b_ \ |
| 74 | } \ | 74 | } \ |
| 75 | } while (0) | 75 | } while (0) |
| @@ -78,7 +78,7 @@ void assert_fail_impl(); | |||
| 78 | #define ASSERT_OR_EXECUTE_MSG(_a_, _b_, ...) \ | 78 | #define ASSERT_OR_EXECUTE_MSG(_a_, _b_, ...) \ |
| 79 | do { \ | 79 | do { \ |
| 80 | ASSERT_MSG(_a_, __VA_ARGS__); \ | 80 | ASSERT_MSG(_a_, __VA_ARGS__); \ |
| 81 | if (!(_a_)) { \ | 81 | if (!(_a_)) [[unlikely]] { \ |
| 82 | _b_ \ | 82 | _b_ \ |
| 83 | } \ | 83 | } \ |
| 84 | } while (0) | 84 | } while (0) |