Emit banksel and movlp instructions.
Split large global data (both initialized and un-initialized) into multiple sections of <= 80 bytes.
Provide routines to manage PIC16 ABI naming conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71073 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PIC16/PIC16ISelLowering.cpp b/lib/Target/PIC16/PIC16ISelLowering.cpp
index b817d05..2e5730a 100644
--- a/lib/Target/PIC16/PIC16ISelLowering.cpp
+++ b/lib/Target/PIC16/PIC16ISelLowering.cpp
@@ -531,7 +531,7 @@
unsigned FIndex = FR->getIndex();
char *tmpName = new char [strlen(Name.c_str()) + 8];
if (FIndex < ReservedFrameCount) {
- sprintf(tmpName, "%s.frame", Name.c_str());
+ sprintf(tmpName, "%s.frame.", Name.c_str());
ES = DAG.getTargetExternalSymbol(tmpName, MVT::i8);
Offset = 0;
for (unsigned i=0; i<FIndex ; ++i) {
@@ -539,7 +539,7 @@
}
} else {
// FrameIndex has been made for some temporary storage
- sprintf(tmpName, "%s.tmp", Name.c_str());
+ sprintf(tmpName, "%s.temp.", Name.c_str());
ES = DAG.getTargetExternalSymbol(tmpName, MVT::i8);
Offset = GetTmpOffsetForFI(FIndex, MFI->getObjectSize(FIndex));
}
@@ -850,7 +850,7 @@
// Put the value on stack.
// Get a stack slot index and convert to es.
int FI = MF.getFrameInfo()->CreateStackObject(1, 1);
- sprintf(tmpName, "%s.tmp", FuncName.c_str());
+ sprintf(tmpName, "%s.temp.", FuncName.c_str());
SDValue ES = DAG.getTargetExternalSymbol(tmpName, MVT::i8);
// Store the value to ES.
@@ -1065,7 +1065,7 @@
std::string FuncName = F->getName();
char *tmpName = new char [strlen(FuncName.c_str()) + 8];
- sprintf(tmpName, "%s.frame", FuncName.c_str());
+ sprintf(tmpName, "%s.frame.", FuncName.c_str());
SDVTList VTs = DAG.getVTList (MVT::i8, MVT::Other);
SDValue ES = DAG.getTargetExternalSymbol(tmpName, MVT::i8);
SDValue BS = DAG.getConstant(1, MVT::i8);
@@ -1250,12 +1250,12 @@
// Label for argument passing
char *argFrame = new char [strlen(Name.c_str()) + 8];
- sprintf(argFrame, "%s.args", Name.c_str());
+ sprintf(argFrame, "%s.args.", Name.c_str());
ArgLabel = DAG.getTargetExternalSymbol(argFrame, MVT::i8);
// Label for reading return value
char *retName = new char [strlen(Name.c_str()) + 8];
- sprintf(retName, "%s.retval", Name.c_str());
+ sprintf(retName, "%s.ret.", Name.c_str());
RetLabel = DAG.getTargetExternalSymbol(retName, MVT::i8);
} else {
// if indirect call
@@ -1451,8 +1451,8 @@
InitReservedFrameCount(F);
// Create the <fname>.args external symbol.
- char *tmpName = new char [strlen(FuncName.c_str()) + 6];
- sprintf(tmpName, "%s.args", FuncName.c_str());
+ char *tmpName = new char [strlen(FuncName.c_str()) + 8];
+ sprintf(tmpName, "%s.args.", FuncName.c_str());
SDValue ES = DAG.getTargetExternalSymbol(tmpName, MVT::i8);
// Load arg values from the label + offset.