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

Fix some minor intrinsic-test issues. #1490

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

jacobbramley
Copy link
Contributor

Notably, fix some warnings that flood the console, making it awkward to debug Arm tests.

@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2023

r? @Amanieu

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

Copy link
Member

@Amanieu Amanieu left a comment

Choose a reason for hiding this comment

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

LGTM with the minor typo in the comment fixed.

/// This is determistic based on the pass number.
///
/// * `loads`: The number of values that need to be loaded from the argument array
/// * e.g for argument type uint32x2, loads=2 results in a string representing 4 32-bit values
///
/// Returns a string such as
/// * `0x1, 0x7F, 0xFF` if `language` is `Language::C`
/// * `0x1 as _, 0x7F as _, 0xFF as _` if `language` is `Language::Rust`
/// * `[0x1, 0x7F, 0xFF]` if `language` is `Language::C`
Copy link
Member

Choose a reason for hiding this comment

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

Should this be {} instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in (force-pushed) 326fe6f.

This fixes "unnecessary `unsafe` block" warnings encountered when
building the generated rust_programs.

The only pattern that actually required `unsafe` was transmuting bit
patterns into floats. This patch uses the safe `from_bits` instead, but
because that isn't const, we have to make them local let-bound
variables.
- Ensure that C literals don't rely on undefined overflow behaviour.
- We don't need to use 'as' casts, so remove them.
- We weren't using allow(overflowing_literals), so remove it.
- Format FP bit values as hex.

This simplifies the test input initialisers in the generated files,
making them shorter and easier to debug.
CARGO_PKG_AUTHORS is :-separated.

Also add myself to intrinsic-test authors.
This avoids a flood of warnings when testing the
armv7-unknown-linux-gnueabihf target.

Under this target, we would pass -Ctarget-features=+neon when building
intrinsic-test, but it is compiled for the host (and this tool doesn't
need Neon even if the host _is_ Armv7).

This also sets --target when running the 'hex' example, since that
seems more appropriate than always building it for the host.
@Amanieu Amanieu merged commit e504eff into rust-lang:master Nov 1, 2023
26 checks passed
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