Skip to content

Commit 3718102

Browse files
committed
[mips] Support octeon+ CPU in the .set arch= directive
Differential Revision: https://reviews.llvm.org/D69850
1 parent 7bed381 commit 3718102

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7175,8 +7175,8 @@ bool MipsAsmParser::parseSetArchDirective() {
71757175
return reportParseError("unexpected token, expected equals sign");
71767176

71777177
Parser.Lex();
7178-
StringRef Arch;
7179-
if (Parser.parseIdentifier(Arch))
7178+
StringRef Arch = getParser().parseStringToEndOfStatement().trim();
7179+
if (Arch.empty())
71807180
return reportParseError("expected arch identifier");
71817181

71827182
StringRef ArchFeatureName =
@@ -7197,6 +7197,7 @@ bool MipsAsmParser::parseSetArchDirective() {
71977197
.Case("mips64r5", "mips64r5")
71987198
.Case("mips64r6", "mips64r6")
71997199
.Case("octeon", "cnmips")
7200+
.Case("octeon+", "cnmipsp")
72007201
.Case("r4000", "mips3") // This is an implementation of Mips3.
72017202
.Default("");
72027203

llvm/test/MC/Mips/set-arch.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
mod $2, $4, $6
3939
.set arch=octeon
4040
baddu $9, $6, $7
41+
.set arch=octeon+
42+
saa $2, ($5)
4143
.set arch=r4000
4244
dadd $2, $2, $2
4345

@@ -65,5 +67,7 @@
6567
# CHECK: mod $2, $4, $6
6668
# CHECK: .set arch=octeon
6769
# CHECK: baddu $9, $6, $7
70+
# CHECK: .set arch=octeon+
71+
# CHECK: saa $2, ($5)
6872
# CHECK: .set arch=r4000
6973
# CHECK: dadd $2, $2, $2

0 commit comments

Comments
 (0)