Skip to content

Add vrndn neon instructions #1086

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 1 commit into from
Apr 22, 2021
Merged

Add vrndn neon instructions #1086

merged 1 commit into from
Apr 22, 2021

Conversation

CryZe
Copy link
Contributor

@CryZe CryZe commented Mar 16, 2021

This adds the neon instructions for lane-wise rounding without actually converting the lanes to integers.

@rust-highfive
Copy link

r? @Amanieu

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

@Amanieu
Copy link
Member

Amanieu commented Mar 17, 2021

These methods are also available on 32-bit ARM when the "v8" feature is enabled.

@CryZe
Copy link
Contributor Author

CryZe commented Mar 17, 2021

It doesn't seem like Rust ships any target for AArch32. I guess this is meant for when you build std yourself then? (Update: I believe stdarch shouldn't be cfg gating any of this anyway, so there shouldn't be a need for its own target)

The more I look at it, the more I feel like stdarch doesn't support 32-bit v8 properly anyway. float64x2_t isn't even defined for the ARM target for example (update: even if it did, LLVM can't even handle it, it seems?! Is this an LLVM bug or a NEON docs bug?).

@Amanieu
Copy link
Member

Amanieu commented Mar 17, 2021

The more I look at it, the more I feel like stdarch doesn't support 32-bit v8 properly anyway. float64x2_t isn't even defined for the ARM target for example (update: even if it did, LLVM can't even handle it, it seems?! Is this an LLVM bug or a NEON docs bug?).

AArch32 NEON still only supports a subset of AArch64 NEON. In particular f64 SIMD is only supported on AArch64.

AArch32 and AArch64 should be treated as distinct architectures, they have completely different instruction sets. They just happen to share the same intrinsics for NEON.

@CryZe
Copy link
Contributor Author

CryZe commented Mar 17, 2021

In particular f64 SIMD is only supported on AArch64.

Yeah seems like the docs are just wrong then.

@CryZe
Copy link
Contributor Author

CryZe commented Mar 17, 2021

Mmh it seems the remaining CI failures might be because it detects NEON at runtime in the tests which generates too many instructions (and for some it then also optimizes the instruction away?!)

@Amanieu
Copy link
Member

Amanieu commented Mar 17, 2021

I think the ARM/AArch64 code needs to be reorganized into separate arm/aarch64/arm_common directories where arm_common is included by both arm and aarch64.

@bors
Copy link
Contributor

bors commented Mar 20, 2021

☔ The latest upstream changes (presumably 0117f10) made this pull request unmergeable. Please resolve the merge conflicts.

@CryZe CryZe force-pushed the vrndn branch 2 times, most recently from 281da2c to 9b08785 Compare April 21, 2021 22:49
@CryZe
Copy link
Contributor Author

CryZe commented Apr 21, 2021

Seems like most of this PR has actually already been done in the meantime, even the instruction got added. Though when it was added AArch32 support was forgotten about, so I reduced this PR to that change. It's ready for review again.

This adds the neon instructions for lane-wise rounding without actually
converting the lanes to integers.
@Amanieu Amanieu merged commit 2920eee into rust-lang:master Apr 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.

4 participants