This is an archive of the discontinued LLVM Phabricator instance.

[M68k] Use fixed asm string for MxPseudo instructions
ClosedPublic

Authored by ricky26 on Mar 12 2021, 10:44 AM.

Details

Summary

This is required because empty strings are not allowed when generating
the assembly parser tables.

Diff Detail

Event Timeline

ricky26 created this revision.Mar 12 2021, 10:44 AM
ricky26 published this revision for review.Mar 12 2021, 12:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2021, 12:32 PM
RKSimon added a subscriber: RKSimon.

@myhsu Would we be better off adding non-empty asm strings to all uses?

myhsu added a comment.Mar 15 2021, 2:47 PM

@myhsu Would we be better off adding non-empty asm strings to all uses?

Do you mean setting non-empty asm string by default on MxInst? I feel like the non-empty string requirement imposed by parser table can help us catch mistakes if we forget to set assembly string for an instruction (in the future), so I'm incline not to do that

@myhsu Would we be better off adding non-empty asm strings to all uses?

Do you mean setting non-empty asm string by default on MxInst? I feel like the non-empty string requirement imposed by parser table can help us catch mistakes if we forget to set assembly string for an instruction (in the future), so I'm incline not to do that

I meant just stop MxPseudo taking a default string so all instances include a useful asm comment string.

myhsu added a comment.EditedMar 17 2021, 12:00 PM

@myhsu Would we be better off adding non-empty asm strings to all uses?

Do you mean setting non-empty asm string by default on MxInst? I feel like the non-empty string requirement imposed by parser table can help us catch mistakes if we forget to set assembly string for an instruction (in the future), so I'm incline not to do that

I meant just stop MxPseudo taking a default string so all instances include a useful asm comment string.

Ah, using the asm string as comments (for MxPseudo instances), I see. But I don't think these pseudo instructions will ever be printed/parsed to/from assembly (so it can't be used as comments in assembly code). From what I understand they're only syntax sugar for codegen (unlike some of the targets that have assembler pseudo instructions). If that's the case, I don't think it's really necessary to put meaningful string in the assembly string. If we want to add comments (for documentation purpose rather than real comments in the assembly code), I prefer to put in the TG code.

OK fair enough, no more comments.

myhsu accepted this revision.Mar 17 2021, 1:27 PM

LGTM

This revision is now accepted and ready to land.Mar 17 2021, 1:27 PM
This revision was automatically updated to reflect the committed changes.