diff options
| author | Duraid Madina <duraid@octopus.com.au> | 2005-03-17 18:17:03 +0000 |
|---|---|---|
| committer | Duraid Madina <duraid@octopus.com.au> | 2005-03-17 18:17:03 +0000 |
| commit | 91ed0a11cf97abb68d44d70cc66de47678c4211d (patch) | |
| tree | 94b7214cdcd7f0ab9e1341e3911da35f5ba43b0e /llvm/lib/Target/IA64/IA64InstrInfo.cpp | |
| parent | 43832b049e0e1f04c47bab50d3864aa61b1d626a (diff) | |
| download | bcm5719-llvm-91ed0a11cf97abb68d44d70cc66de47678c4211d.tar.gz bcm5719-llvm-91ed0a11cf97abb68d44d70cc66de47678c4211d.zip | |
and so it begins...
PHASE 1: write instruction selector
PHASE 2: ???
PHASE 3: profit!
llvm-svn: 20652
Diffstat (limited to 'llvm/lib/Target/IA64/IA64InstrInfo.cpp')
| -rw-r--r-- | llvm/lib/Target/IA64/IA64InstrInfo.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/llvm/lib/Target/IA64/IA64InstrInfo.cpp b/llvm/lib/Target/IA64/IA64InstrInfo.cpp new file mode 100644 index 00000000000..04662baf2ce --- /dev/null +++ b/llvm/lib/Target/IA64/IA64InstrInfo.cpp @@ -0,0 +1,47 @@ +//===- IA64InstrInfo.cpp - IA64 Instruction Information -----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by the LLVM research group and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the IA64 implementation of the TargetInstrInfo class. +// +//===----------------------------------------------------------------------===// + +#include "IA64InstrInfo.h" +#include "IA64.h" +#include "IA64InstrBuilder.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "IA64GenInstrInfo.inc" +using namespace llvm; + +IA64InstrInfo::IA64InstrInfo() + : TargetInstrInfo(IA64Insts, sizeof(IA64Insts)/sizeof(IA64Insts[0])) { +} + + +bool IA64InstrInfo::isMoveInstr(const MachineInstr& MI, + unsigned& sourceReg, + unsigned& destReg) const { + MachineOpCode oc = MI.getOpcode(); + if (oc == IA64::MOV || oc == IA64::FMOV) { + assert(MI.getNumOperands() == 2 && + /* MI.getOperand(0).isRegister() && + MI.getOperand(1).isRegister() && */ + "invalid register-register move instruction"); + if( MI.getOperand(0).isRegister() && + MI.getOperand(1).isRegister() ) { + // if both operands of the MOV/FMOV are registers, then + // yes, this is a move instruction + sourceReg = MI.getOperand(1).getReg(); + destReg = MI.getOperand(0).getReg(); + return true; + } + } + return false; // we don't consider e.g. %regN = MOV <FrameIndex #x> a + // move instruction +} + |

