diff options
author | Alex Bradbury <asb@lowrisc.org> | 2017-12-12 15:46:15 +0000 |
---|---|---|
committer | Alex Bradbury <asb@lowrisc.org> | 2017-12-12 15:46:15 +0000 |
commit | 9ed84c8ae85a6274afc8c266dc662bd9e5a9fa21 (patch) | |
tree | 699a549f9b59a4b242837a1b9d75d67db4c911c7 /llvm/lib/Target/RISCV/InstPrinter/RISCVInstPrinter.cpp | |
parent | 4c1394d67d77b63c73e3ebeae1f123e4ac35dbef (diff) | |
download | bcm5719-llvm-9ed84c8ae85a6274afc8c266dc662bd9e5a9fa21.tar.gz bcm5719-llvm-9ed84c8ae85a6274afc8c266dc662bd9e5a9fa21.zip |
[RISCV] Implement assembler pseudo instructions for RV32I and RV64I
Adds the assembler pseudo instructions of RV32I and RV64I which can
be mapped to a single canonical instruction. The missing pseudo
instructions (e.g., call, tail, ...) are marked as TODO. Other
things, like for example PCREL_LO, have to be implemented first.
Currently, alias emission is disabled by default to keep the patch
minimal. Alias emission by default will be enabled in a subsequent
patch which also updates all affected tests. Note that this patch
should actually break the floating point MC tests. However, the
used FileCheck configuration is not tight enought to detect the
breakage.
Differential Revision: https://reviews.llvm.org/D40902
Patch by Mario Werner.
llvm-svn: 320487
Diffstat (limited to 'llvm/lib/Target/RISCV/InstPrinter/RISCVInstPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/InstPrinter/RISCVInstPrinter.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Target/RISCV/InstPrinter/RISCVInstPrinter.cpp b/llvm/lib/Target/RISCV/InstPrinter/RISCVInstPrinter.cpp index a396025ccc4..d21c48ec65a 100644 --- a/llvm/lib/Target/RISCV/InstPrinter/RISCVInstPrinter.cpp +++ b/llvm/lib/Target/RISCV/InstPrinter/RISCVInstPrinter.cpp @@ -18,6 +18,7 @@ #include "llvm/MC/MCInst.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSymbol.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" using namespace llvm; @@ -28,9 +29,17 @@ using namespace llvm; #define PRINT_ALIAS_INSTR #include "RISCVGenAsmWriter.inc" +// Alias instruction emission is disabled by default. A subsequent patch will +// change this default and fix all affected tests. +static cl::opt<bool> +NoAliases("riscv-no-aliases", + cl::desc("Disable the emission of assembler pseudo instructions"), + cl::init(true), + cl::Hidden); + void RISCVInstPrinter::printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) { - if (!printAliasInstr(MI, O)) + if (NoAliases || !printAliasInstr(MI, O)) printInstruction(MI, O); printAnnotation(O, Annot); } |