Skip to content

Commit

Permalink
[Driver] Remove remnant myriad pieces after Myriad.cpp removal
Browse files Browse the repository at this point in the history
after D104279 and D158706.
  • Loading branch information
MaskRay committed Aug 25, 2023
1 parent 5966079 commit 8cfe9d8
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 150 deletions.
72 changes: 0 additions & 72 deletions clang/lib/Basic/Targets/Sparc.cpp
Expand Up @@ -93,12 +93,6 @@ static constexpr SparcCPUInfo CPUInfo[] = {
{{"ma2480"}, SparcTargetInfo::CK_MYRIAD2480, SparcTargetInfo::CG_V8},
{{"ma2485"}, SparcTargetInfo::CK_MYRIAD2485, SparcTargetInfo::CG_V8},
{{"ma2x8x"}, SparcTargetInfo::CK_MYRIAD2x8x, SparcTargetInfo::CG_V8},
// FIXME: the myriad2[.n] spellings are obsolete,
// but a grace period is needed to allow updating dependent builds.
{{"myriad2"}, SparcTargetInfo::CK_MYRIAD2x5x, SparcTargetInfo::CG_V8},
{{"myriad2.1"}, SparcTargetInfo::CK_MYRIAD2100, SparcTargetInfo::CG_V8},
{{"myriad2.2"}, SparcTargetInfo::CK_MYRIAD2x5x, SparcTargetInfo::CG_V8},
{{"myriad2.3"}, SparcTargetInfo::CK_MYRIAD2x8x, SparcTargetInfo::CG_V8},
{{"leon2"}, SparcTargetInfo::CK_LEON2, SparcTargetInfo::CG_V8},
{{"at697e"}, SparcTargetInfo::CK_LEON2_AT697E, SparcTargetInfo::CG_V8},
{{"at697f"}, SparcTargetInfo::CK_LEON2_AT697F, SparcTargetInfo::CG_V8},
Expand Down Expand Up @@ -160,72 +154,6 @@ void SparcV8TargetInfo::getTargetDefines(const LangOptions &Opts,
break;
}
}
if (getTriple().getVendor() == llvm::Triple::Myriad) {
std::string MyriadArchValue, Myriad2Value;
Builder.defineMacro("__sparc_v8__");
Builder.defineMacro("__leon__");
switch (CPU) {
case CK_MYRIAD2100:
MyriadArchValue = "__ma2100";
Myriad2Value = "1";
break;
case CK_MYRIAD2150:
MyriadArchValue = "__ma2150";
Myriad2Value = "2";
break;
case CK_MYRIAD2155:
MyriadArchValue = "__ma2155";
Myriad2Value = "2";
break;
case CK_MYRIAD2450:
MyriadArchValue = "__ma2450";
Myriad2Value = "2";
break;
case CK_MYRIAD2455:
MyriadArchValue = "__ma2455";
Myriad2Value = "2";
break;
case CK_MYRIAD2x5x:
Myriad2Value = "2";
break;
case CK_MYRIAD2080:
MyriadArchValue = "__ma2080";
Myriad2Value = "3";
break;
case CK_MYRIAD2085:
MyriadArchValue = "__ma2085";
Myriad2Value = "3";
break;
case CK_MYRIAD2480:
MyriadArchValue = "__ma2480";
Myriad2Value = "3";
break;
case CK_MYRIAD2485:
MyriadArchValue = "__ma2485";
Myriad2Value = "3";
break;
case CK_MYRIAD2x8x:
Myriad2Value = "3";
break;
default:
MyriadArchValue = "__ma2100";
Myriad2Value = "1";
break;
}
if (!MyriadArchValue.empty()) {
Builder.defineMacro(MyriadArchValue, "1");
Builder.defineMacro(MyriadArchValue + "__", "1");
}
if (Myriad2Value == "2") {
Builder.defineMacro("__ma2x5x", "1");
Builder.defineMacro("__ma2x5x__", "1");
} else if (Myriad2Value == "3") {
Builder.defineMacro("__ma2x8x", "1");
Builder.defineMacro("__ma2x8x__", "1");
}
Builder.defineMacro("__myriad2__", Myriad2Value);
Builder.defineMacro("__myriad2", Myriad2Value);
}
if (getCPUGeneration(CPU) == CG_V9) {
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
Expand Down
4 changes: 0 additions & 4 deletions clang/lib/Driver/ToolChains/Arch/Sparc.cpp
Expand Up @@ -63,10 +63,6 @@ const char *sparc::getSparcAsmModeForCPU(StringRef Name,
.Case("ma2480", "-Aleon")
.Case("ma2485", "-Aleon")
.Case("ma2x8x", "-Aleon")
.Case("myriad2", "-Aleon")
.Case("myriad2.1", "-Aleon")
.Case("myriad2.2", "-Aleon")
.Case("myriad2.3", "-Aleon")
.Case("leon2", "-Av8")
.Case("at697e", "-Av8")
.Case("at697f", "-Av8")
Expand Down
16 changes: 0 additions & 16 deletions clang/test/Driver/sparc-as.c
Expand Up @@ -120,22 +120,6 @@
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC-LEON %s

// RUN: %clang -mcpu=myriad2 --target=sparc \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC-LEON %s

// RUN: %clang -mcpu=myriad2.1 --target=sparc \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC-LEON %s

// RUN: %clang -mcpu=myriad2.2 --target=sparc \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC-LEON %s

// RUN: %clang -mcpu=myriad2.3 --target=sparc \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC-LEON %s

// RUN: %clang -mcpu=leon2 --target=sparc \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC-V8 %s
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Misc/target-invalid-cpu-note.c
Expand Up @@ -49,7 +49,7 @@

// RUN: not %clang_cc1 -triple sparc--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SPARC
// SPARC: error: unknown target CPU 'not-a-cpu'
// SPARC-NEXT: note: valid target CPU values are: v8, supersparc, sparclite, f934, hypersparc, sparclite86x, sparclet, tsc701, v9, ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4, ma2100, ma2150, ma2155, ma2450, ma2455, ma2x5x, ma2080, ma2085, ma2480, ma2485, ma2x8x, myriad2, myriad2.1, myriad2.2, myriad2.3, leon2, at697e, at697f, leon3, ut699, gr712rc, leon4, gr740{{$}}
// SPARC-NEXT: note: valid target CPU values are: v8, supersparc, sparclite, f934, hypersparc, sparclite86x, sparclet, tsc701, v9, ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4, ma2100, ma2150, ma2155, ma2450, ma2455, ma2x5x, ma2080, ma2085, ma2480, ma2485, ma2x8x, leon2, at697e, at697f, leon3, ut699, gr712rc, leon4, gr740{{$}}

// RUN: not %clang_cc1 -triple sparcv9--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SPARCV9
// SPARCV9: error: unknown target CPU 'not-a-cpu'
Expand Down
57 changes: 0 additions & 57 deletions clang/test/Preprocessor/predefined-arch-macros.c
Expand Up @@ -4055,66 +4055,9 @@
// RUN: %clang -E -dM %s -o - 2>&1 \
// RUN: -target sparcel-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARCEL
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2.1 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-1 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2.2 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2.3 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2100 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-1 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2150 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2155 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2450 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2455 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2x5x 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2080 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2085 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2480 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2485 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2x8x 2>&1 \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \
// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2
// CHECK_SPARCEL: #define __LITTLE_ENDIAN__ 1
// CHECK_MYRIAD2: #define __leon__ 1
// CHECK_MYRIAD2-1: #define __myriad2 1
// CHECK_MYRIAD2-1: #define __myriad2__ 1
// CHECK_MYRIAD2-2: #define __ma2x5x 1
// CHECK_MYRIAD2-2: #define __ma2x5x__ 1
// CHECK_MYRIAD2-2: #define __myriad2 2
// CHECK_MYRIAD2-2: #define __myriad2__ 2
// CHECK_MYRIAD2-3: #define __ma2x8x 1
// CHECK_MYRIAD2-3: #define __ma2x8x__ 1
// CHECK_MYRIAD2-3: #define __myriad2 3
// CHECK_MYRIAD2-3: #define __myriad2__ 3
// CHECK_SPARCEL: #define __sparc 1
// CHECK_SPARCEL: #define __sparc__ 1
// CHECK_MYRIAD2: #define __sparc_v8__ 1
// CHECK_SPARCEL: #define __sparcv8 1

// RUN: %clang -E -dM %s -o - 2>&1 \
Expand Down

0 comments on commit 8cfe9d8

Please sign in to comment.