2009-07-25 06:49:55 +00:00
|
|
|
//===-- SystemZTargetMachine.cpp - Define TargetMachine for SystemZ -------===//
|
2009-07-16 13:27:25 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-08-22 20:48:53 +00:00
|
|
|
#include "SystemZMCAsmInfo.h"
|
2009-07-16 13:27:25 +00:00
|
|
|
#include "SystemZTargetMachine.h"
|
|
|
|
#include "SystemZ.h"
|
|
|
|
#include "llvm/PassManager.h"
|
2009-07-25 06:49:55 +00:00
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
2009-07-16 13:27:25 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2009-07-16 14:36:52 +00:00
|
|
|
extern "C" void LLVMInitializeSystemZTarget() {
|
2009-07-25 06:49:55 +00:00
|
|
|
// Register the target.
|
|
|
|
RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
|
2009-08-22 20:48:53 +00:00
|
|
|
RegisterAsmInfo<SystemZMCAsmInfo> Y(TheSystemZTarget);
|
2009-07-16 13:27:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// SystemZTargetMachine ctor - Create an ILP64 architecture model
|
|
|
|
///
|
2009-07-16 14:36:52 +00:00
|
|
|
SystemZTargetMachine::SystemZTargetMachine(const Target &T,
|
2009-08-02 23:37:13 +00:00
|
|
|
const std::string &TT,
|
2009-07-16 14:36:52 +00:00
|
|
|
const std::string &FS)
|
2009-08-11 20:42:37 +00:00
|
|
|
: LLVMTargetMachine(T, TT),
|
2009-08-02 23:37:13 +00:00
|
|
|
Subtarget(TT, FS),
|
2009-07-16 14:36:52 +00:00
|
|
|
DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
|
2009-11-07 19:07:32 +00:00
|
|
|
"-f64:64:64-f128:128:128-a0:16:16-n32:64"),
|
2010-05-11 17:31:57 +00:00
|
|
|
InstrInfo(*this), TLInfo(*this), TSInfo(*this),
|
2009-07-16 13:49:25 +00:00
|
|
|
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -160) {
|
2009-07-16 14:16:05 +00:00
|
|
|
|
|
|
|
if (getRelocationModel() == Reloc::Default)
|
|
|
|
setRelocationModel(Reloc::Static);
|
2009-07-16 13:27:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel) {
|
|
|
|
// Install an instruction selector.
|
|
|
|
PM.add(createSystemZISelDag(*this, OptLevel));
|
|
|
|
return false;
|
|
|
|
}
|