2009-07-15 06:35:19 +00:00
|
|
|
//===-- PowerPCTargetInfo.cpp - PowerPC Target Implementation -------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-18 23:03:22 +00:00
|
|
|
#include "PPC.h"
|
2009-07-15 06:35:19 +00:00
|
|
|
#include "llvm/Module.h"
|
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
|
|
|
using namespace llvm;
|
|
|
|
|
2009-07-18 23:03:22 +00:00
|
|
|
Target llvm::ThePPC32Target;
|
2009-07-15 06:35:19 +00:00
|
|
|
|
|
|
|
static unsigned PPC32_TripleMatchQuality(const std::string &TT) {
|
|
|
|
// We strongly match "powerpc-*".
|
|
|
|
if (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "powerpc-")
|
|
|
|
return 20;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-07-18 23:03:22 +00:00
|
|
|
Target llvm::ThePPC64Target;
|
2009-07-15 06:35:19 +00:00
|
|
|
|
|
|
|
static unsigned PPC64_TripleMatchQuality(const std::string &TT) {
|
|
|
|
// We strongly match "powerpc64-*".
|
|
|
|
if (TT.size() >= 10 && std::string(TT.begin(), TT.begin()+10) == "powerpc64-")
|
|
|
|
return 20;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void LLVMInitializePowerPCTargetInfo() {
|
|
|
|
TargetRegistry::RegisterTarget(ThePPC32Target, "ppc32",
|
|
|
|
"PowerPC 32",
|
|
|
|
&PPC32_TripleMatchQuality,
|
2009-07-25 10:09:50 +00:00
|
|
|
/*HasJIT=*/true);
|
2009-07-15 06:35:19 +00:00
|
|
|
|
|
|
|
TargetRegistry::RegisterTarget(ThePPC64Target, "ppc64",
|
|
|
|
"PowerPC 64",
|
|
|
|
&PPC64_TripleMatchQuality,
|
2009-07-25 10:09:50 +00:00
|
|
|
/*HasJIT=*/true);
|
2009-07-15 06:35:19 +00:00
|
|
|
}
|