blob: 46ea7d4284813c343dec60f98590222a8b13654b [file] [log] [blame]
Chris Lattner0d170a72006-01-26 06:51:21 +00001//===- SparcV8Subtarget.cpp - SPARC Subtarget Information -----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner 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 SPARC specific subclass of TargetSubtarget.
11//
12//===----------------------------------------------------------------------===//
13
14#include "SparcV8Subtarget.h"
15#include "SparcV8GenSubtarget.inc"
16using namespace llvm;
17
Chris Lattner6f630012006-01-30 04:57:43 +000018// FIXME: temporary.
19#include "llvm/Support/CommandLine.h"
20namespace {
21 cl::opt<bool> EnableV9("enable-sparc-v9-insts", cl::Hidden,
22 cl::desc("Enable V9 instructions in the V8 target"));
23}
24
Chris Lattner0d170a72006-01-26 06:51:21 +000025SparcV8Subtarget::SparcV8Subtarget(const Module &M, const std::string &FS) {
Chris Lattner184cc4a2006-01-27 22:38:36 +000026 // Set the default features.
27 IsV9 = false;
28 V8DeprecatedInsts = false;
29 IsVIS = false;
30
Chris Lattner0d170a72006-01-26 06:51:21 +000031 // Determine default and user specified characteristics
32 std::string CPU = "generic";
33
34 // FIXME: autodetect host here!
Chris Lattner6f630012006-01-30 04:57:43 +000035 CPU = "v9"; // What is a good way to detect V9?
Chris Lattner0d170a72006-01-26 06:51:21 +000036
37 // Parse features string.
38 ParseSubtargetFeatures(FS, CPU);
39
Chris Lattner6f630012006-01-30 04:57:43 +000040 // Unless explicitly enabled, disable the V9 instructions.
41 if (!EnableV9)
42 IsV9 = false;
Chris Lattner4dcfaac2006-01-26 07:22:22 +000043};