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: Lower bitcast, fabs, and fneg in ISLE #4729

Merged
merged 6 commits into from
Aug 19, 2022

Conversation

elliottt
Copy link
Member

@elliottt elliottt commented Aug 17, 2022

Migrate the bitcast, fabs, and fneg instructions to ISLE

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen isle Related to the ISLE domain-specific language labels Aug 17, 2022
@github-actions
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "isle"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

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.

r+ on new commits here; will approve once we resolve #4722 and rebase this


(rule (lower (has_type $F32X4 (fneg x)))
(x64_xorps x
(x64_pslld (vector_all_ones $F32X4)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder, would it be better to use a VCodeConstant here to get the appropriate MSBs-only-in-each-lane value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would that be a savings over the two instructions?

Copy link
Member

Choose a reason for hiding this comment

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

Possibly, though looking at xorps I see the basic SSE version is not reg, reg/mem but just reg, reg so it would still be a separate load; one load vs. dependent chain of two 1-cycle ops, the latter likely wins. Anyway it's an unimportant enough question that I don't care too much to investigate further :-)

@elliottt elliottt marked this pull request as ready for review August 18, 2022 20:05
@elliottt elliottt force-pushed the trevor/x64-bitcast-fabs-fneg branch from 409dbe1 to 30e2041 Compare August 18, 2022 20:07
@elliottt elliottt force-pushed the trevor/x64-bitcast-fabs-fneg branch from 30e2041 to 5537332 Compare August 18, 2022 20:09
@elliottt elliottt requested a review from cfallin August 18, 2022 21:37
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, thanks!

@cfallin cfallin merged commit 80c77da into bytecodealliance:main Aug 19, 2022
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 isle Related to the ISLE domain-specific language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants