-
Notifications
You must be signed in to change notification settings - Fork 2
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
Does 0(Rn) as [at]Rn printing is not correct? #45
Comments
We could implement this as a separate MI-level pass. that would essentially "shrink" the encoding. |
Ok. Then I'll try to do so. |
Isn't that the SelectionDAG job to select an optimal instruction form / addressing mode? |
Yes and no :)
|
@asl |
As I mentioned in slack, I realized that PR #42 introduces not correct replacement for
0(Rn)
as@Rn
while printing a memory operand for an instruction.The patch makes the replacement for both source and destination position. For source position it looks not correct, since original and printed instructions become not equal by their encoding.
Compare:
and
It may be a kind of optimization, but asm printer doesn't look like a good place for this, does it?
For destination position there is no such kind of ambiguity, but there is an opinion that it may confuse a user.
Comparing with gnu toolchain:
I've never seen that gcc prints
0(rn)
for both source and destination positions (maybe it optimizes0(rn)
case), but gnu disassembler always prints0(rn)
if it sees the corresponded encoding for both source and destination position.The text was updated successfully, but these errors were encountered: