llvm-project/llvm/lib
Sam Elliott f596f45070 [RISCV] Add Custom Parser for Atomic Memory Operands
Summary:
GCC Accepts both (reg) and 0(reg) for atomic instruction memory
operands. These instructions do not allow for an offset in their
encoding, so in the latter case, the 0 is silently dropped.

Due to how we have structured the RISCVAsmParser, the easiest way to add
support for parsing this offset is to add a custom AsmOperand and
parser. This parser drops all the parens, and just keeps the register.

This commit also adds a custom printer for these operands, which matches
the GCC canonical printer, printing both `(a0)` and `0(a0)` as `(a0)`.

Reviewers: asb, lewis-revill

Reviewed By: asb

Subscribers: s.egerton, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, jfb, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65205

llvm-svn: 367553
2019-08-01 12:42:31 +00:00
..
Analysis [IR] Value: add replaceUsesWithIf() utility 2019-08-01 12:32:08 +00:00
AsmParser ARM MTE stack sanitizer. 2019-07-15 20:02:23 +00:00
BinaryFormat [Object][XCOFF] Add support for 64-bit file header and section header dumping. 2019-07-09 18:09:11 +00:00
Bitcode Reland: [Remarks] Add an LLVM-bitstream-based remark serializer 2019-07-31 00:13:51 +00:00
Bitstream [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
CodeGen [SelectionDAG] Use APInt::isSubsetOf/intersects to simplify some code. 2019-08-01 06:06:21 +00:00
DebugInfo Reland "[DwarfDebug] Dump call site debug info" 2019-07-31 16:51:28 +00:00
Demangle
ExecutionEngine [ORC] Suppress an ORCv1 deprecation warning. 2019-07-18 19:55:42 +00:00
FuzzMutate
Fuzzer
IR [IR] Value: add replaceUsesWithIf() utility 2019-08-01 12:32:08 +00:00
IRReader
LTO Open native file handles to avoid converting from FDs, NFC 2019-07-11 20:29:32 +00:00
LineEditor
Linker
MC Address post commit review comments on revision 366727. 2019-07-30 15:37:01 +00:00
MCA
Object [Object] Add public MaxSectionAlignment to MachOUniversal 2019-07-25 00:29:13 +00:00
ObjectYAML [yaml2obj] - Allow overriding the sh_size field. 2019-07-11 12:59:29 +00:00
Option Let unaliased Args track which Alias they were created from, and use that in Arg::getAsString() for diagnostics 2019-07-09 00:34:08 +00:00
Passes Reland the "[NewPM] Port Sancov" patch from rL365838. No functional 2019-07-25 20:53:15 +00:00
ProfileData [Profile] Support raw/indexed profiles larger than 4GB 2019-07-09 22:01:04 +00:00
Remarks Reland: [Remarks] Add an LLVM-bitstream-based remark serializer 2019-07-31 00:13:51 +00:00
Support [FileCollector] Add a VFS that records FS accesses using the FileCollector 2019-07-29 23:38:30 +00:00
TableGen
Target [RISCV] Add Custom Parser for Atomic Memory Operands 2019-08-01 12:42:31 +00:00
Testing
TextAPI Cleanup: llvm::bsearch -> llvm::partition_point after r364719 2019-06-30 11:19:56 +00:00
ToolDrivers [llvm-lib] Add a dependency to intrinsics_gen to the LLVMLibDriver build 2019-07-15 18:15:12 +00:00
Transforms [IR] Value: add replaceUsesWithIf() utility 2019-08-01 12:32:08 +00:00
WindowsManifest
XRay Open native file handles to avoid converting from FDs, NFC 2019-07-11 20:29:32 +00:00
CMakeLists.txt Fix build errors LLVM tests are disabled. 2019-07-11 22:08:35 +00:00
LLVMBuild.txt [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00