Compare commits

...

3 commits

Author SHA1 Message Date
Santiago
c18ab59e77
Merge 073a8fbf66 into cea072b59b 2025-07-24 13:22:55 -07:00
Manuel Alfayate Corchete
cea072b59b
Remove unnecessary x11 header include. (#122)
Some checks failed
validate / ubuntu (arm64, Debug) (push) Has been cancelled
validate / ubuntu (arm64, Release) (push) Has been cancelled
validate / ubuntu (x64, Debug) (push) Has been cancelled
validate / ubuntu (x64, Release) (push) Has been cancelled
validate / windows (x64, Debug) (push) Has been cancelled
validate / windows (x64, Release) (push) Has been cancelled
validate / macos (arm64, Debug) (push) Has been cancelled
validate / macos (arm64, Release) (push) Has been cancelled
validate / macos (x64, Debug) (push) Has been cancelled
validate / macos (x64, Release) (push) Has been cancelled
2025-07-24 15:00:45 -04:00
Santiago
073a8fbf66 Fix MSVC build 2025-05-12 22:37:36 +02:00
4 changed files with 23 additions and 13 deletions

View file

@ -4,6 +4,7 @@ project(librecomp)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 11)
# Define the library
add_library(librecomp STATIC
@ -46,11 +47,13 @@ target_include_directories(librecomp PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include/librecomp"
)
target_compile_options(librecomp PRIVATE
# -Wall
# -Wextra
-Wno-unused-parameter
)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(librecomp PRIVATE
# -Wall
# -Wextra
-Wno-unused-parameter
)
endif()
if (WIN32)
add_compile_definitions(NOMINMAX)

View file

@ -36,6 +36,12 @@ using u32 = uint32_t;
#define DIVOUT vpu.divout
#define DIVDP vpu.divdp
#ifdef _MSC_VER
#define COUNT_LEADING_ZEROES __lzcnt
#else
#define COUNT_LEADING_ZEROES __builtin_clz
#endif
auto RSP::r128::operator()(u32 index) const -> r128 {
if constexpr (Accuracy::RSP::SISD) {
r128 v{ *this };
@ -1348,7 +1354,7 @@ auto RSP::VRCP(r128& vd, u8 de, cr128& vt) -> void {
} else if (input == -32768) {
result = 0xffff'0000;
} else {
u32 shift = __builtin_clz(data);
u32 shift = COUNT_LEADING_ZEROES(data);
u32 index = (u64(data) << shift & 0x7fc0'0000) >> 22;
result = rspReciprocals[index];
result = (0x10000 | result) << 14;
@ -1400,7 +1406,7 @@ auto RSP::VRSQ(r128& vd, u8 de, cr128& vt) -> void {
} else if (input == -32768) {
result = 0xffff'0000;
} else {
u32 shift = __builtin_clz(data);
u32 shift = COUNT_LEADING_ZEROES(data);
u32 index = (u64(data) << shift & 0x7fc0'0000) >> 22;
result = rspInverseSquareRoots[index & 0x1fe | shift & 1];
result = (0x10000 | result) << 14;

View file

@ -29,11 +29,13 @@ target_include_directories(ultramodern PUBLIC
"${PROJECT_SOURCE_DIR}/../thirdparty/sse2neon"
)
target_compile_options(ultramodern PRIVATE
# -Wall
# -Wextra
-Wno-unused-parameter
)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(ultramodern PRIVATE
# -Wall
# -Wextra
-Wno-unused-parameter
)
endif()
if (WIN32)
add_compile_definitions(NOMINMAX)

View file

@ -12,7 +12,6 @@
#elif defined(__ANDROID__)
# include "android/native_window.h"
#elif defined(__linux__)
# include "X11/Xlib.h"
# undef None
# undef Status
# undef LockMask