1 //===-- ARMFeatures.h - Checks for ARM instruction features ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the code shared between ARM CodeGen and ARM MC
12 //===----------------------------------------------------------------------===//
14 #ifndef TARGET_ARM_FEATURES_H
15 #define TARGET_ARM_FEATURES_H
21 template<typename InstrType> // could be MachineInstr or MCInst
22 inline bool isV8EligibleForIT(InstrType *Instr, int BLXOperandIndex = 0) {
23 switch (Instr->getOpcode()) {
71 // there are some "conditionally deprecated" opcodes
73 return Instr->getOperand(2).getReg() != ARM::PC;
74 // ADD PC, SP and BLX PC were always unpredictable,
75 // now on top of it they're deprecated
78 return Instr->getOperand(0).getReg() != ARM::PC;
80 return Instr->getOperand(BLXOperandIndex).getReg() != ARM::PC;
82 return Instr->getOperand(0).getReg() != ARM::PC &&
83 Instr->getOperand(2).getReg() != ARM::PC;
86 return Instr->getOperand(0).getReg() != ARM::PC &&
87 Instr->getOperand(1).getReg() != ARM::PC;