[llvm-commits] [llvm] r69801 - in /llvm/trunk/lib/Target/PIC16: PIC16AsmPrinter.cpp PIC16ISelLowering.cpp PIC16InstrInfo.td
Sanjiv Gupta
sanjiv.gupta at microchip.com
Wed Apr 22 05:03:06 PDT 2009
Author: sgupta
Date: Wed Apr 22 07:02:36 2009
New Revision: 69801
URL: http://llvm.org/viewvc/llvm-project?rev=69801&view=rev
Log:
Make the function begin label start after ther data pointer.
The address of data frame for function can be obtained by subtracting 2 from the function begin label.
Modified:
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td
Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=69801&r1=69800&r2=69801&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Wed Apr 22 07:02:36 2009
@@ -116,9 +116,9 @@
SwitchToSection (fCodeSection);
// Emit the frame address of the function at the beginning of code.
- O << CurrentFnName << ":\n";
O << " retlw low(" << FunctionLabelBegin<< CurrentFnName << ".frame)\n";
O << " retlw high(" << FunctionLabelBegin<< CurrentFnName << ".frame)\n";
+ O << CurrentFnName << ":\n";
// Print out code for the function.
Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=69801&r1=69800&r2=69801&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Wed Apr 22 07:02:36 2009
@@ -1155,10 +1155,12 @@
SDValue Lo = Callee.getOperand(0);
SDValue Hi = Callee.getOperand(1);
+ SDValue Data_Lo, Data_Hi;
SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Other, MVT::Flag);
Hi = DAG.getNode(PIC16ISD::MTPCLATH, dl, MVT::i8, Hi);
- // Use the Lo part as is and make CALLW
- Callee = DAG.getNode(PIC16ISD::PIC16Connect, dl, MVT::i8, Lo, Hi);
+ // Subtract 2 from Lo to get the Lower part of DataAddress.
+ Data_Lo = DAG.getNode(ISD::SUB, dl, MVT::i8, Lo, DAG.getConstant(2, MVT::i8));
+ Callee = DAG.getNode(PIC16ISD::PIC16Connect, dl, MVT::i8, Data_Lo, Hi);
SDValue Call = DAG.getNode(PIC16ISD::CALLW, dl, Tys, Chain, Callee,
OperFlag);
Chain = getChain(Call);
@@ -1176,10 +1178,10 @@
Chain = getChain(SeqStart);
OperFlag = getOutFlag(SeqStart); // To manage the data dependency
- // Add 1 to Lo part for the second code word.
- Lo = DAG.getNode(ISD::ADD, dl, MVT::i8, Lo, DAG.getConstant(1, MVT::i8));
+ // Subtract 1 to Lo part for the second code word.
+ Data_Lo = DAG.getNode(ISD::SUB, dl, MVT::i8, Lo, DAG.getConstant(1, MVT::i8));
// Use new Lo to make another CALLW
- Callee = DAG.getNode(PIC16ISD::PIC16Connect, dl, MVT::i8, Lo, Hi);
+ Callee = DAG.getNode(PIC16ISD::PIC16Connect, dl, MVT::i8, Data_Lo, Hi);
Call = DAG.getNode(PIC16ISD::CALLW, dl, Tys, Chain, Callee, OperFlag);
Chain = getChain(Call);
OperFlag = getOutFlag(Call);
@@ -1266,8 +1268,8 @@
SDValue CodeAddr_Lo = Callee.getOperand(0);
SDValue CodeAddr_Hi = Callee.getOperand(1);
- CodeAddr_Lo = DAG.getNode(ISD::ADD, dl, MVT::i8, CodeAddr_Lo,
- DAG.getConstant(2, MVT::i8));
+ /*CodeAddr_Lo = DAG.getNode(ISD::ADD, dl, MVT::i8, CodeAddr_Lo,
+ DAG.getConstant(2, MVT::i8));*/
// move Hi part in PCLATH
CodeAddr_Hi = DAG.getNode(PIC16ISD::MTPCLATH, dl, MVT::i8, CodeAddr_Hi);
Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td?rev=69801&r1=69800&r2=69801&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Wed Apr 22 07:02:36 2009
@@ -428,7 +428,8 @@
let isCall = 1,
Defs = [W, FSR0, FSR1] in {
def CALL: LiteralFormat<0x1, (outs), (ins i8imm:$func),
- "call ${func} + 2",
+ //"call ${func} + 2",
+ "call ${func}",
[(PIC16call diraddr:$func)]>;
}
More information about the llvm-commits
mailing list