Compare commits
10 commits
74170da769
...
f484944d2d
Author | SHA1 | Date | |
---|---|---|---|
f484944d2d | |||
ffb0df4ccc | |||
38c75597ec | |||
ce50838d36 | |||
4709a15d92 | |||
5b59a35f98 | |||
c725641f13 | |||
02016697d6 | |||
c77ad128b9 | |||
cc50571275 |
23 changed files with 93 additions and 69 deletions
|
@ -147,7 +147,11 @@ if (MSVC OR ANDROID)
|
||||||
set(EXT_DEFAULT ON)
|
set(EXT_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ${EXT_DEFAULT} "ENABLE_SDL2;NOT MSVC" OFF)
|
if (ENABLE_SDL2)
|
||||||
|
# TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system
|
||||||
|
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" OFF "NOT MSVC" OFF)
|
||||||
|
option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}")
|
||||||
|
endif()
|
||||||
|
|
||||||
cmake_dependent_option(ENABLE_LIBUSB "Enable the use of LibUSB" ON "NOT ANDROID" OFF)
|
cmake_dependent_option(ENABLE_LIBUSB "Enable the use of LibUSB" ON "NOT ANDROID" OFF)
|
||||||
|
|
||||||
|
@ -185,8 +189,6 @@ option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ${EXT_DEFAULT})
|
||||||
# TODO(crueter): CI this?
|
# TODO(crueter): CI this?
|
||||||
option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON)
|
option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON)
|
||||||
|
|
||||||
# TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system
|
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}" "ENABLE_SDL2" OFF)
|
|
||||||
|
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Enable dedicated room functionality" ON "NOT ANDROID" OFF)
|
CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Enable dedicated room functionality" ON "NOT ANDROID" OFF)
|
||||||
|
|
||||||
|
@ -197,6 +199,14 @@ CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL
|
||||||
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF)
|
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF)
|
||||||
|
|
||||||
option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
|
option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
|
||||||
|
if(YUZU_ENABLE_LTO)
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT COMPILER_SUPPORTS_LTO)
|
||||||
|
if(NOT COMPILER_SUPPORTS_LTO)
|
||||||
|
message(FATAL_ERROR "Your compiler does not support interprocedural optimization (IPO). Re-run CMake with -DYUZU_ENABLE_LTO=OFF.")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${COMPILER_SUPPORTS_LTO})
|
||||||
|
endif()
|
||||||
|
|
||||||
option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" ON)
|
option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" ON)
|
||||||
|
|
||||||
|
@ -884,19 +894,25 @@ if (MSVC AND CXX_CLANG)
|
||||||
link_libraries(llvm-mingw-runtime)
|
link_libraries(llvm-mingw-runtime)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (YUZU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if (YUZU_USE_FASTER_LD)
|
||||||
# We will assume that if the compiler is GCC, it will attempt to use ld.bfd by default.
|
# clang should always use lld
|
||||||
# Try to pick a faster linker.
|
|
||||||
find_program(LLD lld)
|
find_program(LLD lld)
|
||||||
find_program(MOLD mold)
|
|
||||||
|
|
||||||
if (MOLD AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
|
if (LLD)
|
||||||
message(NOTICE "Selecting mold as linker")
|
set(LINKER lld)
|
||||||
add_link_options("-fuse-ld=mold")
|
|
||||||
elseif (LLD)
|
|
||||||
message(NOTICE "Selecting lld as linker")
|
|
||||||
add_link_options("-fuse-ld=lld")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# GNU appears to work better with mold
|
||||||
|
# TODO: mold has been slow lately, see if better options exist (search for gold?)
|
||||||
|
if (CXX_GCC)
|
||||||
|
find_program(MOLD mold)
|
||||||
|
if (MOLD AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
|
||||||
|
set(LINKER mold)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(NOTICE "Selecting ${LINKER} as linker")
|
||||||
|
add_link_options("-fuse-ld=${LINKER}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set runtime library to MD/MDd for all configurations
|
# Set runtime library to MD/MDd for all configurations
|
||||||
|
|
|
@ -141,7 +141,7 @@ else()
|
||||||
-Wno-missing-field-initializers
|
-Wno-missing-field-initializers
|
||||||
)
|
)
|
||||||
|
|
||||||
if (CXX_CLANG OR CXX_ICC) # Clang or AppleClang
|
if (CXX_CLANG OR CXX_ICC OR CXX_APPLE) # Clang, AppleClang, or Intel C++
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Werror=shadow-uncaptured-local
|
-Werror=shadow-uncaptured-local
|
||||||
|
|
|
@ -175,12 +175,10 @@ android {
|
||||||
"-DYUZU_USE_CPM=ON",
|
"-DYUZU_USE_CPM=ON",
|
||||||
"-DCPMUTIL_FORCE_BUNDLED=ON",
|
"-DCPMUTIL_FORCE_BUNDLED=ON",
|
||||||
"-DYUZU_USE_BUNDLED_FFMPEG=ON",
|
"-DYUZU_USE_BUNDLED_FFMPEG=ON",
|
||||||
"-DYUZU_ENABLE_LTO=ON",
|
|
||||||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
||||||
"-DBUILD_TESTING=OFF",
|
"-DBUILD_TESTING=OFF",
|
||||||
"-DYUZU_TESTS=OFF",
|
"-DYUZU_TESTS=OFF",
|
||||||
"-DDYNARMIC_TESTS=OFF",
|
"-DDYNARMIC_TESTS=OFF"
|
||||||
"-DDYNARMIC_ENABLE_LTO=ON"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
abiFilters("arm64-v8a")
|
abiFilters("arm64-v8a")
|
||||||
|
|
|
@ -1274,8 +1274,4 @@ if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
target_precompile_headers(core PRIVATE precompiled_headers.h)
|
target_precompile_headers(core PRIVATE precompiled_headers.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (YUZU_ENABLE_LTO)
|
|
||||||
set_property(TARGET core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
create_target_directory_groups(core)
|
create_target_directory_groups(core)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "../rand_int.h"
|
#include "../rand_int.h"
|
||||||
#include "../unicorn_emu/a32_unicorn.h"
|
#include "../unicorn_emu/a32_unicorn.h"
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/common/fp/fpcr.h"
|
#include "dynarmic/common/fp/fpcr.h"
|
||||||
#include "dynarmic/common/fp/fpsr.h"
|
#include "dynarmic/common/fp/fpsr.h"
|
||||||
#include "dynarmic/common/llvm_disassemble.h"
|
#include "dynarmic/common/llvm_disassemble.h"
|
||||||
|
@ -46,7 +47,7 @@ using namespace Dynarmic;
|
||||||
|
|
||||||
template<typename Fn>
|
template<typename Fn>
|
||||||
bool AnyLocationDescriptorForTerminalHas(IR::Terminal terminal, Fn fn) {
|
bool AnyLocationDescriptorForTerminalHas(IR::Terminal terminal, Fn fn) {
|
||||||
return Common::VisitVariant<bool>(terminal, [&](auto t) -> bool {
|
return boost::apply_visitor([&](auto t) -> bool {
|
||||||
using T = std::decay_t<decltype(t)>;
|
using T = std::decay_t<decltype(t)>;
|
||||||
if constexpr (std::is_same_v<T, IR::Term::Invalid>) {
|
if constexpr (std::is_same_v<T, IR::Term::Invalid>) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -72,7 +73,7 @@ bool AnyLocationDescriptorForTerminalHas(IR::Terminal terminal, Fn fn) {
|
||||||
ASSERT_MSG(false, "Invalid terminal type");
|
ASSERT_MSG(false, "Invalid terminal type");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
}, terminal);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShouldTestInst(u32 instruction, u32 pc, bool is_thumb, bool is_last_inst, A32::ITState it_state = {}) {
|
bool ShouldTestInst(u32 instruction, u32 pc, bool is_thumb, bool is_last_inst, A32::ITState it_state = {}) {
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "../rand_int.h"
|
#include "../rand_int.h"
|
||||||
#include "../unicorn_emu/a32_unicorn.h"
|
#include "../unicorn_emu/a32_unicorn.h"
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/frontend/A32/FPSCR.h"
|
#include "dynarmic/frontend/A32/FPSCR.h"
|
||||||
#include "dynarmic/frontend/A32/PSR.h"
|
#include "dynarmic/frontend/A32/PSR.h"
|
||||||
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
/* This file is part of the dynarmic project.
|
/* This file is part of the dynarmic project.
|
||||||
* Copyright (c) 2016 MerryMage
|
* Copyright (c) 2016 MerryMage
|
||||||
* SPDX-License-Identifier: 0BSD
|
* SPDX-License-Identifier: 0BSD
|
||||||
|
@ -6,6 +9,7 @@
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
||||||
#include "dynarmic/interface/A32/a32.h"
|
#include "dynarmic/interface/A32/a32.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
/* This file is part of the dynarmic project.
|
/* This file is part of the dynarmic project.
|
||||||
* Copyright (c) 2022 MerryMage
|
* Copyright (c) 2022 MerryMage
|
||||||
* SPDX-License-Identifier: 0BSD
|
* SPDX-License-Identifier: 0BSD
|
||||||
|
@ -8,6 +11,7 @@
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
||||||
#include "dynarmic/interface/A32/a32.h"
|
#include "dynarmic/interface/A32/a32.h"
|
||||||
#include "dynarmic/interface/A32/coprocessor.h"
|
#include "dynarmic/interface/A32/coprocessor.h"
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
/* This file is part of the dynarmic project.
|
/* This file is part of the dynarmic project.
|
||||||
* Copyright (c) 2022 MerryMage
|
* Copyright (c) 2022 MerryMage
|
||||||
* SPDX-License-Identifier: 0BSD
|
* SPDX-License-Identifier: 0BSD
|
||||||
|
@ -8,6 +11,7 @@
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
|
|
||||||
using namespace Dynarmic;
|
using namespace Dynarmic;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/interface/A32/a32.h"
|
#include "dynarmic/interface/A32/a32.h"
|
||||||
|
|
||||||
static Dynarmic::A32::UserConfig GetUserConfig(ThumbTestEnv* testenv) {
|
static Dynarmic::A32::UserConfig GetUserConfig(ThumbTestEnv* testenv) {
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include "dynarmic/common/assert.h"
|
#include "dynarmic/common/assert.h"
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
#include "dynarmic/interface/A32/a32.h"
|
#include "dynarmic/interface/A32/a32.h"
|
||||||
#include "../native/testenv.h"
|
|
||||||
|
|
||||||
template<typename InstructionType_, u32 infinite_loop_u32>
|
template<typename InstructionType_, u32 infinite_loop_u32>
|
||||||
class A32TestEnv : public Dynarmic::A32::UserCallbacks {
|
class A32TestEnv : public Dynarmic::A32::UserCallbacks {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
/* This file is part of the dynarmic project.
|
/* This file is part of the dynarmic project.
|
||||||
* Copyright (c) 2018 MerryMage
|
* Copyright (c) 2018 MerryMage
|
||||||
* SPDX-License-Identifier: 0BSD
|
* SPDX-License-Identifier: 0BSD
|
||||||
|
@ -7,6 +10,7 @@
|
||||||
#include <oaknut/oaknut.hpp>
|
#include <oaknut/oaknut.hpp>
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/common/fp/fpsr.h"
|
#include "dynarmic/common/fp/fpsr.h"
|
||||||
#include "dynarmic/interface/exclusive_monitor.h"
|
#include "dynarmic/interface/exclusive_monitor.h"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
|
|
||||||
using namespace Dynarmic;
|
using namespace Dynarmic;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "../rand_int.h"
|
#include "../rand_int.h"
|
||||||
#include "../unicorn_emu/a64_unicorn.h"
|
#include "../unicorn_emu/a64_unicorn.h"
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/common/fp/fpcr.h"
|
#include "dynarmic/common/fp/fpcr.h"
|
||||||
#include "dynarmic/common/fp/fpsr.h"
|
#include "dynarmic/common/fp/fpsr.h"
|
||||||
#include "dynarmic/common/llvm_disassemble.h"
|
#include "dynarmic/common/llvm_disassemble.h"
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
/* This file is part of the dynarmic project.
|
/* This file is part of the dynarmic project.
|
||||||
* Copyright (c) 2018 MerryMage
|
* Copyright (c) 2018 MerryMage
|
||||||
* SPDX-License-Identifier: 0BSD
|
* SPDX-License-Identifier: 0BSD
|
||||||
|
@ -6,6 +9,7 @@
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/interface/A64/a64.h"
|
#include "dynarmic/interface/A64/a64.h"
|
||||||
|
|
||||||
TEST_CASE("misaligned load/store do not use page_table when detect_misaligned_access_via_page_table is set", "[a64]") {
|
TEST_CASE("misaligned load/store do not use page_table when detect_misaligned_access_via_page_table is set", "[a64]") {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <oaknut/oaknut.hpp>
|
#include <oaknut/oaknut.hpp>
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/interface/A64/a64.h"
|
#include "dynarmic/interface/A64/a64.h"
|
||||||
|
|
||||||
using namespace Dynarmic;
|
using namespace Dynarmic;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
/* This file is part of the dynarmic project.
|
/* This file is part of the dynarmic project.
|
||||||
* Copyright (c) 2018 MerryMage
|
* Copyright (c) 2018 MerryMage
|
||||||
* SPDX-License-Identifier: 0BSD
|
* SPDX-License-Identifier: 0BSD
|
||||||
|
@ -6,6 +9,7 @@
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
#include "./testenv.h"
|
#include "./testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/interface/A64/a64.h"
|
#include "dynarmic/interface/A64/a64.h"
|
||||||
|
|
||||||
using namespace Dynarmic;
|
using namespace Dynarmic;
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "dynarmic/common/assert.h"
|
#include "dynarmic/common/assert.h"
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
#include "dynarmic/interface/A64/a64.h"
|
#include "dynarmic/interface/A64/a64.h"
|
||||||
#include "../native/testenv.h"
|
|
||||||
|
|
||||||
using Vector = Dynarmic::A64::Vector;
|
using Vector = Dynarmic::A64::Vector;
|
||||||
|
|
||||||
|
|
|
@ -36,22 +36,12 @@ TEST_CASE("ASIMD Decoder: Ensure table order correctness", "[decode][a32][.]") {
|
||||||
|
|
||||||
const auto is_decode_error = [&get_ir](const A32::ASIMDMatcher<A32::TranslatorVisitor>& matcher, u32 instruction) {
|
const auto is_decode_error = [&get_ir](const A32::ASIMDMatcher<A32::TranslatorVisitor>& matcher, u32 instruction) {
|
||||||
const auto block = get_ir(matcher, instruction);
|
const auto block = get_ir(matcher, instruction);
|
||||||
|
return std::find_if(block.cbegin(), block.cend(), [](auto const& e) {
|
||||||
for (const auto& ir_inst : block) {
|
return e.GetOpcode() == IR::Opcode::A32ExceptionRaised && A32::Exception(e.GetArg(1).GetU64()) == A32::Exception::DecodeError;
|
||||||
if (ir_inst.GetOpcode() == IR::Opcode::A32ExceptionRaised) {
|
}) != block.cend();
|
||||||
if (static_cast<A32::Exception>(ir_inst.GetArg(1).GetU64()) == A32::Exception::DecodeError) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto iter = table.cbegin(); iter != table.cend(); ++iter) {
|
for (auto iter = table.cbegin(); iter != table.cend(); ++iter) {
|
||||||
if (std::strncmp(iter->GetName(), "UNALLOCATED", 11) == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const u32 expect = iter->GetExpected();
|
const u32 expect = iter->GetExpected();
|
||||||
const u32 mask = iter->GetMask();
|
const u32 mask = iter->GetMask();
|
||||||
u32 x = 0;
|
u32 x = 0;
|
||||||
|
@ -59,15 +49,17 @@ TEST_CASE("ASIMD Decoder: Ensure table order correctness", "[decode][a32][.]") {
|
||||||
const u32 instruction = expect | x;
|
const u32 instruction = expect | x;
|
||||||
|
|
||||||
const bool iserr = is_decode_error(*iter, instruction);
|
const bool iserr = is_decode_error(*iter, instruction);
|
||||||
const auto alternative = std::find_if(table.cbegin(), iter, [instruction](const auto& m) { return m.Matches(instruction); });
|
const auto alternative = std::find_if(table.cbegin(), iter, [instruction](const auto& m) {
|
||||||
|
return m.Matches(instruction);
|
||||||
|
});
|
||||||
const bool altiserr = is_decode_error(*alternative, instruction);
|
const bool altiserr = is_decode_error(*alternative, instruction);
|
||||||
|
|
||||||
INFO("Instruction: " << std::hex << std::setfill('0') << std::setw(8) << instruction);
|
INFO("Instruction: " << std::hex << std::setfill('0') << std::setw(8) << instruction);
|
||||||
INFO("Expect: " << std::hex << std::setfill('0') << std::setw(8) << expect);
|
INFO("Expect: " << std::hex << std::setfill('0') << std::setw(8) << expect);
|
||||||
INFO("Fill: " << std::hex << std::setfill('0') << std::setw(8) << x);
|
INFO("Fill: " << std::hex << std::setfill('0') << std::setw(8) << x);
|
||||||
INFO("Name: " << iter->GetName());
|
//INFO("Name: " << *A32::GetNameASIMD<A32::TranslatorVisitor>(instruction));
|
||||||
INFO("iserr: " << iserr);
|
INFO("iserr: " << iserr);
|
||||||
INFO("alternative: " << alternative->GetName());
|
//INFO("alternative: " << alternative->GetName());
|
||||||
INFO("altiserr: " << altiserr);
|
INFO("altiserr: " << altiserr);
|
||||||
|
|
||||||
REQUIRE(((!iserr && alternative == iter) || (iserr && alternative != iter && !altiserr)));
|
REQUIRE(((!iserr && alternative == iter) || (iserr && alternative != iter && !altiserr)));
|
||||||
|
@ -75,4 +67,4 @@ TEST_CASE("ASIMD Decoder: Ensure table order correctness", "[decode][a32][.]") {
|
||||||
x = ((x | mask) + 1) & ~mask;
|
x = ((x | mask) + 1) & ~mask;
|
||||||
} while (x != 0);
|
} while (x != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,6 +6,7 @@
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
|
|
||||||
#include "../A64/testenv.h"
|
#include "../A64/testenv.h"
|
||||||
|
#include "../native/testenv.h"
|
||||||
#include "dynarmic/common/fp/fpsr.h"
|
#include "dynarmic/common/fp/fpsr.h"
|
||||||
#include "dynarmic/interface/exclusive_monitor.h"
|
#include "dynarmic/interface/exclusive_monitor.h"
|
||||||
|
|
||||||
|
|
|
@ -32,27 +32,26 @@
|
||||||
#include "dynarmic/frontend/A64/translate/a64_translate.h"
|
#include "dynarmic/frontend/A64/translate/a64_translate.h"
|
||||||
#include "dynarmic/frontend/A64/translate/impl/impl.h"
|
#include "dynarmic/frontend/A64/translate/impl/impl.h"
|
||||||
#include "dynarmic/interface/A32/a32.h"
|
#include "dynarmic/interface/A32/a32.h"
|
||||||
|
#include "dynarmic/interface/A32/config.h"
|
||||||
#include "dynarmic/interface/A32/disassembler.h"
|
#include "dynarmic/interface/A32/disassembler.h"
|
||||||
#include "dynarmic/ir/basic_block.h"
|
#include "dynarmic/ir/basic_block.h"
|
||||||
#include "dynarmic/ir/opt_passes.h"
|
#include "dynarmic/ir/opt_passes.h"
|
||||||
|
|
||||||
using namespace Dynarmic;
|
using namespace Dynarmic;
|
||||||
|
|
||||||
const char* GetNameOfA32Instruction(u32 instruction) {
|
std::string_view GetNameOfA32Instruction(u32 instruction) {
|
||||||
if (auto vfp_decoder = A32::DecodeVFP<A32::TranslatorVisitor>(instruction)) {
|
//if (auto const vfp_decoder = A32::DecodeVFP<A32::TranslatorVisitor>(instruction))
|
||||||
return vfp_decoder->get().GetName();
|
// return *A32::GetNameVFP<A32::TranslatorVisitor>(instruction);
|
||||||
} else if (auto asimd_decoder = A32::DecodeASIMD<A32::TranslatorVisitor>(instruction)) {
|
//else if (auto const asimd_decoder = A32::DecodeASIMD<A32::TranslatorVisitor>(instruction))
|
||||||
return asimd_decoder->get().GetName();
|
// return *A32::GetNameASIMD<A32::TranslatorVisitor>(instruction);
|
||||||
} else if (auto decoder = A32::DecodeArm<A32::TranslatorVisitor>(instruction)) {
|
//else if (auto const decoder = A32::DecodeArm<A32::TranslatorVisitor>(instruction))
|
||||||
return decoder->get().GetName();
|
// return *A32::GetNameARM<A32::TranslatorVisitor>(instruction);
|
||||||
}
|
|
||||||
return "<null>";
|
return "<null>";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* GetNameOfA64Instruction(u32 instruction) {
|
std::string_view GetNameOfA64Instruction(u32 instruction) {
|
||||||
if (auto decoder = A64::Decode<A64::TranslatorVisitor>(instruction)) {
|
//if (auto const decoder = A64::Decode<A64::TranslatorVisitor>(instruction))
|
||||||
return decoder->get().GetName();
|
// return *A64::GetName<A64::TranslatorVisitor>(instruction);
|
||||||
}
|
|
||||||
return "<null>";
|
return "<null>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ void PrintA32Instruction(u32 instruction) {
|
||||||
fmt::print("should_continue: {}\n\n", should_continue);
|
fmt::print("should_continue: {}\n\n", should_continue);
|
||||||
fmt::print("IR:\n");
|
fmt::print("IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
||||||
Optimization::Optimize(ir_block, conf, {});
|
Optimization::Optimize(ir_block, A32::UserConfig{}, {});
|
||||||
fmt::print("Optimized IR:\n");
|
fmt::print("Optimized IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
||||||
}
|
}
|
||||||
|
@ -81,7 +80,7 @@ void PrintA64Instruction(u32 instruction) {
|
||||||
fmt::print("should_continue: {}\n\n", should_continue);
|
fmt::print("should_continue: {}\n\n", should_continue);
|
||||||
fmt::print("IR:\n");
|
fmt::print("IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
||||||
Optimization::Optimize(ir_block, conf, {});
|
Optimization::Optimize(ir_block, A64::UserConfig{}, {});
|
||||||
fmt::print("Optimized IR:\n");
|
fmt::print("Optimized IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
||||||
}
|
}
|
||||||
|
@ -99,7 +98,7 @@ void PrintThumbInstruction(u32 instruction) {
|
||||||
fmt::print("should_continue: {}\n\n", should_continue);
|
fmt::print("should_continue: {}\n\n", should_continue);
|
||||||
fmt::print("IR:\n");
|
fmt::print("IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
||||||
Optimization::Optimize(ir_block, conf, {});
|
Optimization::Optimize(ir_block, A32::UserConfig{}, {});
|
||||||
fmt::print("Optimized IR:\n");
|
fmt::print("Optimized IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,10 +399,6 @@ if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
target_precompile_headers(video_core PRIVATE precompiled_headers.h)
|
target_precompile_headers(video_core PRIVATE precompiled_headers.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (YUZU_ENABLE_LTO)
|
|
||||||
set_property(TARGET video_core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ANDROID AND ARCHITECTURE_arm64)
|
if (ANDROID AND ARCHITECTURE_arm64)
|
||||||
target_link_libraries(video_core PRIVATE adrenotools)
|
target_link_libraries(video_core PRIVATE adrenotools)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -785,18 +785,13 @@ void BufferCache<P>::BindHostGraphicsUniformBuffers(size_t stage) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class P>
|
template <class P>
|
||||||
void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 binding_index,
|
void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 binding_index, bool needs_bind) {
|
||||||
bool needs_bind) {
|
++channel_state->uniform_cache_shots[0];
|
||||||
const Binding& binding = channel_state->uniform_buffers[stage][index];
|
const Binding& binding = channel_state->uniform_buffers[stage][index];
|
||||||
const DAddr device_addr = binding.device_addr;
|
const DAddr device_addr = binding.device_addr;
|
||||||
const u32 size = (std::min)(binding.size, (*channel_state->uniform_buffer_sizes)[stage][index]);
|
const u32 size = (std::min)(binding.size, (*channel_state->uniform_buffer_sizes)[stage][index]);
|
||||||
Buffer& buffer = slot_buffers[binding.buffer_id];
|
Buffer& buffer = slot_buffers[binding.buffer_id];
|
||||||
TouchBuffer(buffer, binding.buffer_id);
|
TouchBuffer(buffer, binding.buffer_id);
|
||||||
const bool sync_buffer = SynchronizeBuffer(buffer, device_addr, size);
|
|
||||||
if (sync_buffer) {
|
|
||||||
++channel_state->uniform_cache_hits[0];
|
|
||||||
}
|
|
||||||
++channel_state->uniform_cache_shots[0];
|
|
||||||
const bool use_fast_buffer = binding.buffer_id != NULL_BUFFER_ID &&
|
const bool use_fast_buffer = binding.buffer_id != NULL_BUFFER_ID &&
|
||||||
size <= channel_state->uniform_buffer_skip_cache_size &&
|
size <= channel_state->uniform_buffer_skip_cache_size &&
|
||||||
!memory_tracker.IsRegionGpuModified(device_addr, size);
|
!memory_tracker.IsRegionGpuModified(device_addr, size);
|
||||||
|
@ -827,7 +822,10 @@ void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32
|
||||||
device_memory.ReadBlockUnsafe(device_addr, span.data(), size);
|
device_memory.ReadBlockUnsafe(device_addr, span.data(), size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Classic cached path
|
||||||
|
if (SynchronizeBuffer(buffer, device_addr, size)) {
|
||||||
|
++channel_state->uniform_cache_hits[0];
|
||||||
|
}
|
||||||
// Skip binding if it's not needed and if the bound buffer is not the fast version
|
// Skip binding if it's not needed and if the bound buffer is not the fast version
|
||||||
// This exists to avoid instances where the fast buffer is bound and a GPU write happens
|
// This exists to avoid instances where the fast buffer is bound and a GPU write happens
|
||||||
needs_bind |= HasFastUniformBufferBound(stage, binding_index);
|
needs_bind |= HasFastUniformBufferBound(stage, binding_index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue