Compare commits

..

1 Commits

Author SHA1 Message Date
lizzie de1a090a51 2026-09-17 04:58:48
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-09-17 04:58:49 +00:00
11 changed files with 52 additions and 63 deletions
+1
View File
@@ -36,6 +36,7 @@ add_library(
cityhash.h
common_funcs.h
common_types.h
concepts.h
container_hash.h
demangle.cpp
demangle.h
+18
View File
@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <iterator>
#include <type_traits>
namespace Common {
// Check if type satisfies the ContiguousContainer named requirement.
template <typename T>
concept IsContiguousContainer = std::contiguous_iterator<typename T::iterator>;
} // namespace Common
+3 -1
View File
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2015 Evan Teran
@@ -15,6 +15,8 @@
#include <ostream>
#include <type_traits>
#include <common/concepts.h>
namespace Common {
// No equivalent for "std::arithmetic" in the stdlib
+5 -5
View File
@@ -6,12 +6,12 @@
#pragma once
#include <concepts>
#include <cstdio>
#include <filesystem>
#include <span>
#include <type_traits>
#include "common/concepts.h"
#include "common/fs/fs_types.h"
#include "common/fs/fs_util.h"
@@ -212,7 +212,7 @@ public:
/**
* Helper function which deduces the value type of a contiguous STL container used in ReadSpan.
* If T is not a contiguous container as defined by the concept, this
* If T is not a contiguous container as defined by the concept IsContiguousContainer, this
* calls ReadObject and T must be a trivially copyable object.
*
* See ReadSpan for more details if T is a contiguous container.
@@ -226,7 +226,7 @@ public:
*/
template <typename T>
[[nodiscard]] size_t Read(T& data) const {
if constexpr (std::contiguous_iterator<typename T::iterator>) {
if constexpr (IsContiguousContainer<T>) {
using ContiguousType = typename T::value_type;
static_assert(std::is_trivially_copyable_v<ContiguousType>,
"Data type must be trivially copyable.");
@@ -238,7 +238,7 @@ public:
/**
* Helper function which deduces the value type of a contiguous STL container used in WriteSpan.
* If T is not a contiguous STL container as defined by the concept, this
* If T is not a contiguous STL container as defined by the concept IsContiguousContainer, this
* calls WriteObject and T must be a trivially copyable object.
*
* See WriteSpan for more details if T is a contiguous container.
@@ -252,7 +252,7 @@ public:
*/
template <typename T>
[[nodiscard]] size_t Write(const T& data) const {
if constexpr (std::contiguous_iterator<typename T::iterator>) {
if constexpr (IsContiguousContainer<T>) {
using ContiguousType = typename T::value_type;
static_assert(std::is_trivially_copyable_v<ContiguousType>,
"Data type must be trivially copyable.");
+12 -14
View File
@@ -6,7 +6,6 @@
#pragma once
#include <concepts>
#include <array>
#include <functional>
#include <memory>
@@ -19,6 +18,7 @@
#include "common/assert.h"
#include "common/common_types.h"
#include "common/concepts.h"
#include "common/swap.h"
#include "core/hle/ipc.h"
#include "core/hle/kernel/k_handle_table.h"
@@ -292,20 +292,18 @@ public:
* @param data The container/data to write into a buffer.
* @param buffer_index The buffer in particular to write to.
*/
template <typename T>
requires (!std::is_pointer_v<T>
&& std::contiguous_iterator<typename T::iterator>)
template <typename T, typename = std::enable_if_t<!std::is_pointer_v<T>>>
std::size_t WriteBuffer(const T& data, std::size_t buffer_index = 0) const {
using C = typename T::value_type;
static_assert(std::is_trivially_copyable_v<C>, "Container to WriteBuffer must contain trivially copyable objects");
return WriteBuffer(std::data(data), std::size(data) * sizeof(C), buffer_index);
}
template <typename T>
requires (!std::is_pointer_v<T>
&& !std::contiguous_iterator<typename T::iterator>)
std::size_t WriteBuffer(const T& data, std::size_t buffer_index = 0) const {
static_assert(std::is_trivially_copyable_v<T>, "T must be trivially copyable");
return WriteBuffer(&data, sizeof(T), buffer_index);
if constexpr (Common::IsContiguousContainer<T>) {
using ContiguousType = typename T::value_type;
static_assert(std::is_trivially_copyable_v<ContiguousType>,
"Container to WriteBuffer must contain trivially copyable objects");
return WriteBuffer(std::data(data), std::size(data) * sizeof(ContiguousType),
buffer_index);
} else {
static_assert(std::is_trivially_copyable_v<T>, "T must be trivially copyable");
return WriteBuffer(&data, sizeof(T), buffer_index);
}
}
/// Helper function to get the size of the input buffer
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
@@ -9,6 +9,7 @@
#include <span>
#include <vector>
#include "common/concepts.h"
#include "core/hle/service/nvdrv/devices/nvdevice.h"
namespace Service::Nvidia::Devices {
+1
View File
@@ -10,6 +10,7 @@
#include <string>
#include <concepts>
#include <algorithm>
#include "common/concepts.h"
#include "common/fs/path_util.h"
#include "common/logging.h"
#include "common/string_util.h"
@@ -406,10 +406,8 @@ int RegAlloc::RealizeReadWriteImpl(const IR::Value& read_value, const IR::Inst*
} else if constexpr (kind == HostLoc::Kind::Fpr) {
LoadCopyInto(read_value, oaknut::QReg{write_loc});
return write_loc;
} else if constexpr (kind == HostLoc::Kind::Flags) {
ASSERT(false && "Incorrect function for ReadWrite of flags");
} else {
UNREACHABLE();
UNREACHABLE(); // kind == HostLoc::Kind::Flags
}
}
+3 -36
View File
@@ -72,40 +72,6 @@ void Block::Reset(LocationDescriptor location_) noexcept {
ASSERT(instructions.size() == 0);
}
static std::string TerminalToString(const Term::Terminal& terminal_variant) noexcept {
// struct : boost::static_visitor<std::string> {
// std::string operator()(const std::monostate&) const {
// return "<invalid>";
// }
// std::string operator()(const Term::ReturnToDispatch&) const {
// return "ReturnToDispatch{}";
// }
// std::string operator()(const Term::LinkBlock& terminal) const {
// return fmt::format("LinkBlock{{{}}}", terminal.next);
// }
// std::string operator()(const Term::LinkBlockFast& terminal) const {
// return fmt::format("LinkBlockFast{{{}}}", terminal.next);
// }
// std::string operator()(const Term::PopRSBHint&) const {
// return "PopRSBHint{}";
// }
// std::string operator()(const Term::FastDispatchHint&) const {
// return "FastDispatchHint{}";
// }
// std::string operator()(const Term::If& terminal) const {
// return fmt::format("If{{{}, {}, {}}}", A64::CondToString(terminal.if_), TerminalToString(terminal.then_), TerminalToString(terminal.else_));
// }
// std::string operator()(const Term::CheckBit& terminal) const {
// return fmt::format("CheckBit{{{}, {}}}", TerminalToString(terminal.then_), TerminalToString(terminal.else_));
// }
// std::string operator()(const Term::CheckHalt& terminal) const {
// return fmt::format("CheckHalt{{{}}}", TerminalToString(terminal.else_));
// }
// } visitor;
// return boost::apply_visitor(visitor, terminal_variant);
return "";
}
std::string DumpBlock(const IR::Block& block) noexcept {
std::string ret = fmt::format("Block: location={}-{}\n", block.Location(), block.EndLocation())
+ fmt::format("cycles={}", block.CycleCount())
@@ -174,8 +140,9 @@ std::string DumpBlock(const IR::Block& block) noexcept {
ret += fmt::format(" (uses: {})", inst.UseCount()) + '\n';
}
ret += "terminal = " + TerminalToString(block.GetTerminal()) + '\n';
return ret;
return ret + "terminal = " + [](const Term::Terminal&) -> std::string {
return "";
}(block.GetTerminal()) + '\n';
}
} // namespace Dynarmic::IR
+6 -2
View File
@@ -209,8 +209,6 @@ add_executable(yuzu
util/overlay_dialog.ui
util/sequence_dialog/sequence_dialog.cpp
util/sequence_dialog/sequence_dialog.h
util/url_request_interceptor.cpp
util/url_request_interceptor.h
util/util.cpp
util/util.h
@@ -241,6 +239,12 @@ add_executable(yuzu
set_target_properties(yuzu PROPERTIES OUTPUT_NAME "eden")
if (YUZU_USE_QT_WEB_ENGINE)
target_sources(yuzu PRIVATE
util/url_request_interceptor.cpp
util/url_request_interceptor.h)
endif()
if (YUZU_CRASH_DUMPS)
target_sources(yuzu PRIVATE
breakpad.cpp
-1
View File
@@ -232,7 +232,6 @@
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="action_Report_Compatibility"/>
<addaction name="action_Open_Mods_Page"/>
<addaction name="action_Open_UserHandbook"/>
<addaction name="separator"/>