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

Divisibility is not properly optimized on aarch64 #453

Open
ArhanChaudhary opened this issue Mar 6, 2025 · 3 comments
Open

Divisibility is not properly optimized on aarch64 #453

ArhanChaudhary opened this issue Mar 6, 2025 · 3 comments
Labels
C-bug Category: Bug

Comments

@ArhanChaudhary
Copy link

The x86 architecture recognizes how to do efficient divisibility testing (https://lomont.org/posts/2017/divisibility-testing/) but not aarch64: https://godbolt.org/z/MhbKvvc4b

It's possible this is not a portable-simd problem and instead somewhere else down the line.

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (30f168ef8 2025-03-05)
binary: rustc
commit-hash: 30f168ef811aec63124eac677e14699baa9395bd
commit-date: 2025-03-05
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

crate version in Cargo.toml:

[dependencies]
stdsimd = 

(I don't know how to check on compiler explorer)

@ArhanChaudhary ArhanChaudhary added the C-bug Category: Bug label Mar 6, 2025
@programmerjake
Copy link
Member

we intentionally scalarize div/rem on aarch64 to workaround backend bugs: #422 (comment)

@calebzulawski I didn't see a LLVM issue for that backend bug after some preliminary searching... do you want to create one?

@ArhanChaudhary
Copy link
Author

Cool, I'll close this in favor of the aforementioned.

@programmerjake
Copy link
Member

Cool, I'll close this in favor of the aforementioned.

#422 isn't an issue, it's a pull request for a completely different thing that was already merged...so this optimization issue is very much not solved, so I'm reopening it.

@programmerjake programmerjake reopened this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

No branches or pull requests

2 participants