Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 1 | //===- AlphaSubtarget.cpp - Alpha Subtarget Information ---------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Andrew Lenharth and is distributed under the |
| 6 | // University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the Alpha specific subclass of TargetSubtarget. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "AlphaSubtarget.h" |
| 15 | #include "Alpha.h" |
| 16 | #include "llvm/Module.h" |
| 17 | #include "llvm/Support/CommandLine.h" |
| 18 | #include "llvm/Target/SubtargetFeature.h" |
Chris Lattner | ed465f5 | 2005-10-23 22:15:34 +0000 | [diff] [blame^] | 19 | #include "AlphaGenSubtarget.inc" |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 20 | using namespace llvm; |
| 21 | |
Chris Lattner | ed465f5 | 2005-10-23 22:15:34 +0000 | [diff] [blame^] | 22 | |
| 23 | enum { |
| 24 | FeatureKVSize = sizeof(FeatureKV) / sizeof(SubtargetFeatureKV), |
| 25 | SubTypeKVSize = sizeof(SubTypeKV) / sizeof(SubtargetFeatureKV) |
Andrew Lenharth | ac35cd2 | 2005-09-30 20:24:38 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 28 | AlphaSubtarget::AlphaSubtarget(const Module &M, const std::string &FS) |
Chris Lattner | ed465f5 | 2005-10-23 22:15:34 +0000 | [diff] [blame^] | 29 | : HasF2I(false), HasCT(false) { |
Andrew Lenharth | ac35cd2 | 2005-09-30 20:24:38 +0000 | [diff] [blame] | 30 | std::string CPU = "generic"; |
| 31 | uint32_t Bits = |
Chris Lattner | ed465f5 | 2005-10-23 22:15:34 +0000 | [diff] [blame^] | 32 | SubtargetFeatures::Parse(FS, CPU, |
| 33 | SubTypeKV, SubTypeKVSize, |
| 34 | FeatureKV, FeatureKVSize); |
| 35 | HasF2I = (Bits & FeatureFIX) != 0; |
| 36 | HasCT = (Bits & FeatureCIX) != 0; |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 37 | } |