1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Fix a build breaker.

llvm-svn: 28574
This commit is contained in:
Evan Cheng 2006-05-30 21:45:53 +00:00
parent 66bfb1dc9a
commit bdb6af8e7d
4 changed files with 20 additions and 16 deletions

View File

@ -13,13 +13,16 @@
#include "X86InstrInfo.h"
#include "X86.h"
#include "X86InstrBuilder.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "X86GenInstrInfo.inc"
#include "X86InstrBuilder.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
using namespace llvm;
X86InstrInfo::X86InstrInfo()
: TargetInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0])) {
X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
: TargetInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0])),
TM(tm) {
}
@ -122,13 +125,12 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr *MI) const {
case X86::SHUFPSrri: {
assert(MI->getNumOperands() == 4 && "Unknown shufps instruction!");
const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
if (Subtarget->hasSSE2()) {
unsigned A = MI->getOperand(0).getReg();
unsigned B = MI->getOperand(1).getReg();
unsigned C = MI->getOperand(2).getReg();
unsigned M = MI->getOperand(3).getImmedValue();
return BuildMI(X86::PSHUFDri, 2, A).addReg(B).addImm(M);
}
if (!Subtarget->hasSSE2()) return 0;
unsigned A = MI->getOperand(0).getReg();
unsigned B = MI->getOperand(1).getReg();
unsigned C = MI->getOperand(2).getReg();
unsigned M = MI->getOperand(3).getImmedValue();
return BuildMI(X86::PSHUFDri, 2, A).addReg(B).addImm(M);
}
}

View File

@ -18,6 +18,7 @@
#include "X86RegisterInfo.h"
namespace llvm {
class X86TargetMachine;
/// X86II - This namespace holds all of the target specific flags that
/// instruction info tracks.
@ -168,9 +169,10 @@ namespace X86II {
}
class X86InstrInfo : public TargetInstrInfo {
X86TargetMachine &TM;
const X86RegisterInfo RI;
public:
X86InstrInfo();
X86InstrInfo(X86TargetMachine &tm);
/// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
/// such, whenever a client has an instance of instruction info, it should

View File

@ -69,11 +69,11 @@ unsigned X86TargetMachine::getModuleMatchQuality(const Module &M) {
///
X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS)
: TargetMachine("X86"),
DataLayout(std::string("X86"), std::string("e-p:32:32-d:32-l:32")),
Subtarget(M, FS),
DataLayout(std::string("X86"), std::string("e-p:32:32-d:32-l:32")),
FrameInfo(TargetFrameInfo::StackGrowsDown,
Subtarget.getStackAlignment(), -4),
JITInfo(*this), TLInfo(*this) {
InstrInfo(*this), JITInfo(*this), TLInfo(*this) {
if (getRelocationModel() == Reloc::Default)
if (Subtarget.isTargetDarwin())
setRelocationModel(Reloc::DynamicNoPIC);

View File

@ -27,10 +27,10 @@
namespace llvm {
class X86TargetMachine : public TargetMachine {
const TargetData DataLayout; // Calculates type size & alignment
X86InstrInfo InstrInfo;
X86Subtarget Subtarget;
const TargetData DataLayout; // Calculates type size & alignment
TargetFrameInfo FrameInfo;
X86InstrInfo InstrInfo;
X86JITInfo JITInfo;
X86TargetLowering TLInfo;
public: