1//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file implements the SPARC specific subclass of TargetSubtarget. 11// 12//===----------------------------------------------------------------------===// 13 14#include "SparcSubtarget.h" 15#include "SparcGenSubtarget.inc" 16using namespace llvm; 17
| 1//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file implements the SPARC specific subclass of TargetSubtarget. 11// 12//===----------------------------------------------------------------------===// 13 14#include "SparcSubtarget.h" 15#include "SparcGenSubtarget.inc" 16using namespace llvm; 17
|
18// 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 25SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &FS) { 26 // Set the default features. 27 IsV9 = false; 28 V8DeprecatedInsts = false; 29 IsVIS = false;
| 18SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &FS, 19 bool is64Bit) : 20 IsV9(false), 21 V8DeprecatedInsts(false), 22 IsVIS(false), 23 Is64Bit(is64Bit) {
|
30 31 // Determine default and user specified characteristics
| 24 25 // Determine default and user specified characteristics
|
32 std::string CPU = "generic";
| 26 const char *CPU = "v8"; 27 if (is64Bit) { 28 CPU = "v9"; 29 IsV9 = true; 30 }
|
33
| 31
|
34 // FIXME: autodetect host here! 35 CPU = "v9"; // What is a good way to detect V9? 36
| |
37 // Parse features string. 38 ParseSubtargetFeatures(FS, CPU);
| 32 // Parse features string. 33 ParseSubtargetFeatures(FS, CPU);
|
39 40 // Unless explicitly enabled, disable the V9 instructions. 41 if (!EnableV9) 42 IsV9 = false;
| |
43}
| 34}
|