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

Correct the vqrdmlah intrinsics. #1246

Merged
merged 1 commit into from
Nov 4, 2021
Merged

Conversation

JamieCunliffe
Copy link
Contributor

The sqrdmulh followed by a sqadd is only optimized into sqrdmlah when the rdm target feature is enabled. I believe this is actually an incorrect optimization in LLVM though. However this patch will cause the correct instruction for the intrinsic, and I couldn't see another way to generate this instruction.

For instance using a = 0x80000000, b = 0x80000000, c = 0x80000000 sqrdmlah would be 0 whereas the sqrdmulh sqadd sequence would be -1

These intrinsics were added in 8.1 and should emit a sqrdmlah, however
they currently emit sqrdmulh followed by a sqadd. LLVM doesn't convert
this into sqrdmlah without enabling the rdm feature.
@rust-highfive
Copy link

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

@Amanieu
Copy link
Member

Amanieu commented Nov 4, 2021

By the way, could you send a bug report to LLVM about the incorrect optimization?

@JamieCunliffe
Copy link
Contributor Author

Yes, I was going to raise it, I'm just waiting on an account on the bug tracker.

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