diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2013-10-18 13:13:53 +0000 | 
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2013-10-18 13:13:53 +0000 | 
| commit | 2c97a81e811418a39abeeac885c23f9f98cc7fcf (patch) | |
| tree | f93f28dc5cb81a7006db4736d7b1142c70f85939 /clang/lib | |
| parent | 243fbbdcfd92b623d83b508c32f2bf416ce2b9e3 (diff) | |
| download | bcm5719-llvm-2c97a81e811418a39abeeac885c23f9f98cc7fcf.tar.gz bcm5719-llvm-2c97a81e811418a39abeeac885c23f9f98cc7fcf.zip | |
[Mips] Define __mips_fpr and _MIPS_FPSET macros.
llvm-svn: 192969
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 12 | 
1 files changed, 11 insertions, 1 deletions
| diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index a17bb03c861..2f90e98a391 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -4745,6 +4745,7 @@ class MipsTargetInfoBase : public TargetInfo {      NoDSP, DSP1, DSP2    } DspRev;    bool HasMSA; +  bool HasFP64;  protected:    std::string ABI; @@ -4754,7 +4755,7 @@ public:                       const std::string &CPUStr)        : TargetInfo(Triple), CPU(CPUStr), IsMips16(false), IsMicromips(false),          IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat), -        DspRev(NoDSP), HasMSA(false), ABI(ABIStr) {} +        DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {}    virtual const char *getABI() const { return ABI.c_str(); }    virtual bool setABI(const std::string &Name) = 0; @@ -4785,6 +4786,10 @@ public:      if (IsSingleFloat)        Builder.defineMacro("__mips_single_float", Twine(1)); +    Builder.defineMacro("__mips_fpr", HasFP64 ? Twine(64) : Twine(32)); +    Builder.defineMacro("_MIPS_FPSET", +                        Twine(32 / (HasFP64 || IsSingleFloat ? 1 : 2))); +      if (IsMips16)        Builder.defineMacro("__mips16", Twine(1)); @@ -4887,6 +4892,7 @@ public:      IsSingleFloat = false;      FloatABI = HardFloat;      DspRev = NoDSP; +    HasFP64 = ABI == "n32" || ABI == "n64" || ABI == "64";      for (std::vector<std::string>::iterator it = Features.begin(),           ie = Features.end(); it != ie; ++it) { @@ -4904,6 +4910,10 @@ public:          DspRev = std::max(DspRev, DSP2);        else if (*it == "+msa")          HasMSA = true; +      else if (*it == "+fp64") +        HasFP64 = true; +      else if (*it == "-fp64") +        HasFP64 = false;        else if (*it == "+nan2008")          IsNan2008 = true;      } | 

