[cmake] more fixes from torzu, u128 clang-cl
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
3f625fffcb
commit
b42d12ef6b
6 changed files with 30 additions and 18 deletions
|
@ -12,7 +12,8 @@ set(__windows_copy_files YES)
|
||||||
|
|
||||||
# Any number of files to copy from SOURCE_DIR to DEST_DIR can be specified after DEST_DIR.
|
# Any number of files to copy from SOURCE_DIR to DEST_DIR can be specified after DEST_DIR.
|
||||||
# This copying happens post-build.
|
# This copying happens post-build.
|
||||||
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
||||||
# windows commandline expects the / to be \ so switch them
|
# windows commandline expects the / to be \ so switch them
|
||||||
string(REPLACE "/" "\\\\" SOURCE_DIR ${SOURCE_DIR})
|
string(REPLACE "/" "\\\\" SOURCE_DIR ${SOURCE_DIR})
|
||||||
string(REPLACE "/" "\\\\" DEST_DIR ${DEST_DIR})
|
string(REPLACE "/" "\\\\" DEST_DIR ${DEST_DIR})
|
||||||
|
@ -24,4 +25,12 @@ function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
|
||||||
COMMAND robocopy ${SOURCE_DIR} ${DEST_DIR} ${ARGN} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
|
COMMAND robocopy ${SOURCE_DIR} ${DEST_DIR} ${ARGN} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
else()
|
||||||
|
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
||||||
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
|
||||||
|
COMMAND cp -ra ${SOURCE_DIR}/. ${DEST_DIR}
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
endif()
|
||||||
|
|
|
@ -14,7 +14,10 @@
|
||||||
"artifact": "%TAG%-cmake.7z",
|
"artifact": "%TAG%-cmake.7z",
|
||||||
"hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01",
|
"hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01",
|
||||||
"git_version": "1.88.0",
|
"git_version": "1.88.0",
|
||||||
"version": "1.57"
|
"version": "1.57",
|
||||||
|
"patches": [
|
||||||
|
"0001-clang-cl.patch"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"fmt": {
|
"fmt": {
|
||||||
"repo": "fmtlib/fmt",
|
"repo": "fmtlib/fmt",
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Common {
|
||||||
|
|
||||||
// This function multiplies 2 u64 values and divides it by a u64 value.
|
// This function multiplies 2 u64 values and divides it by a u64 value.
|
||||||
[[nodiscard]] static inline u64 MultiplyAndDivide64(u64 a, u64 b, u64 d) {
|
[[nodiscard]] static inline u64 MultiplyAndDivide64(u64 a, u64 b, u64 d) {
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
u128 r{};
|
u128 r{};
|
||||||
r[0] = _umul128(a, b, &r[1]);
|
r[0] = _umul128(a, b, &r[1]);
|
||||||
u64 remainder;
|
u64 remainder;
|
||||||
|
@ -41,7 +41,7 @@ namespace Common {
|
||||||
// This function multiplies 2 u64 values and produces a u128 value;
|
// This function multiplies 2 u64 values and produces a u128 value;
|
||||||
[[nodiscard]] static inline u128 Multiply64Into128(u64 a, u64 b) {
|
[[nodiscard]] static inline u128 Multiply64Into128(u64 a, u64 b) {
|
||||||
u128 result;
|
u128 result;
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
result[0] = _umul128(a, b, &result[1]);
|
result[0] = _umul128(a, b, &result[1]);
|
||||||
#else
|
#else
|
||||||
unsigned __int128 tmp = a;
|
unsigned __int128 tmp = a;
|
||||||
|
|
|
@ -24,7 +24,7 @@ constexpr auto PauseCycles = 100'000U;
|
||||||
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
__forceinline static void TPAUSE() {
|
__forceinline static void TPAUSE() {
|
||||||
static constexpr auto RequestC02State = 0U;
|
static constexpr auto RequestC02State = 0U;
|
||||||
_tpause(RequestC02State, FencedRDTSC() + PauseCycles);
|
_tpause(RequestC02State, FencedRDTSC() + PauseCycles);
|
||||||
|
|
|
@ -197,12 +197,12 @@ private:
|
||||||
|
|
||||||
struct VM {
|
struct VM {
|
||||||
static constexpr u32 YUZU_PAGESIZE{0x1000};
|
static constexpr u32 YUZU_PAGESIZE{0x1000};
|
||||||
static constexpr u32 PAGE_SIZE_BITS{std::countr_zero(YUZU_PAGESIZE)};
|
static constexpr u32 PAGE_SIZE_BITS{std::countr_zero<u32>(YUZU_PAGESIZE)};
|
||||||
|
|
||||||
static constexpr u32 SUPPORTED_BIG_PAGE_SIZES{0x30000};
|
static constexpr u32 SUPPORTED_BIG_PAGE_SIZES{0x30000};
|
||||||
static constexpr u32 DEFAULT_BIG_PAGE_SIZE{0x20000};
|
static constexpr u32 DEFAULT_BIG_PAGE_SIZE{0x20000};
|
||||||
u32 big_page_size{DEFAULT_BIG_PAGE_SIZE};
|
u32 big_page_size{DEFAULT_BIG_PAGE_SIZE};
|
||||||
u32 big_page_size_bits{std::countr_zero(DEFAULT_BIG_PAGE_SIZE)};
|
u32 big_page_size_bits{std::countr_zero<u32>(DEFAULT_BIG_PAGE_SIZE)};
|
||||||
|
|
||||||
static constexpr u32 VA_START_SHIFT{10};
|
static constexpr u32 VA_START_SHIFT{10};
|
||||||
static constexpr u64 DEFAULT_VA_SPLIT{1ULL << 34};
|
static constexpr u64 DEFAULT_VA_SPLIT{1ULL << 34};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue