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

Use variable-length encodings for REX encodings #1130

Closed
bnjbvr opened this issue Oct 2, 2019 · 2 comments
Closed

Use variable-length encodings for REX encodings #1130

bnjbvr opened this issue Oct 2, 2019 · 2 comments
Labels
cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator

Comments

@bnjbvr
Copy link
Member

bnjbvr commented Oct 2, 2019

Variable-length encodings (introduced to support the proper machine code for loads/stores which memory operand is in a given register on x86) could allow removing the need to have both the REX vs non-REX encodings.

This would have a few benefits:

  • reduce the number of encodings in the legalizer interpreter, making it faster
  • allow some encodings to accept REX registers, when they couldn't before (at least regmove is affected by this issue)
  • reduce the number of methods in PerCpuModeEncodings
@bnjbvr bnjbvr changed the title Use variable-length encodings for REX instructions Use variable-length encodings for REX encodings Oct 2, 2019
@bjorn3
Copy link
Contributor

bjorn3 commented Oct 2, 2019

It would also make the instruction shrinking pass unnecessary when you want to avoid unnecessary REX prefixes. That would for example avoid rust-lang/rustc_codegen_cranelift#146 (comment) when using opt_level=none.

@sstangl sstangl self-assigned this Oct 17, 2019
@alexcrichton alexcrichton transferred this issue from bytecodealliance/cranelift Feb 28, 2020
@alexcrichton alexcrichton added cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator labels Feb 28, 2020
@bnjbvr bnjbvr mentioned this issue Feb 28, 2020
10 tasks
@bjorn3
Copy link
Contributor

bjorn3 commented Feb 3, 2021

The new backend framework emits a REX prefix only when it is necessary.

@cfallin cfallin closed this as completed Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

5 participants