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

x64: Refactor lowerings for insertlane #8167

Merged

Conversation

alexcrichton
Copy link
Member

Going through old PRs I stumbled across #2716 which is quite old at this point. Upon adding the tests to main I see that most of it is actually implemented except for load-lane-from-memory where the lane size is 8 or 16 bits. That requires explicitly opting-in with sinkable_load_exact so this PR now subsumes the tests of #2716 in addition to implementing this missing hole in lowerings.

This refactoring shuffles around where definitions are located to more easily have access to Value to perform the relevant match. The generic vec_insert_lane helper is now gone as well in lieu of direct matches on insertlane lowerings.

Closes #2716

Going through old PRs I stumbled across bytecodealliance#2716 which is quite old at this
point. Upon adding the tests to `main` I see that most of it is actually
implemented except for load-lane-from-memory where the lane size is 8 or
16 bits. That requires explicitly opting-in with `sinkable_load_exact`
so this PR now subsumes the tests of bytecodealliance#2716 in addition to implementing
this missing hole in lowerings.

This refactoring shuffles around where definitions are located to more
easily have access to `Value` to perform the relevant match. The generic
`vec_insert_lane` helper is now gone as well in lieu of direct matches
on `insertlane` lowerings.

Closes bytecodealliance#2716
@alexcrichton alexcrichton requested a review from a team as a code owner March 18, 2024 16:20
@alexcrichton alexcrichton requested review from cfallin and removed request for a team March 18, 2024 16:20
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen labels Mar 18, 2024
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

LGTM, nice!

(rule (f32x4_insertlane vec val idx)
(f32x4_insertlane_fallback vec val idx))

;; Helper function used below for `insertlane` but also here for other
Copy link
Member

Choose a reason for hiding this comment

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

for other ... (lowerings?) -- missing comment line in code motion

@alexcrichton alexcrichton enabled auto-merge March 18, 2024 19:47
@alexcrichton alexcrichton added this pull request to the merge queue Mar 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 18, 2024
@alexcrichton alexcrichton added this pull request to the merge queue Mar 18, 2024
Merged via the queue into bytecodealliance:main with commit 85afaac Mar 18, 2024
21 checks passed
@alexcrichton alexcrichton deleted the vec-load-lane-from-memory branch March 18, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants