This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Introducing assembler dialects for the Z backend
ClosedPublic

Authored by anirudhp on Jan 7 2021, 11:26 AM.

Details

Summary
  • This patch introduces a different assembler dialect ("hlasm") for z/OS. The default dialect has now been given the "att" dialect name. For this appropriate changes have been added to SystemZ.td.
  • This patch also makes a few changes to SystemZInstrFormats.td which restrict a few condition code mnemonics to just the "att" dialect variant (he, le, lh, nhe, nle, nlh). These extended condition code mnemonics are not available in HLASM.
  • A new private function has been introduced in SystemZAsmParser.cpp to return the assembler dialect set in SystemZMCAsmInfo.cpp. The reason we couldn't/haven't explicitly queried the overriden getAssemblerDialect function from AsmParser is outlined in this thread here. This returned dialect is directly passed onto the relevant matcher functions which taken in a variantID, so that the matcher functions can appropriately choose an instruction based on the variant.

Diff Detail

Event Timeline

anirudhp created this revision.Jan 7 2021, 11:26 AM
anirudhp requested review of this revision.Jan 7 2021, 11:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2021, 11:26 AM
anirudhp edited reviewers, added: jonpa; removed: jnspaulsson.Jan 7 2021, 11:27 AM
anirudhp updated this revision to Diff 315193.Jan 7 2021, 11:56 AM
anirudhp edited the summary of this revision. (Show Details)Jan 7 2021, 1:14 PM

Just a quick comment that I'm looking at this, but before approval I want to resolve the issues described in the comment in front of getMAIAssemblerDialect. See also discussion here: https://reviews.llvm.org/D82862

Just a quick comment that I'm looking at this, but before approval I want to resolve the issues described in the comment in front of getMAIAssemblerDialect. See also discussion here: https://reviews.llvm.org/D82862

Thanks!

uweigand accepted this revision.Feb 26 2021, 4:23 AM

Looks like resolving the general issues with the AsmDialect setting is more complicated than I thought and may still take a while.

Therefore, I think you should go ahead and commit this patch with the work-around described in getMAIAssemblerDialect for now. This is certainly correct for all SystemZ use case. If we do find a better solution in common code, this hack can still be removed at a later date.

LGTM.

This revision is now accepted and ready to land.Feb 26 2021, 4:23 AM

Looks like resolving the general issues with the AsmDialect setting is more complicated than I thought and may still take a while.

Therefore, I think you should go ahead and commit this patch with the work-around described in getMAIAssemblerDialect for now. This is certainly correct for all SystemZ use case. If we do find a better solution in common code, this hack can still be removed at a later date.

LGTM.

Thank you!

This revision was automatically updated to reflect the committed changes.