Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and use the cpu_features library for feature detect #16862

Merged
merged 6 commits into from
Jan 30, 2023

Conversation

unknownbrackets
Copy link
Collaborator

Unfortunately this "cross-platform C library" leaves some cross-platformness to be desired, so it's only used where supported. Still, it seems more well tested and has some fixes for misreported flags on ARM processors, etc.

I had to throw out its CMakeLists.txt, because it doesn't build at all on macOS and had relative path errors when used as an add_subdirectory().

It seems like it might at some point soon (?) support macOS/iOS and Windows for ARM64. It also does some logic to pull getauxval() dynamically because Android is annoying.

It would be worth trying this against some old Android like Xperia Play before merging.

Also threw in RISC-V half-float encodings, since they're ratified and just minor variation on existing instructions (not sure if we'd use them, maybe the convert between 16/32...)

-[Unknown]

@hrydgard hrydgard added this to the v1.15.0 milestone Jan 30, 2023
@hrydgard
Copy link
Owner

Tried it on a reasonably old device (Shield Portable) and it's fine. Let's go for it, makes sense to use an existing, tested library for this.

@hrydgard hrydgard enabled auto-merge January 30, 2023 17:47
@hrydgard hrydgard merged commit df1c013 into hrydgard:master Jan 30, 2023
@unknownbrackets unknownbrackets deleted the cpu-detect branch January 30, 2023 19:49
@gchatelet
Copy link

@unknownbrackets

Unfortunately this "cross-platform C library" leaves some cross-platformness to be desired, so it's only used where supported. Still, it seems more well tested and has some fixes for misreported flags on ARM processors, etc.

Can you elaborate on which platforms are not supported enough? Actually it would be even better if you could open an issue so we can track it or +1 an existing issue so we can prioritize. Thx!

@unknownbrackets
Copy link
Collaborator Author

BSD (not just FreeBSD), UWP (Universal Windows Platform), iOS iirc, and Switch are the ones I remember. PPSSPP runs on a lot of devices and platforms, and cpu_features doesn't even run on Windows non-UWP ARM64 yet, so from the perspective of PPSSPP it is not all that cross-platform. It just supports a few of the most popular platforms.

-[Unknown]

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.

3 participants