[WRAPPER] Add wrapper for libmvec.so.1#3683
Merged
ptitSeb merged 1 commit intoptitSeb:mainfrom Mar 19, 2026
Merged
Conversation
Owner
|
It's acceptable, but barely. You unwrap the verctorized sin/cos instead of using the mvec functions themselves. |
Wrap the SSE2 vectorized sin/cos functions from glibc libmvec using native scalar sin()/cos() from libm. Since libmvec.so.1 does not exist as a native library on ppc64le, PRE_INIT uses dlopen(NULL) to obtain a valid library handle. All other ~270 libmvec symbols are listed as commented-out entries in the private header and fall back to emulation.
Contributor
Author
|
@ptitSeb I've just amended the PR, that is to only to fallback to scalar path for non-aarch64/x86_64 |
runlevel5
commented
Mar 19, 2026
|
|
||
| // Try to load the native libmvec.so.1 and resolve vectorized sin/cos. | ||
| // On aarch64 and x86_64: native libmvec exists in glibc, use it. | ||
| // On ppc64le and others: dlopen fails, fall back to scalar sin/cos. |
Contributor
Author
There was a problem hiding this comment.
Hopefully one day https://sourceware.org/pipermail/glibc-cvs/2020q1/068984.html it would be upstreamed for ppc64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wrap the SSE2 vectorized sin/cos functions from glibc libmvec using native scalar sin()/cos() from libm. The Broken Sword Reforged game happens to require these 2 functions.
ref: ptitSeb/box86-compatibility-list#549