1 //===-- MipsTargetInfo.cpp - Mips Target Implementation -------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 #include "llvm/Module.h"
12 #include "llvm/Target/TargetRegistry.h"
15 Target llvm::TheMipsTarget;
17 static unsigned Mips_TripleMatchQuality(const std::string &TT) {
18 // We strongly match "mips*-*".
19 if (TT.size() >= 5 && std::string(TT.begin(), TT.begin()+5) == "mips-")
22 if (TT.size() >= 13 && std::string(TT.begin(),
23 TT.begin()+13) == "mipsallegrex-")
29 Target llvm::TheMipselTarget;
31 static unsigned Mipsel_TripleMatchQuality(const std::string &TT) {
32 // We strongly match "mips*el-*".
33 if (TT.size() >= 7 && std::string(TT.begin(), TT.begin()+7) == "mipsel-")
36 if (TT.size() >= 15 && std::string(TT.begin(),
37 TT.begin()+15) == "mipsallegrexel-")
40 if (TT.size() == 3 && std::string(TT.begin(), TT.begin()+3) == "psp")
46 extern "C" void LLVMInitializeMipsTargetInfo() {
47 TargetRegistry::RegisterTarget(TheMipsTarget, "mips",
49 &Mips_TripleMatchQuality);
51 TargetRegistry::RegisterTarget(TheMipselTarget, "mipsel",
53 &Mipsel_TripleMatchQuality);