Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 1 | //===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the Mips specific subclass of TargetSubtarget. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "MipsSubtarget.h" |
| 15 | #include "Mips.h" |
| 16 | #include "MipsGenSubtarget.inc" |
| 17 | using namespace llvm; |
| 18 | |
Eli Friedman | e2c7408 | 2009-08-03 02:22:28 +0000 | [diff] [blame] | 19 | MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &FS, |
Bruno Cardoso Lopes | 81092dc | 2011-03-04 17:51:39 +0000 | [diff] [blame^] | 20 | bool little) : |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 21 | MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false), |
Eli Friedman | e2c7408 | 2009-08-03 02:22:28 +0000 | [diff] [blame] | 22 | IsFP64bit(false), IsGP64bit(false), HasVFPU(false), IsLinux(true), |
| 23 | HasSEInReg(false), HasCondMov(false), HasMulDivAdd(false), HasMinMax(false), |
| 24 | HasSwap(false), HasBitCount(false) |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 25 | { |
Bruno Cardoso Lopes | 000604a | 2007-11-06 03:15:20 +0000 | [diff] [blame] | 26 | std::string CPU = "mips1"; |
Bruno Cardoso Lopes | d3bdf19 | 2009-05-27 17:23:44 +0000 | [diff] [blame] | 27 | MipsArchVersion = Mips1; |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 28 | |
| 29 | // Parse features string. |
| 30 | ParseSubtargetFeatures(FS, CPU); |
Bruno Cardoso Lopes | 43d526d | 2008-07-14 14:42:54 +0000 | [diff] [blame] | 31 | |
| 32 | // Is the target system Linux ? |
| 33 | if (TT.find("linux") == std::string::npos) |
| 34 | IsLinux = false; |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 35 | |
Bruno Cardoso Lopes | 81092dc | 2011-03-04 17:51:39 +0000 | [diff] [blame^] | 36 | // When only the target triple is specified and is |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 37 | // a allegrex target, set the features. We also match |
| 38 | // big and little endian allegrex cores (dont really |
| 39 | // know if a big one exists) |
Bruno Cardoso Lopes | f131fa2 | 2008-08-08 04:49:42 +0000 | [diff] [blame] | 40 | if (TT.find("mipsallegrex") != std::string::npos || |
| 41 | TT.find("psp") != std::string::npos) { |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 42 | MipsABI = EABI; |
| 43 | IsSingleFloat = true; |
| 44 | MipsArchVersion = Mips2; |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 45 | HasVFPU = true; // Enables Allegrex Vector FPU (not supported yet) |
| 46 | HasSEInReg = true; |
Bruno Cardoso Lopes | 65ad452 | 2008-08-08 06:16:31 +0000 | [diff] [blame] | 47 | HasBitCount = true; |
Bruno Cardoso Lopes | 739e441 | 2008-08-13 07:13:40 +0000 | [diff] [blame] | 48 | HasSwap = true; |
| 49 | HasCondMov = true; |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 50 | } |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 51 | } |