[llvm-commits] [llvm] r67373 - /llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
Sanjiv Gupta
sanjiv.gupta at microchip.com
Fri Mar 20 07:10:21 PDT 2009
Author: sgupta
Date: Fri Mar 20 09:10:20 2009
New Revision: 67373
URL: http://llvm.org/viewvc/llvm-project?rev=67373&view=rev
Log:
Fixed comment for libcalls.
Modified:
llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=67373&r1=67372&r2=67373&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Fri Mar 20 09:10:20 2009
@@ -191,18 +191,21 @@
return MVT::i8;
}
-/// FIXME: These three functions below should not be here if we change
-/// the generic code to allow generting libcalls for I8 types as well.
+/// The type legalizer framework of generating legalizer can generate libcalls
+/// only when the operand/result types are illegal.
+/// PIC16 needs to generate libcalls even for the legal types (i8) for some ops.
+/// For example an arithmetic right shift. These functions are used to lower
+/// such operations that generate libcall for legal types.
void
PIC16TargetLowering::setPIC16LibcallName(PIC16ISD::PIC16Libcall Call,
const char *Name) {
- PIC16LibcallNames[Call] = Name;
+ PIC16LibcallNames[Call] = Name;
}
const char *
PIC16TargetLowering::getPIC16LibcallName(PIC16ISD::PIC16Libcall Call) {
- return PIC16LibcallNames[Call];
+ return PIC16LibcallNames[Call];
}
SDValue
@@ -211,23 +214,23 @@
unsigned NumOps, bool isSigned,
SelectionDAG &DAG, DebugLoc dl) {
- TargetLowering::ArgListTy Args;
- Args.reserve(NumOps);
+ TargetLowering::ArgListTy Args;
+ Args.reserve(NumOps);
- TargetLowering::ArgListEntry Entry;
- for (unsigned i = 0; i != NumOps; ++i) {
- Entry.Node = Ops[i];
- Entry.Ty = Entry.Node.getValueType().getTypeForMVT();
- Entry.isSExt = isSigned;
- Entry.isZExt = !isSigned;
- Args.push_back(Entry);
- }
- SDValue Callee = DAG.getExternalSymbol(getPIC16LibcallName(Call), MVT::i8);
+ TargetLowering::ArgListEntry Entry;
+ for (unsigned i = 0; i != NumOps; ++i) {
+ Entry.Node = Ops[i];
+ Entry.Ty = Entry.Node.getValueType().getTypeForMVT();
+ Entry.isSExt = isSigned;
+ Entry.isZExt = !isSigned;
+ Args.push_back(Entry);
+ }
+ SDValue Callee = DAG.getExternalSymbol(getPIC16LibcallName(Call), MVT::i8);
- const Type *RetTy = RetVT.getTypeForMVT();
- std::pair<SDValue,SDValue> CallInfo =
+ const Type *RetTy = RetVT.getTypeForMVT();
+ std::pair<SDValue,SDValue> CallInfo =
LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false,
- false, CallingConv::C, false, Callee, Args, DAG, dl);
+ false, CallingConv::C, false, Callee, Args, DAG, dl);
return CallInfo.first;
}
More information about the llvm-commits
mailing list