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

[SOL] Add feature flag for disabling lddw #77

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

LucasSte
Copy link
Collaborator

@LucasSte LucasSte commented Jan 2, 2024

This PR is a follow-up to #74. t is better to split the new SBFv2 feature into multiple feature flags, instead of hiding them all behind --mcpu=sbfv2. Separate feature flags allow us to test each modification in isolation.

The changes in this PR also fix a decoding issue when using llvm-objdump. When decoding mov32 instructions, I was printing the 32-bit registers, however, we use 64-bit registers when the ALU32 is disabled.

@LucasSte LucasSte requested a review from dmakarov January 3, 2024 12:52
@LucasSte LucasSte marked this pull request as ready for review January 3, 2024 12:52
@@ -1,4 +1,4 @@
; RUN: llc -march=sbf -mcpu=sbfv2 -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s
; RUN: llc -march=sbf -mcpu=sbfv2 -filetype=obj -o - %s | llvm-objdump -d --mcpu=sbfv2 - | FileCheck %s
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seem a bit odd that you need to specify sbfv2 on the command line for llvm-objdump. The tool reads ELF header which contains E_FLAGS field, and that field tells whether the ELF file was generated for SBFv2. Maybe we need to fix that to work correctly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I'll investigate that.

Copy link
Collaborator Author

@LucasSte LucasSte Jan 3, 2024

Choose a reason for hiding this comment

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

We were not reading the flags from the ELF file, so I fixed this in my last commit. The decoding of mov32 reg, imm is ambiguous, because it can either refer to a 32-bit register or to a 64-bit register. To circumvent this, I had to add --mattr=+alu32 in some tests.

@dmakarov
Copy link
Collaborator

dmakarov commented Jan 3, 2024

LGTM, but shouldn't it be rebased and conflicts resolved?

@LucasSte
Copy link
Collaborator Author

LucasSte commented Jan 3, 2024

LGTM, but shouldn't it be rebased and conflicts resolved?

I was working on it.

@LucasSte LucasSte merged commit d1f8163 into anza-xyz:solana-rustc/16.0-2023-06-05 Jan 4, 2024
14 checks passed
@LucasSte LucasSte deleted the lldw-re branch January 4, 2024 11:38
LucasSte added a commit to LucasSte/llvm-project that referenced this pull request Jan 31, 2024
* Fix incorrect obj-dump

* Read flag from elf
LucasSte added a commit that referenced this pull request Feb 16, 2024
* Fix incorrect obj-dump

* Read flag from elf
LucasSte added a commit to LucasSte/llvm-project that referenced this pull request Jun 28, 2024
* Fix incorrect obj-dump

* Read flag from elf
LucasSte added a commit that referenced this pull request Aug 19, 2024
* Fix incorrect obj-dump

* Read flag from elf
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.

2 participants