summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2015-04-08 01:09:26 +0000
committerTom Stellard <thomas.stellard@amd.com>2015-04-08 01:09:26 +0000
commitd7e6f13671e4f36c038b1a671697196b7b72db27 (patch)
treece98987f91ccc8f725970f2ba6e3d3b696b28708 /llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
parent8980dc323bfeabb8a2179611e3a8d57f457c556f (diff)
downloadbcm5719-llvm-d7e6f13671e4f36c038b1a671697196b7b72db27.tar.gz
bcm5719-llvm-d7e6f13671e4f36c038b1a671697196b7b72db27.zip
R600/SI: Initial support for assembler and inline assembly
This is currently considered experimental, but most of the more commonly used instructions should work. So far only SI has been extensively tested, CI and VI probably work too, but may be buggy. The current set of tests cases do not give complete coverage, but I think it is sufficient for an experimental assembler. See the documentation in R600Usage for more information. llvm-svn: 234381
Diffstat (limited to 'llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
index d9110146ac0..b3480b4b78c 100644
--- a/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
+++ b/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
@@ -17,6 +17,7 @@
//
#include "AMDGPUAsmPrinter.h"
+#include "InstPrinter/AMDGPUInstPrinter.h"
#include "AMDGPU.h"
#include "AMDKernelCodeT.h"
#include "AMDGPUSubtarget.h"
@@ -574,3 +575,24 @@ void AMDGPUAsmPrinter::EmitAmdKernelCodeT(const MachineFunction &MF,
OutStreamer.EmitBytes(StringRef((char*)&header, sizeof(header)));
}
+
+bool AMDGPUAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
+ unsigned AsmVariant,
+ const char *ExtraCode, raw_ostream &O) {
+ if (ExtraCode && ExtraCode[0]) {
+ if (ExtraCode[1] != 0)
+ return true; // Unknown modifier.
+
+ switch (ExtraCode[0]) {
+ default:
+ // See if this is a generic print operand
+ return AsmPrinter::PrintAsmOperand(MI, OpNo, AsmVariant, ExtraCode, O);
+ case 'r':
+ break;
+ }
+ }
+
+ AMDGPUInstPrinter::printRegOperand(MI->getOperand(OpNo).getReg(), O,
+ *TM.getSubtargetImpl(*MF->getFunction())->getRegisterInfo());
+ return false;
+}
OpenPOWER on IntegriCloud