This is an archive of the discontinued LLVM Phabricator instance.

[SPARC][IAS] Add complete set of v9 ASI load, store & swap forms
ClosedPublic

Authored by koakuma on Aug 6 2023, 7:14 AM.

Details

Summary

This extends support for ASI-tagged loads, stores, and swaps with the new stored-ASI form ([reg+imm] %asi) introduced in v9.
CAS instructions are handled differently by the (dis-)assembler, so it will be handled in a separate patch.

Depends on D157232

Diff Detail

Event Timeline

koakuma created this revision.Aug 6 2023, 7:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2023, 7:14 AM
koakuma requested review of this revision.Aug 6 2023, 7:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2023, 7:14 AM
koakuma updated this revision to Diff 548213.Aug 8 2023, 7:26 AM

Fix disassembly issues.

barannikov88 added inline comments.
llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
1117

Can you use getParser().parseExpression() here?
Why is the variable named Mask?

1118

Missing test case.

1124

Missing test case.

1208–1243

parseSparcAsmOperand is overkill here, you can simply check for 'asi' identifier.
There should be negative test cases with invalid register name (e.g. %g0), percent followed by a non-identifier (e.g. %0), invalid token (e.g. $asi).

1216

Please add a negative test for this code path.

koakuma updated this revision to Diff 549695.Aug 13 2023, 6:10 AM
koakuma marked 5 inline comments as done.

Apply suggestions, clearer error message, fix 32/64-bit differences & simplify ASI value range checking.

This revision is now accepted and ready to land.Aug 15 2023, 6:00 AM
koakuma updated this revision to Diff 555549.Sep 1 2023, 7:48 PM

Refer to ASR3 directly rather than using its "ASI" alias in instruction definitions (to prevent further changes in D157231 from breaking compilation).

This revision was automatically updated to reflect the committed changes.