Lines Matching defs:XCore
1 //===-- XCoreInstrInfo.cpp - XCore Instruction Information ----------------===//
10 // This file contains the XCore implementation of the TargetInstrInfo class.
15 #include "XCore.h"
35 namespace XCore {
37 // XCore Condition Codes
50 : XCoreGenInstrInfo(XCore::ADJCALLSTACKDOWN, XCore::ADJCALLSTACKUP),
66 if (Opcode == XCore::LDWFI)
86 if (Opcode == XCore::STWFI)
103 return BrOpc == XCore::BRFU_u6
104 || BrOpc == XCore::BRFU_lu6
105 || BrOpc == XCore::BRBU_u6
106 || BrOpc == XCore::BRBU_lu6;
110 return BrOpc == XCore::BRFT_ru6
111 || BrOpc == XCore::BRFT_lru6
112 || BrOpc == XCore::BRBT_ru6
113 || BrOpc == XCore::BRBT_lru6;
117 return BrOpc == XCore::BRFF_ru6
118 || BrOpc == XCore::BRFF_lru6
119 || BrOpc == XCore::BRBF_ru6
120 || BrOpc == XCore::BRBF_lru6;
128 return BrOpc == XCore::BR_JT
129 || BrOpc == XCore::BR_JT32;
132 /// GetCondFromBranchOpc - Return the XCore CC that matches
134 static XCore::CondCode GetCondFromBranchOpc(unsigned BrOpc)
137 return XCore::COND_TRUE;
139 return XCore::COND_FALSE;
141 return XCore::COND_INVALID;
147 static inline unsigned GetCondBranchFromCond(XCore::CondCode CC)
151 case XCore::COND_TRUE : return XCore::BRFT_lru6;
152 case XCore::COND_FALSE : return XCore::BRFF_lru6;
158 static inline XCore::CondCode GetOppositeBranchCondition(XCore::CondCode CC)
162 case XCore::COND_TRUE : return XCore::COND_FALSE;
163 case XCore::COND_FALSE : return XCore::COND_TRUE;
213 XCore::CondCode BranchCode = GetCondFromBranchOpc(LastInst->getOpcode());
214 if (BranchCode == XCore::COND_INVALID)
234 XCore::CondCode BranchCode = GetCondFromBranchOpc(SecondLastOpc);
238 if (BranchCode != XCore::COND_INVALID
285 BuildMI(&MBB, DL, get(XCore::BRFU_lu6)).addMBB(TBB);
288 unsigned Opc = GetCondBranchFromCond((XCore::CondCode)Cond[0].getImm());
297 unsigned Opc = GetCondBranchFromCond((XCore::CondCode)Cond[0].getImm());
300 BuildMI(&MBB, DL, get(XCore::BRFU_lu6)).addMBB(FBB);
332 bool GRDest = XCore::GRRegsRegClass.contains(DestReg);
333 bool GRSrc = XCore::GRRegsRegClass.contains(SrcReg);
336 BuildMI(MBB, I, DL, get(XCore::ADD_2rus), DestReg)
342 if (GRDest && SrcReg == XCore::SP) {
343 BuildMI(MBB, I, DL, get(XCore::LDAWSP_ru6), DestReg).addImm(0);
347 if (DestReg == XCore::SP && GRSrc) {
348 BuildMI(MBB, I, DL, get(XCore::SETSP_1r))
371 BuildMI(MBB, I, DL, get(XCore::STWFI))
393 BuildMI(MBB, I, DL, get(XCore::LDWFI), DestReg)
404 "Invalid XCore branch condition!");
405 Cond[0].setImm(GetOppositeBranchCondition((XCore::CondCode)Cond[0].getImm()));
434 return BuildMI(MBB, MI, dl, get(XCore::MKMSK_rus), Reg)
439 int Opcode = isImmU6(Value) ? XCore::LDC_ru6 : XCore::LDC_lru6;
446 return BuildMI(MBB, MI, dl, get(XCore::LDWCP_lru6), Reg)