Some more implementation towards my first successful compile of a simple function.

This commit is contained in:
Jeremy Rand 2015-08-06 00:20:12 -04:00
parent 2e2ecfb186
commit 5d8601e987
3 changed files with 5 additions and 23 deletions

View File

@ -167,9 +167,7 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
#endif
SDNode *WDC65816DAGToDAGISel::Select(SDNode *N) {
WDC_LOG("WDC_TODO - Unimplemented method called");
return NULL;
#if 0 // WDC_TODO - we will definitely need something here
WDC_LOG("WDC_TODO - Unimplemented method called, opcode=%s", N->getOperationName().c_str());
SDLoc dl(N);
if (N->isMachineOpcode()) {
N->setNodeId(-1);
@ -178,6 +176,8 @@ SDNode *WDC65816DAGToDAGISel::Select(SDNode *N) {
switch (N->getOpcode()) {
default: break;
#if 0 // WDC_TODO - Do I need any of this
case SPISD::GLOBAL_BASE_REG:
return getGlobalBaseReg();
@ -217,10 +217,10 @@ SDNode *WDC65816DAGToDAGISel::Select(SDNode *N) {
// The high part is in the Y register.
return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDValue(Mul, 1));
}
#endif
}
return SelectCode(N);
#endif
}

View File

@ -46,8 +46,6 @@ SDValue WDC65816TargetLowering::LowerFormalArguments(SDValue Chain,
SelectionDAG &DAG,
SmallVectorImpl<SDValue> &InVals) const {
MachineFunction &MF = DAG.getMachineFunction();
MachineRegisterInfo &RegInfo = MF.getRegInfo();
WDC65816MachineFunctionInfo *FuncInfo = MF.getInfo<WDC65816MachineFunctionInfo>();
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
@ -130,7 +128,6 @@ WDC65816TargetLowering::LowerReturn(SDValue Chain,
RetOps.push_back(DAG.getRegister(VA.getLocReg(), VA.getLocVT()));
}
// If the function returns a struct, copy the SRetReturnReg to I0
if (MF.getFunction()->hasStructRetAttr()) {
WDC_LOG("WDC_TODO - Need to implement hasStructRetAttr() case");
}
@ -145,19 +142,6 @@ WDC65816TargetLowering::LowerReturn(SDValue Chain,
&RetOps[0], RetOps.size());
}
#if 0 // WDC_TODO - Get rid of this?
// The calling conventions in WDC65816CallingConv.td are described in terms of the
// callee's register window. This function translates registers to the
// corresponding caller window %o register.
static unsigned toCallerWindow(unsigned Reg) {
assert(SP::I0 + 7 == SP::I7 && SP::O0 + 7 == SP::O7 && "Unexpected enum");
if (Reg >= SP::I0 && Reg <= SP::I7)
return Reg - SP::I0 + SP::O0;
return Reg;
}
#endif
#if 0 // WDC_TODO - Disable more stuff

View File

@ -19,11 +19,10 @@
#include "llvm/Target/TargetLowering.h"
namespace llvm {
class WDC65816Subtarget;
namespace WDCISD {
enum {
FIRST_NUMBER = ISD::BUILTIN_OP_END,
RET_FLAG, // Return with a flag operand.
RET_FLAG // Return with a flag operand.
#if 0
CMPICC, // Compare two GPR operands, set icc+xcc.
CMPFCC, // Compare two FP operands, set fcc.
@ -53,7 +52,6 @@ namespace llvm {
}
class WDC65816TargetLowering : public TargetLowering {
const WDC65816Subtarget *Subtarget;
public:
WDC65816TargetLowering(TargetMachine &TM);