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

AArch64: Migrate calls and returns to ISLE. #4788

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

cfallin
Copy link
Member

@cfallin cfallin commented Aug 26, 2022

This borrows some machinery from x64 and makes it common. The order of setup for on-stack args is reversed now, but that seems OK if it means we can share more code!

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:x64 Issues related to x64 codegen isle Related to the ISLE domain-specific language labels Aug 26, 2022
@github-actions
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:area:machinst", "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

@elliottt elliottt left a comment

Choose a reason for hiding this comment

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

This all looks great to me! I just had a couple of non-blocking questions 👍

Comment on lines +985 to +989
(decl lower_return (Range ValueSlice) InstOutput)
(rule (lower_return (range_empty) _) (output_none))
(rule (lower_return (range_unwrap head tail) args)
(let ((_ Unit (copy_to_regs (retval head) (value_slice_get args head))))
(lower_return tail args)))
Copy link
Member

Choose a reason for hiding this comment

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

Not at all blocking, but I wonder what a better name for this would be now that it's shared between multiple backends.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can definitely think more about this -- it also felt a little strange to put it in prelude.isle to be honest; it seems more like we need a library of "common lowering helpers" that is separate from the language and ISLE-binding prelude proper. But, we can refine more in subsequent PRs!

; orr x0, xzr, #4294967295
; movn x0, #0
Copy link
Member

Choose a reason for hiding this comment

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

What caused this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

The returns are going through a different path now, so the immediate handling is a little different; but this is still correct I think (movn x0, #0 generates all-ones, which for an i32 func is the same as u32::MAX in the return register).

@cfallin cfallin merged commit 8e8dfdf into bytecodealliance:main Aug 26, 2022
@cfallin cfallin deleted the aarch64-isle-call-ret branch August 26, 2022 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. 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