Skip to content

Fix lane-swapping on pairwise big endian Neon intrinsic#2087

Merged
folkertdev merged 3 commits intorust-lang:mainfrom
adamgemmell:dev/adagem01/intrinsic-test-fixes
Apr 17, 2026
Merged

Fix lane-swapping on pairwise big endian Neon intrinsic#2087
folkertdev merged 3 commits intorust-lang:mainfrom
adamgemmell:dev/adagem01/intrinsic-test-fixes

Conversation

@adamgemmell
Copy link
Copy Markdown
Contributor

@adamgemmell adamgemmell commented Apr 17, 2026

This PR also includes some minor improvements to intrinsic-test

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @folkertdev, @sayantn
  • @Amanieu, @folkertdev, @sayantn expanded to Amanieu, folkertdev, sayantn
  • Random selection from Amanieu, folkertdev, sayantn

@adamgemmell adamgemmell changed the title Minor fixes for intrinsic-test Fix lane-swapping on pairwise big endian Neon intrinsic Apr 17, 2026
pub fn to_c_type(&self) -> String {
let prefix = if self.ty.constant { "const " } else { "" };
format!("{prefix}{}", self.ty.c_type())
self.ty.c_type()
Copy link
Copy Markdown
Contributor

@folkertdev folkertdev Apr 17, 2026

Choose a reason for hiding this comment

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

you've now removed the "const " prefix in both cases (here and in c_type), is that right?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, it should be handled by generate_c_constraint_blocks() now, and this avoids a warning about const const appearing in the output

.map(|(idx, arg)| {
format!(
"{indentation}{ty} {name} = cast<{ty}>({load}(&{name}_vals[i]));\n",
"{indentation}{ty} {name} = cast<{ty}>({load}(&{name}_vals[i+{idx}]));\n",
Copy link
Copy Markdown
Contributor

@folkertdev folkertdev Apr 17, 2026

Choose a reason for hiding this comment

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

to be clear, not using idx before was a bug right?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Doing it this way (ensuring that two inputs to the intrinsic aren't always equal) provides a bit of extra coverage and should slightly reduce runtime. Just an oversight that we never did it this way originally

@folkertdev folkertdev added this pull request to the merge queue Apr 17, 2026
Merged via the queue into rust-lang:main with commit 3c25619 Apr 17, 2026
76 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.

4 participants