diff options
author | Tom Stellard <[email protected]> | 2013-01-04 15:38:37 +0000 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2013-01-04 21:05:09 +0000 |
commit | aed37cbee8efb59b2f1a6bc69adcbaecd9e4fa13 (patch) | |
tree | 5748d373dc01011b860049208135c3d942882e29 /src/gallium/drivers/radeon/AMDGPUMCInstLower.cpp | |
parent | 05c143cc049a87c515ecdc5695e5912da60cf5cb (diff) |
radeon/llvm: Remove backend code from Mesa
This code now lives in an external tree.
For the next Mesa release fetch the code from the master branch
of this LLVM repo:
http://cgit.freedesktop.org/~tstellar/llvm/
For all subsequent Mesa releases, fetch the code from the official LLVM
project:
www.llvm.org
Diffstat (limited to 'src/gallium/drivers/radeon/AMDGPUMCInstLower.cpp')
-rw-r--r-- | src/gallium/drivers/radeon/AMDGPUMCInstLower.cpp | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/gallium/drivers/radeon/AMDGPUMCInstLower.cpp b/src/gallium/drivers/radeon/AMDGPUMCInstLower.cpp deleted file mode 100644 index f3d80a39c3c..00000000000 --- a/src/gallium/drivers/radeon/AMDGPUMCInstLower.cpp +++ /dev/null @@ -1,82 +0,0 @@ -//===- AMDGPUMCInstLower.cpp - Lower AMDGPU MachineInstr to an MCInst -----===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains code to lower AMDGPU MachineInstrs to their corresponding -// MCInst. -// -//===----------------------------------------------------------------------===// -// - -#include "AMDGPUMCInstLower.h" -#include "AMDGPUAsmPrinter.h" -#include "R600InstrInfo.h" -#include "llvm/CodeGen/MachineBasicBlock.h" -#include "llvm/CodeGen/MachineInstr.h" -#include "llvm/Constants.h" -#include "llvm/MC/MCInst.h" -#include "llvm/MC/MCStreamer.h" -#include "llvm/Support/ErrorHandling.h" - -using namespace llvm; - -AMDGPUMCInstLower::AMDGPUMCInstLower() { } - -void AMDGPUMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const { - OutMI.setOpcode(MI->getOpcode()); - - for (unsigned i = 0, e = MI->getNumExplicitOperands(); i != e; ++i) { - const MachineOperand &MO = MI->getOperand(i); - - MCOperand MCOp; - switch (MO.getType()) { - default: - llvm_unreachable("unknown operand type"); - case MachineOperand::MO_FPImmediate: { - const APFloat &FloatValue = MO.getFPImm()->getValueAPF(); - assert(&FloatValue.getSemantics() == &APFloat::IEEEsingle && - "Only floating point immediates are supported at the moment."); - MCOp = MCOperand::CreateFPImm(FloatValue.convertToFloat()); - break; - } - case MachineOperand::MO_Immediate: - MCOp = MCOperand::CreateImm(MO.getImm()); - break; - case MachineOperand::MO_Register: - MCOp = MCOperand::CreateReg(MO.getReg()); - break; - } - OutMI.addOperand(MCOp); - } -} - -void AMDGPUAsmPrinter::EmitInstruction(const MachineInstr *MI) { - AMDGPUMCInstLower MCInstLowering; - - // Ignore placeholder instructions: - if (MI->getOpcode() == AMDGPU::MASK_WRITE) { - return; - } - - if (MI->isBundle()) { - const MachineBasicBlock *MBB = MI->getParent(); - MachineBasicBlock::const_instr_iterator I = MI; - ++I; - while (I != MBB->end() && I->isInsideBundle()) { - MCInst MCBundleInst; - const MachineInstr *BundledInst = I; - MCInstLowering.lower(BundledInst, MCBundleInst); - OutStreamer.EmitInstruction(MCBundleInst); - ++I; - } - } else { - MCInst TmpInst; - MCInstLowering.lower(MI, TmpInst); - OutStreamer.EmitInstruction(TmpInst); - } -} |