Skip to content

Conversation

JamieCunliffe
Copy link
Contributor

In LLVM the lshr and ashr instruction is undefined when the amount is
equal to the element size, but Neon shifts support such shifts.

With signed values, when shifting by the element size is requested
subtract one as right shifting a signed value by its size is
equivalent to a shift of size - 1.

When shifting an unsigned value by the element size, return a vector
of all 0's as that's what the shift would result in.

@rust-highfive
Copy link

r? @Amanieu

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

In LLVM the lshr and ashr instruction is undefined when the amount is
equal to the element size, but Neon shifts support such shifts.

With signed values, when shifting by the element size is requested
subtract one as right shifting a signed value by its size is
equivalent to a shift of size - 1.

When shifting an unsigned value by the element size, return a vector
of all 0's as that's what the shift would result in.
@Amanieu
Copy link
Member

Amanieu commented Oct 22, 2021

Should the constraint on the immediate be changed to exclude 64? Is 64 a valid argument for these immediates?

@JamieCunliffe
Copy link
Contributor Author

@Amanieu Amanieu merged commit 299b5e2 into rust-lang:master Oct 22, 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