Skip to content

Fix generated Neon simd_test features. - #1367

Merged
Amanieu merged 3 commits into
rust-lang:masterfrom
jacobbramley:dev/neon-tgt-ft
Jan 9, 2023
Merged

Fix generated Neon simd_test features.#1367
Amanieu merged 3 commits into
rust-lang:masterfrom
jacobbramley:dev/neon-tgt-ft

Conversation

@jacobbramley

Copy link
Copy Markdown
Contributor

The tests can run if and only if the target_features for the corresponding intrinsics are detected at run-time, so make sure that the tests have an appropriate simd_test().

This fixes some failures due to tests running when they shouldn't. For example, some tests would fail on hardware that lacks "fcma".

This decouples the feature names in the generator, since "arm" and "arm64" use different names, and for "arm" the dynamic simd_test features don't match the static target_feature names.

There are several changes to the tests, but changes to the generated intrinsics themselves are minimal, and cosmetic.

@rustbot

Copy link
Copy Markdown
Collaborator

r? @Amanieu

(rustbot has picked a reviewer for you, use r? to override)

@jacobbramley

Copy link
Copy Markdown
ContributorAuthor

Hmm... ci/style.sh is (now) failing on a file I didn't modify. (It fails on master for me too.)

@Nugine

Copy link
Copy Markdown
Contributor

Hmm... ci/style.sh is (now) failing on a file I didn't modify. (It fails on master for me too.)

I accidentally added an invisble space in this line. CI passed in the PR because rustfmt-preview was missing.

if rustup component add rustfmt-preview ;then
command -v rustfmt
rustfmt -V
cargo fmt --all -- --check
fi

Is the single space worth a PR? 😂

@Amanieu

Copy link
Copy Markdown
Member

As @Nugine said, just remove the extra space in this PR.

"arm" and "aarch64" support different sets of `target_feature` and
`simd_test` arguments, and for "arm", the set of features that can be
dynamically detected is different again. Restructure the generator code
to allow this to be expressed accurately (in future patches).
This implementation preserves the way that target features are specified
for shared intrinsics, because this has an impact on the generated
documentation. In particular, rustdoc cannot look inside
`cfg_attr(target_arch = ...)` tests, so we use unconditional
`target_feature` attributes where possible.
The tests can run if and only if the target_features for the
corresponding intrinsics are detected at run-time, so make sure that the
tests have an appropriate `simd_test()`.
This fixes some failures due to tests running when they shouldn't. For
example, some tests would fail on hardware that lacks "fcma".
@jacobbramley

Copy link
Copy Markdown
ContributorAuthor

Done. Sorry about the force-push; the whitespace fix wouldn't apply otherwise.

@Amanieu
Amanieu merged commit 3d89e05 into rust-lang:masterJan 9, 2023
@jacobbramley
jacobbramley deleted the dev/neon-tgt-ft branch January 13, 2023 15:23
Sign up for freeto 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

@jacobbramley@rustbot@Nugine@Amanieu