1 //===- ARMInstrInfo.cpp - ARM Instruction Information -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the "Instituto Nokia de Tecnologia" and
6 // is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 // This file contains the ARM implementation of the TargetInstrInfo class.
13 //===----------------------------------------------------------------------===//
15 #include "ARMInstrInfo.h"
17 #include "llvm/CodeGen/MachineInstrBuilder.h"
18 #include "ARMGenInstrInfo.inc"
21 ARMInstrInfo::ARMInstrInfo()
22 : TargetInstrInfo(ARMInsts, sizeof(ARMInsts)/sizeof(ARMInsts[0])) {
25 /// Return true if the instruction is a register to register move and
26 /// leave the source and dest operands in the passed parameters.
28 bool ARMInstrInfo::isMoveInstr(const MachineInstr &MI,
29 unsigned &SrcReg, unsigned &DstReg) const {
30 MachineOpCode oc = MI.getOpcode();
35 assert(MI.getNumOperands() == 2 &&
36 MI.getOperand(0).isRegister() &&
37 MI.getOperand(1).isRegister() &&
38 "Invalid ARM MOV instruction");
39 SrcReg = MI.getOperand(1).getReg();;
40 DstReg = MI.getOperand(0).getReg();;