aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-12-19 08:26:25 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-12-19 08:26:25 +0000
commit08bd440bcad8783ae353c76075a530c0054741eb (patch)
treea6a6376e88e063d9a705345432be6ee13925a3f9
parentcabdd7425d30f7eb659ecb0cc5efbc4052dd78a8 (diff)
1. In indirect load/store insns , the name of fsr should be emitted as INDF.
2. include standard asmbly headers in generated asmbly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91768 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
index e1f2587658..87f5aad02a 100644
--- a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
+++ b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
@@ -170,7 +170,16 @@ void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
switch (MO.getType()) {
case MachineOperand::MO_Register:
- O << getRegisterName(MO.getReg());
+ {
+ // For indirect load/store insns, the fsr name is printed as INDF.
+ std::string RegName = getRegisterName(MO.getReg());
+ if ((MI->getOpcode() == PIC16::load_indirect) ||
+ (MI->getOpcode() == PIC16::store_indirect))
+ {
+ RegName.replace (0, 3, "INDF");
+ }
+ O << RegName;
+ }
return;
case MachineOperand::MO_Immediate:
@@ -263,10 +272,9 @@ void PIC16AsmPrinter::printLibcallDecls() {
bool PIC16AsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
- // FIXME:: This is temporary solution to generate the include file.
- // The processor should be passed to llc as in input and the header file
- // should be generated accordingly.
- O << "\n\t#include P16F1937.INC\n";
+ // Every asmbly contains these std headers.
+ O << "\n#include p16f1xxx.inc";
+ O << "\n#include stdmacros.inc";
// Set the section names for all globals.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();