1 Pull in r199024 from upstream llvm trunk (by Venkatraman Govindaraju):
3 [Sparc] Add missing processor types: v7 and niagara
5 Introduced here: http://svn.freebsd.org/changeset/base/262261
7 Index: lib/Target/Sparc/Sparc.td
8 ===================================================================
9 --- lib/Target/Sparc/Sparc.td
10 +++ lib/Target/Sparc/Sparc.td
11 @@ -56,6 +56,7 @@ class Proc<string Name, list<SubtargetFeature> Fea
12 : Processor<Name, NoItineraries, Features>;
14 def : Proc<"generic", []>;
15 +def : Proc<"v7", []>;
17 def : Proc<"supersparc", []>;
18 def : Proc<"sparclite", []>;
19 @@ -67,7 +68,10 @@ def : Proc<"tsc701", []>;
20 def : Proc<"v9", [FeatureV9]>;
21 def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated]>;
22 def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated]>;
23 -def : Proc<"ultrasparc3-vis", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>;
24 +def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated]>;
25 +def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated]>;
26 +def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated]>;
27 +def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated]>;
29 def SparcAsmWriter : AsmWriter {
30 string AsmWriterClassName = "InstPrinter";
31 Index: lib/Target/Sparc/SparcSubtarget.cpp
32 ===================================================================
33 --- lib/Target/Sparc/SparcSubtarget.cpp
34 +++ lib/Target/Sparc/SparcSubtarget.cpp
35 @@ -35,13 +35,8 @@ SparcSubtarget::SparcSubtarget(const std::string &
37 // Determine default and user specified characteristics
38 std::string CPUName = CPU;
39 - if (CPUName.empty()) {
45 - IsV9 = CPUName == "v9";
46 + if (CPUName.empty())
47 + CPUName = (is64Bit) ? "v9" : "v8";
49 // Parse features string.
50 ParseSubtargetFeatures(CPUName, FS);
51 Index: test/CodeGen/SPARC/ctpop.ll
52 ===================================================================
53 --- test/CodeGen/SPARC/ctpop.ll
54 +++ test/CodeGen/SPARC/ctpop.ll
56 ; RUN: llc < %s -march=sparc -mattr=-v9 | FileCheck %s -check-prefix=V8
57 ; RUN: llc < %s -march=sparc -mattr=+v9 | FileCheck %s -check-prefix=V9
58 -; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=SPARC64
59 +; RUN: llc < %s -march=sparc -mcpu=v9 | FileCheck %s -check-prefix=V9
60 +; RUN: llc < %s -march=sparc -mcpu=ultrasparc | FileCheck %s -check-prefix=V9
61 +; RUN: llc < %s -march=sparc -mcpu=ultrasparc3 | FileCheck %s -check-prefix=V9
62 +; RUN: llc < %s -march=sparc -mcpu=niagara | FileCheck %s -check-prefix=V9
63 +; RUN: llc < %s -march=sparc -mcpu=niagara2 | FileCheck %s -check-prefix=V9
64 +; RUN: llc < %s -march=sparc -mcpu=niagara3 | FileCheck %s -check-prefix=V9
65 +; RUN: llc < %s -march=sparc -mcpu=niagara4 | FileCheck %s -check-prefix=V9
66 +; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=SPARC64
68 declare i32 @llvm.ctpop.i32(i32)