Skip to content

build: Fix xxhash x86 dispatch#49

Merged
StrikerX3 merged 1 commit intoStrikerX3:mainfrom
Wunkolo:xxhash-x64-dispatch-fix
May 3, 2025
Merged

build: Fix xxhash x86 dispatch#49
StrikerX3 merged 1 commit intoStrikerX3:mainfrom
Wunkolo:xxhash-x64-dispatch-fix

Conversation

@Wunkolo
Copy link
Contributor

@Wunkolo Wunkolo commented May 3, 2025

When compiling for a non-x86 platform, the x86-dispatch should not be included by explicitly checking the value of the OS_PLATFORM query-result.

When compiling for a non-x86 platform, the x86-dispatch should not be included
by explicitly checking the value of the `OS_PLATFORM` query-result.
@Wunkolo
Copy link
Contributor Author

Wunkolo commented May 3, 2025

This was all that was needed for me to get Ymir compiling and running on a Windows-On-Arm machine(Thinkpad X13S):

Screen.Recording.2025-05-03.130749.mp4

@StrikerX3
Copy link
Owner

StrikerX3 commented May 3, 2025

Can't believe I missed that detail. Thank you!

Are you running a Debug build in that video, by any chance? I'm surprised it runs that slow on an ARM device. Yep, seems to be a Debug build.

image

@StrikerX3 StrikerX3 merged commit 482ae3c into StrikerX3:main May 3, 2025
@Wunkolo Wunkolo deleted the xxhash-x64-dispatch-fix branch May 3, 2025 22:33
@Wunkolo
Copy link
Contributor Author

Wunkolo commented May 3, 2025

Yep this was debug! I'm currently unable to compile on release mode for some reason. I reach a state during compilation where cl.exe just goes on seemingly forever and claims more and more memory before flushing back down a bit and then starts climbing up again endlessly despite stuff like LTO/IPO being disabled. I would likely have to figure out a way to cross-compile for release-mode builds.

Recording.2025-05-03.163940.mp4

When I kill the processes manually to see the build-errors it outputs, I find that this occurs when compiling sh2.cpp.obj, m68k.cpp.obj, and rewind_buffer.cpp.obj in particular. It compiles fine though in debug mode. It might have to do with the usage of FORCE_INLINE or FLATTEN:

#if !defined(NDEBUG) || defined(DISABLE_FORCE_INLINE)
#define FORCE_INLINE inline
#define NO_INLINE
#define FLATTEN
#elif (defined(__GNUC__) || defined(__GNUG__) || defined(__clang__))
#define FORCE_INLINE [[gnu::always_inline]] inline
#define NO_INLINE [[gnu::noinline]]
#define FLATTEN [[gnu::flatten]]
#elif defined(_MSC_VER)
#define FORCE_INLINE [[msvc::forceinline]] inline
#define NO_INLINE [[msvc::noinline]]
#define FLATTEN [[msvc::flatten]]
#else
#define FORCE_INLINE inline
#define NO_INLINE
#define FLATTEN
#endif

@Wunkolo
Copy link
Contributor Author

Wunkolo commented May 4, 2025

Removing FLATTEN from these files got it building in release-mode and working full-speed now! I'll sustain these changes locally since this seems like an arm64-MSVC compilation error.

Recording.2025-05-03.170914.mp4

@StrikerX3
Copy link
Owner

Interesting. I've faced a similar issue with GCC builds on Linux. It might be worth it revisiting the usage of FLATTEN then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants