Browse Source
[cmake] more fixes from torzu, u128 clang-cl
Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/348/head
lizzie
7 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
6 changed files with
30 additions and
18 deletions
-
.patch/boost/0001-clang-cl.patch
-
CMakeModules/WindowsCopyFiles.cmake
-
cpmfile.json
-
src/common/uint128.h
-
src/common/x64/cpu_wait.cpp
-
src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
|
|
|
@ -12,6 +12,7 @@ set(__windows_copy_files YES) |
|
|
|
|
|
|
|
# Any number of files to copy from SOURCE_DIR to DEST_DIR can be specified after DEST_DIR. |
|
|
|
# This copying happens post-build. |
|
|
|
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 |
|
|
|
string(REPLACE "/" "\\\\" SOURCE_DIR ${SOURCE_DIR}) |
|
|
|
@ -25,3 +26,11 @@ function(windows_copy_files TARGET SOURCE_DIR DEST_DIR) |
|
|
|
COMMAND robocopy ${SOURCE_DIR} ${DEST_DIR} ${ARGN} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0" |
|
|
|
) |
|
|
|
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", |
|
|
|
"hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01", |
|
|
|
"git_version": "1.88.0", |
|
|
|
"version": "1.57" |
|
|
|
"version": "1.57", |
|
|
|
"patches": [ |
|
|
|
"0001-clang-cl.patch" |
|
|
|
] |
|
|
|
}, |
|
|
|
"fmt": { |
|
|
|
"repo": "fmtlib/fmt", |
|
|
|
|
|
|
|
@ -20,7 +20,7 @@ namespace Common { |
|
|
|
|
|
|
|
// This function multiplies 2 u64 values and divides it by a u64 value. |
|
|
|
[[nodiscard]] static inline u64 MultiplyAndDivide64(u64 a, u64 b, u64 d) { |
|
|
|
#ifdef _MSC_VER |
|
|
|
#if defined(_MSC_VER) && !defined(__clang__) |
|
|
|
u128 r{}; |
|
|
|
r[0] = _umul128(a, b, &r[1]); |
|
|
|
u64 remainder; |
|
|
|
@ -41,7 +41,7 @@ namespace Common { |
|
|
|
// This function multiplies 2 u64 values and produces a u128 value; |
|
|
|
[[nodiscard]] static inline u128 Multiply64Into128(u64 a, u64 b) { |
|
|
|
u128 result; |
|
|
|
#ifdef _MSC_VER |
|
|
|
#if defined(_MSC_VER) && !defined(__clang__) |
|
|
|
result[0] = _umul128(a, b, &result[1]); |
|
|
|
#else |
|
|
|
unsigned __int128 tmp = a; |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ constexpr auto PauseCycles = 100'000U; |
|
|
|
|
|
|
|
} // Anonymous namespace
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
|
|
|
__forceinline static void TPAUSE() { |
|
|
|
static constexpr auto RequestC02State = 0U; |
|
|
|
_tpause(RequestC02State, FencedRDTSC() + PauseCycles); |
|
|
|
|
|
|
|
@ -197,12 +197,12 @@ private: |
|
|
|
|
|
|
|
struct VM { |
|
|
|
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 DEFAULT_BIG_PAGE_SIZE{0x20000}; |
|
|
|
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 u64 DEFAULT_VA_SPLIT{1ULL << 34}; |
|
|
|
|