Skip to content

Commit 6f4c2dc

Browse files
committed
[Mips] Fix clang compile error when -march=p5600 with -mmsa
When -march=p5600 with -mmsa, the result of getISARev is 0, so report error. Append p5600 to cases mips32r5.
1 parent 5d8e8e8 commit 6f4c2dc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clang/lib/Basic/Targets/Mips.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ unsigned MipsTargetInfo::getISARev() const {
7272
.Cases("mips32", "mips64", 1)
7373
.Cases("mips32r2", "mips64r2", "octeon", "octeon+", 2)
7474
.Cases("mips32r3", "mips64r3", 3)
75-
.Cases("mips32r5", "mips64r5", 5)
75+
.Cases("mips32r5", "mips64r5", "p5600", 5)
7676
.Cases("mips32r6", "mips64r6", 6)
7777
.Default(0);
7878
}

clang/test/Driver/mips-abi.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@
115115
// MIPS-ARCH-P5600: "-target-cpu" "p5600"
116116
// MIPS-ARCH-P5600: "-target-abi" "o32"
117117
//
118+
// RUN: %clang --target=mips-linux-gnu -### -c %s \
119+
// RUN: -march=p5600 -mmsa -mnan=2008 2>&1 \
120+
// RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600-MSA %s
121+
// MIPS-ARCH-P5600-MSA: "-target-cpu" "p5600"
122+
// MIPS-ARCH-P5600-MSA: "-target-feature" "+msa"
123+
// MIPS-ARCH-P5600-MSA: "-target-feature" "+fp64"
124+
//
125+
// RUN: %clang --target=mips-linux-gnu -### -c %s \
126+
// RUN: -march=p5600 -mmsa -mnan=2008 2>&1 \
127+
// RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600-NAN2008 %s
128+
// MIPS-ARCH-P5600-NAN2008: "-target-cpu" "p5600"
129+
// MIPS-ARCH-P5600-NAN2008: "-target-feature" "+nan2008"
130+
// MIPS-ARCH-P5600-NAN2008: "-target-feature" "+abs2008"
131+
//
118132
// RUN: not %clang --target=mips-linux-gnu -c %s \
119133
// RUN: -march=p5600 -mabi=64 2>&1 \
120134
// RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600-N64 %s

0 commit comments

Comments
 (0)