| OLD | NEW |
| 1 //===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===// | 1 //===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file implements the Mips specific subclass of TargetSubtargetInfo. | 10 // This file implements the Mips specific subclass of TargetSubtargetInfo. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 using namespace llvm; | 22 using namespace llvm; |
| 23 | 23 |
| 24 MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU, | 24 MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU, |
| 25 const std::string &FS, bool little) : | 25 const std::string &FS, bool little) : |
| 26 MipsGenSubtargetInfo(TT, CPU, FS), | 26 MipsGenSubtargetInfo(TT, CPU, FS), |
| 27 MipsArchVersion(Mips32), MipsABI(UnknownABI), IsLittle(little), | 27 MipsArchVersion(Mips32), MipsABI(UnknownABI), IsLittle(little), |
| 28 IsSingleFloat(false), IsFP64bit(false), IsGP64bit(false), HasVFPU(false), | 28 IsSingleFloat(false), IsFP64bit(false), IsGP64bit(false), HasVFPU(false), |
| 29 IsLinux(true), HasSEInReg(false), HasCondMov(false), HasMulDivAdd(false), | 29 IsLinux(true), HasSEInReg(false), HasCondMov(false), HasMulDivAdd(false), |
| 30 HasMinMax(false), HasSwap(false), HasBitCount(false) | 30 HasMinMax(false), HasSwap(false), HasBitCount(false) |
| 31 // @LOCALMOD-START |
| 32 , TargetTriple(TT) |
| 33 // @LOCALMOD-END |
| 31 { | 34 { |
| 32 std::string CPUName = CPU; | 35 std::string CPUName = CPU; |
| 33 if (CPUName.empty()) | 36 if (CPUName.empty()) |
| 34 CPUName = "mips32r1"; | 37 CPUName = "mips32r1"; |
| 35 | 38 |
| 36 // Parse features string. | 39 // Parse features string. |
| 37 ParseSubtargetFeatures(CPUName, FS); | 40 ParseSubtargetFeatures(CPUName, FS); |
| 38 | 41 |
| 39 // Initialize scheduling itinerary for the specified CPU. | 42 // Initialize scheduling itinerary for the specified CPU. |
| 40 InstrItins = getInstrItineraryForCPU(CPUName); | 43 InstrItins = getInstrItineraryForCPU(CPUName); |
| 41 | 44 |
| 42 // Set MipsABI if it hasn't been set yet. | 45 // Set MipsABI if it hasn't been set yet. |
| 43 if (MipsABI == UnknownABI) | 46 if (MipsABI == UnknownABI) |
| 44 MipsABI = hasMips64() ? N64 : O32; | 47 MipsABI = hasMips64() ? N64 : O32; |
| 45 | 48 |
| 46 // Check if Architecture and ABI are compatible. | 49 // Check if Architecture and ABI are compatible. |
| 47 assert(((!hasMips64() && (isABI_O32() || isABI_EABI())) || | 50 assert(((!hasMips64() && (isABI_O32() || isABI_EABI())) || |
| 48 (hasMips64() && (isABI_N32() || isABI_N64()))) && | 51 (hasMips64() && (isABI_N32() || isABI_N64()))) && |
| 49 "Invalid Arch & ABI pair."); | 52 "Invalid Arch & ABI pair."); |
| 50 | 53 |
| 51 // Is the target system Linux ? | 54 // Is the target system Linux ? |
| 52 if (TT.find("linux") == std::string::npos) | 55 if (TT.find("linux") == std::string::npos) |
| 53 IsLinux = false; | 56 IsLinux = false; |
| 54 } | 57 } |
| OLD | NEW |