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

Handle mixed-width args to mul-shift-right #6526

Merged
merged 3 commits into from
Jan 4, 2022

Conversation

abadams
Copy link
Member

@abadams abadams commented Jan 2, 2022

and codegen it to pmulhuw on x86

@abadams abadams requested a review from dsharletg January 3, 2022 18:17
Copy link
Contributor

@steven-johnson steven-johnson left a comment

Choose a reason for hiding this comment

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

LGTM pending green

@@ -493,6 +494,25 @@ class FindIntrinsics : public IRMutator {
rounding_mul_shift_right(x, y, cast(unsigned_type, c0)),
is_x_same_int_or_uint && c0 >= bits) ||

// We can also match on smaller shifts if one of the args is
// narrow. We don't do this for signed (yet), because the
// saturation issue is tricky.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we think we will ever do so, tricky or not? (If so, tracking issue, please)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. It depends on if it comes up in practice. It's part of the unbounded frontier of ways we could make instruction selection more clever. I don't want to add a tracking issue for each possible new way to use an instruction.

@abadams abadams merged commit 0089de9 into master Jan 4, 2022
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