From 50e6d23f0d50d69b14eecd6a38a375cc07101a07 Mon Sep 17 00:00:00 2001 From: Venkatraman Govindaraju Date: Sat, 11 Jan 2014 23:56:13 +0000 Subject: [PATCH] [Sparc] Add missing processor types: v7 and niagara git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199024 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/Sparc.td | 6 +++++- lib/Target/Sparc/SparcSubtarget.cpp | 9 ++------- test/CodeGen/SPARC/ctpop.ll | 9 ++++++++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/Target/Sparc/Sparc.td b/lib/Target/Sparc/Sparc.td index 2cace099b14..9f6992de2f1 100644 --- a/lib/Target/Sparc/Sparc.td +++ b/lib/Target/Sparc/Sparc.td @@ -56,6 +56,7 @@ class Proc Features> : Processor; def : Proc<"generic", []>; +def : Proc<"v7", []>; def : Proc<"v8", []>; def : Proc<"supersparc", []>; def : Proc<"sparclite", []>; @@ -67,7 +68,10 @@ def : Proc<"tsc701", []>; def : Proc<"v9", [FeatureV9]>; def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated]>; def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated]>; -def : Proc<"ultrasparc3-vis", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>; +def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated]>; +def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated]>; +def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated]>; +def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated]>; //===----------------------------------------------------------------------===// diff --git a/lib/Target/Sparc/SparcSubtarget.cpp b/lib/Target/Sparc/SparcSubtarget.cpp index 7d09d0e3f7d..7032d7f3fb0 100644 --- a/lib/Target/Sparc/SparcSubtarget.cpp +++ b/lib/Target/Sparc/SparcSubtarget.cpp @@ -35,13 +35,8 @@ SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU, // Determine default and user specified characteristics std::string CPUName = CPU; - if (CPUName.empty()) { - if (is64Bit) - CPUName = "v9"; - else - CPUName = "v8"; - } - IsV9 = CPUName == "v9"; + if (CPUName.empty()) + CPUName = (is64Bit) ? "v9" : "v8"; // Parse features string. ParseSubtargetFeatures(CPUName, FS); diff --git a/test/CodeGen/SPARC/ctpop.ll b/test/CodeGen/SPARC/ctpop.ll index 89c95ede4d1..665b44b8f67 100644 --- a/test/CodeGen/SPARC/ctpop.ll +++ b/test/CodeGen/SPARC/ctpop.ll @@ -1,6 +1,13 @@ ; RUN: llc < %s -march=sparc -mattr=-v9 | FileCheck %s -check-prefix=V8 ; RUN: llc < %s -march=sparc -mattr=+v9 | FileCheck %s -check-prefix=V9 -; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=SPARC64 +; RUN: llc < %s -march=sparc -mcpu=v9 | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -march=sparc -mcpu=ultrasparc | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -march=sparc -mcpu=ultrasparc3 | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -march=sparc -mcpu=niagara | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -march=sparc -mcpu=niagara2 | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -march=sparc -mcpu=niagara3 | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -march=sparc -mcpu=niagara4 | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=SPARC64 declare i32 @llvm.ctpop.i32(i32) -- 2.34.1