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

Please add a feature to switch to a basic implementation #155

Open
glandium opened this issue Jun 23, 2024 · 4 comments
Open

Please add a feature to switch to a basic implementation #155

glandium opened this issue Jun 23, 2024 · 4 comments

Comments

@glandium
Copy link
Contributor

Behind this generic request, here is my actual problem: running code that uses memchr under miri fails with the following:

error: unsupported operation: can't call foreign function `llvm.aarch64.neon.umaxp.v16i8` on OS `macos`
    --> /Users/glandium/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/aarch64/neon/mod.rs:1903:5
     |
1903 |     vpmaxq_u8_(a, b)
     |     ^^^^^^^^^^^^^^^^ can't call foreign function `llvm.aarch64.neon.umaxp.v16i8` on OS `macos`
     |
     = help: if this is a basic API commonly used on this target, please report an issue with Miri
     = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases

where the call to this function originates from memchr.

A feature that switches to use a dumb implementation could be useful for cases like this.

@BurntSushi
Copy link
Owner

The error message you got suggests reporting it to Miri. Have you done so? It seems unwise to add features to this crate to work around incomplete support in another tool.

@glandium
Copy link
Contributor Author

Does that count as a "basic API commonly used", though?

@BurntSushi
Copy link
Owner

Does that count as a "basic API commonly used", though?

They did it for the x86-64 intrinsics. And the fact that memchr uses it makes it commonly used. ;-)

@glandium
Copy link
Contributor Author

FWIW, I found the following on the miri repo:
rust-lang/miri#3172 is an existing issue about the aarch64 intrinsics. Nobody seems to be working on it.
rust-lang/miri#3243 (comment) is a general recommendation to implement what this issue is asking for.

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

No branches or pull requests

2 participants