45 Subtarget(*TM.getSubtargetImpl()) { }
52 inline SDValue getI32Imm(
unsigned Imm) {
53 return CurDAG->getTargetConstant(Imm,
MVT::i32);
56 inline bool immMskBitp(
SDNode *inN)
const {
63 return (msksize >= 1 && msksize <= 8) ||
64 msksize == 16 || msksize == 24 || msksize == 32;
70 virtual const char *getPassName()
const {
71 return "XCore DAG->DAG Pattern Instruction Selection";
75 #include "XCoreGenDAGISel.inc"
84 return new XCoreDAGToDAGISel(TM, OptLevel);
87 bool XCoreDAGToDAGISel::SelectADDRspii(
SDValue Addr,
SDValue &Base,
90 if ((FIN = dyn_cast<FrameIndexSDNode>(Addr))) {
92 Offset = CurDAG->getTargetConstant(0,
MVT::i32);
97 if ((FIN = dyn_cast<FrameIndexSDNode>(Addr.
getOperand(0)))
114 uint64_t Val = cast<ConstantSDNode>(
N)->getZExtValue();
119 return CurDAG->getMachineNode(XCore::MKMSK_rus, dl,
126 getTargetLowering()->getPointerTy());
127 SDNode *node = CurDAG->getMachineNode(XCore::LDWCP_lru6, dl,
MVT::i32,
129 CurDAG->getEntryNode());
131 MemOp[0] = MF->getMachineMemOperand(
133 cast<MachineSDNode>(node)->setMemRefs(MemOp, MemOp + 1);
174 if (
SDNode *ResNode = SelectBRIND(N))
179 return SelectCode(N);
206 &Ops[0], Ops.
size());
216 unsigned IntNo = cast<ConstantSDNode>(Addr->
getOperand(1))->getZExtValue();
221 if (!CheckEventChainOut.use_empty()) {
237 SDValue constOne = getI32Imm(1);
240 constOne, Chain), 0);
246 return CurDAG->SelectNodeTo(N, XCore::BRFU_lu6,
MVT::Other,
249 return CurDAG->SelectNodeTo(N, XCore::BAU_1r,
MVT::Other, nextAddr, Glue);
void push_back(const T &Elt)
The memory access reads data.
static SDValue replaceInChain(SelectionDAG *CurDAG, SDValue Chain, SDValue Old, SDValue New)
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getOpcode() const
unsigned getNumOperands() const
const SDValue & getOperand(unsigned Num) const
static MachinePointerInfo getConstantPool()
enable_if_c< std::numeric_limits< T >::is_integer &&!std::numeric_limits< T >::is_signed, std::size_t >::type countLeadingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the most significant bit to the least stopping at the first 1...
Simple integer binary arithmetic operators.
SDNode * getNode() const
get the SDNode which holds the desired result
const SDValue & getOperand(unsigned i) const
FunctionPass * createXCoreISelDag(XCoreTargetMachine &TM, CodeGenOpt::Level OptLevel)
unsigned getOpcode() const
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
int64_t getSExtValue() const
bool isMask_32(uint32_t Value)
SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT)
static IntegerType * getInt32Ty(LLVMContext &C)
bool isUInt< 16 >(uint64_t x)
uint64_t getZExtValue() const