2011-04-15 21:51:11 +00:00
|
|
|
//===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===//
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
2011-07-01 21:01:15 +00:00
|
|
|
// This file implements the Mips specific subclass of TargetSubtargetInfo.
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
|
|
|
|
#include "MipsSubtarget.h"
|
|
|
|
#include "Mips.h"
|
2011-08-24 18:08:43 +00:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
2011-07-01 20:45:01 +00:00
|
|
|
|
|
|
|
#define GET_SUBTARGETINFO_TARGET_DESC
|
2011-07-08 01:53:10 +00:00
|
|
|
#define GET_SUBTARGETINFO_CTOR
|
2011-07-01 22:36:09 +00:00
|
|
|
#include "MipsGenSubtargetInfo.inc"
|
2011-07-01 20:45:01 +00:00
|
|
|
|
2007-06-06 07:42:06 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2011-06-30 01:53:36 +00:00
|
|
|
MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
|
|
|
|
const std::string &FS, bool little) :
|
2011-07-07 07:07:08 +00:00
|
|
|
MipsGenSubtargetInfo(TT, CPU, FS),
|
2011-09-09 20:45:50 +00:00
|
|
|
MipsArchVersion(Mips32), MipsABI(O32), IsLittle(little), IsSingleFloat(false),
|
2009-08-03 02:22:28 +00:00
|
|
|
IsFP64bit(false), IsGP64bit(false), HasVFPU(false), IsLinux(true),
|
|
|
|
HasSEInReg(false), HasCondMov(false), HasMulDivAdd(false), HasMinMax(false),
|
|
|
|
HasSwap(false), HasBitCount(false)
|
2007-06-06 07:42:06 +00:00
|
|
|
{
|
2011-06-30 01:53:36 +00:00
|
|
|
std::string CPUName = CPU;
|
|
|
|
if (CPUName.empty())
|
2011-09-09 01:13:27 +00:00
|
|
|
CPUName = "mips32r1";
|
2007-06-06 07:42:06 +00:00
|
|
|
|
|
|
|
// Parse features string.
|
2011-07-07 07:07:08 +00:00
|
|
|
ParseSubtargetFeatures(CPUName, FS);
|
2008-07-14 14:42:54 +00:00
|
|
|
|
2011-07-01 20:45:01 +00:00
|
|
|
// Initialize scheduling itinerary for the specified CPU.
|
|
|
|
InstrItins = getInstrItineraryForCPU(CPUName);
|
|
|
|
|
2008-07-14 14:42:54 +00:00
|
|
|
// Is the target system Linux ?
|
|
|
|
if (TT.find("linux") == std::string::npos)
|
|
|
|
IsLinux = false;
|
2007-06-06 07:42:06 +00:00
|
|
|
}
|