Skip to content

Add vrshl, vrshr, vrshrn, vrsra, vsra neon instructions #1127

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

Merged
merged 5 commits into from
Apr 19, 2021

Conversation

SparrowLii
Copy link
Member

@SparrowLii SparrowLii commented Apr 19, 2021

This PR does the fowwing:

  1. Add vrshl, vrshr, vrshrn, vrsra, vsra neon instructions
  2. Supplement the cases where the parameters in the shift instructions are 64-bit integers
    The Github comparison program is not displayed correctly. This PR did not make any changes to the original instructions

@rust-highfive
Copy link

r? @Amanieu

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

/// Signed rounding shift right and accumulate
#[inline]
#[target_feature(enable = "neon")]
#[cfg_attr(test, assert_instr(nop, N = 2))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should generate srsra. I have checked that clang generates this so we should be able to do the same.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing. But we can't seem to optimize it to srsra. In Clang, it calls llvm.aarch64.neon.srshl.i64, but the i64 suffix has bugs under some architectures (aarch64-linux-android)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I converted i64 to int64x1_t, but then it can't be optimized to srsra

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about it then, but put a comment explaining that it doesn't optimize properly.

@Amanieu Amanieu merged commit d23e2a4 into rust-lang:master Apr 19, 2021
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