Skip to content

Commit 1318a7b

Browse files
authored
Reland [MIPS] Define SubTargetFeature for i6500 cpu (#132907) (#133366)
Relands #132907 with a fix in the testcase: clang/test/CodeGen/Mips/subtarget-feature-test.c enable this test for only mips64 target PR #130587 defined same SubTargetFeature for CPUs i6400 and i6500 which resulted into following warning when -mcpu=i6500 was used: +i6500' is not a recognized feature for this target (ignoring feature) This PR fixes above issue by defining separate SubTargetFeature for i6500.
1 parent 7b75db5 commit 1318a7b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// REQUIRES: mips64-registered-target
2+
// RUN: %clang --target=mips64-linux-gnu -mcpu=i6400 -o %t -c %s 2>&1 | FileCheck --allow-empty %s
3+
// CHECK-NOT: {{.*}} is not a recognized feature for this target
4+
5+
// RUN: %clang --target=mips64-linux-gnu -mcpu=i6500 -o %t -c %s 2>&1 | FileCheck --allow-empty %s
6+
// CHECK-NOT: {{.*}} is not a recognized feature for this target

llvm/lib/Target/Mips/Mips.td

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ def ImplP5600 : SubtargetFeature<"p5600", "ProcImpl",
242242
// same CPU architecture.
243243
def ImplI6400
244244
: SubtargetFeature<"i6400", "ProcImpl", "MipsSubtarget::CPU::I6400",
245-
"MIPS I6400/I6500 Processors", [FeatureMips64r6]>;
245+
"MIPS I6400 Processor", [FeatureMips64r6]>;
246+
247+
def ImplI6500
248+
: SubtargetFeature<"i6500", "ProcImpl", "MipsSubtarget::CPU::I6500",
249+
"MIPS I6500 Processor", [FeatureMips64r6]>;
246250

247251
class Proc<string Name, list<SubtargetFeature> Features>
248252
: ProcessorModel<Name, MipsGenericModel, Features>;
@@ -268,7 +272,7 @@ def : Proc<"octeon", [FeatureMips64r2, FeatureCnMips]>;
268272
def : Proc<"octeon+", [FeatureMips64r2, FeatureCnMips, FeatureCnMipsP]>;
269273
def : ProcessorModel<"p5600", MipsP5600Model, [ImplP5600]>;
270274
def : ProcessorModel<"i6400", NoSchedModel, [ImplI6400]>;
271-
def : ProcessorModel<"i6500", NoSchedModel, [ImplI6400]>;
275+
def : ProcessorModel<"i6500", NoSchedModel, [ImplI6500]>;
272276

273277
def MipsAsmParser : AsmParser {
274278
let ShouldEmitMatchRegisterName = 0;

llvm/lib/Target/Mips/MipsSubtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MipsSubtarget : public MipsGenSubtargetInfo {
4343
Mips3, Mips4, Mips5, Mips64, Mips64r2, Mips64r3, Mips64r5, Mips64r6
4444
};
4545

46-
enum class CPU { P5600, I6400 };
46+
enum class CPU { P5600, I6400, I6500 };
4747

4848
// Used to avoid printing dsp warnings multiple times.
4949
static bool DspWarningPrinted;

0 commit comments

Comments
 (0)