diff options
| author | Alex Bradbury <asb@lowrisc.org> | 2018-05-17 05:58:08 +0000 |
|---|---|---|
| committer | Alex Bradbury <asb@lowrisc.org> | 2018-05-17 05:58:08 +0000 |
| commit | cea6db0480b4d9675c81f52a6ea3643994f4865e (patch) | |
| tree | e26447fbb5ff6a8ae0241083eb4257808d3f3311 /llvm/lib/Target/RISCV/AsmParser | |
| parent | a2c526471850ad789930ab6aa631c307fab2e11a (diff) | |
| download | bcm5719-llvm-cea6db0480b4d9675c81f52a6ea3643994f4865e.tar.gz bcm5719-llvm-cea6db0480b4d9675c81f52a6ea3643994f4865e.zip | |
[RISCV] Add support for .half, .hword, .word, .dword directives
These directives are recognised by gas. Support is added through the use of
addAliasForDirective.
Also match RISC-V gcc in preferring .half and .word for 16-bit and 32-bit data
directives.
llvm-svn: 332574
Diffstat (limited to 'llvm/lib/Target/RISCV/AsmParser')
| -rw-r--r-- | llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp index 487eea14b16..c51e4b3c606 100644 --- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp +++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp @@ -105,6 +105,10 @@ public: RISCVAsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser, const MCInstrInfo &MII, const MCTargetOptions &Options) : MCTargetAsmParser(Options, STI, MII) { + Parser.addAliasForDirective(".half", ".2byte"); + Parser.addAliasForDirective(".hword", ".2byte"); + Parser.addAliasForDirective(".word", ".4byte"); + Parser.addAliasForDirective(".dword", ".8byte"); setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits())); } }; |

