opnsense-src/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp

62 lines
1.6 KiB
C++
Raw Normal View History

2009-06-02 13:52:33 -04:00
//===- ARMInstrInfo.cpp - ARM Instruction Information -----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the ARM implementation of the TargetInstrInfo class.
//
//===----------------------------------------------------------------------===//
#include "ARMInstrInfo.h"
#include "ARM.h"
#include "ARMAddressingModes.h"
#include "ARMGenInstrInfo.inc"
#include "ARMMachineFunctionInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
2009-10-14 13:57:32 -04:00
#include "llvm/MC/MCAsmInfo.h"
2009-06-02 13:52:33 -04:00
using namespace llvm;
2009-06-27 06:44:33 -04:00
ARMInstrInfo::ARMInstrInfo(const ARMSubtarget &STI)
2009-11-04 09:58:56 -05:00
: ARMBaseInstrInfo(STI), RI(*this, STI) {
2009-06-27 06:44:33 -04:00
}
2009-06-02 13:52:33 -04:00
2009-10-14 13:57:32 -04:00
unsigned ARMInstrInfo::getUnindexedOpcode(unsigned Opc) const {
2009-06-02 13:52:33 -04:00
switch (Opc) {
default: break;
case ARM::LDR_PRE:
case ARM::LDR_POST:
return ARM::LDRi12;
2009-06-02 13:52:33 -04:00
case ARM::LDRH_PRE:
case ARM::LDRH_POST:
return ARM::LDRH;
case ARM::LDRB_PRE:
case ARM::LDRB_POST:
return ARM::LDRBi12;
2009-06-02 13:52:33 -04:00
case ARM::LDRSH_PRE:
case ARM::LDRSH_POST:
return ARM::LDRSH;
case ARM::LDRSB_PRE:
case ARM::LDRSB_POST:
return ARM::LDRSB;
case ARM::STR_PRE:
case ARM::STR_POST:
return ARM::STRi12;
2009-06-02 13:52:33 -04:00
case ARM::STRH_PRE:
case ARM::STRH_POST:
return ARM::STRH;
case ARM::STRB_PRE:
case ARM::STRB_POST:
return ARM::STRBi12;
2009-06-02 13:52:33 -04:00
}
2009-06-27 06:44:33 -04:00
2009-10-14 13:57:32 -04:00
return 0;
2009-06-02 13:52:33 -04:00
}