Skip to content

loongarch: Use unified data types for SIMD intrinsics #1879

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

heiher
Copy link
Contributor

@heiher heiher commented Jul 19, 2025

Suggested by @sayantn

@rustbot
Copy link
Collaborator

rustbot commented Jul 19, 2025

r? @sayantn

rustbot has assigned @sayantn.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@heiher
Copy link
Contributor Author

heiher commented Jul 19, 2025

Although type aliases won't break the build, they will trigger clippy wanrings. If the user's CI treats warnings as errors, this could cause the CI to fail.

warning: transmute from a type (`std::arch::loongarch64::m256i`) to itself
   --> src/simd/lines_bwd.rs:204:47
    |
204 |                 let tmp = lasx_xvpermi_q::<1>(T(sum), T(sum));
    |                                               ^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute
    = note: `#[warn(clippy::useless_transmute)]` on by default

@sayantn
Copy link
Contributor

sayantn commented Jul 19, 2025

seeing that it is a clippy warning, not even rustc-builtin, I would say this is acceptable

Copy link
Contributor

@folkertdev folkertdev left a comment

Choose a reason for hiding this comment

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

re. the transmute warning, that is fine, but it's probably nicest for users to #[allow] the lint (or even #[expect] if you can make that work)

Comment on lines 284 to 405
format!(" -> {}", type_to_rst(out_t, is_store))
format!(" -> {}", type_to_rst(out_t, is_store, true))
Copy link
Contributor

Choose a reason for hiding this comment

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

would using a custom enum instead of a bool be nicer here? just reading this it's hard to know what true means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Thank you!

@heiher heiher force-pushed the loong-simd-unified-types branch from 241e547 to 24ee4b0 Compare July 21, 2025 10:29
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