Skip to content

Commit

Permalink
[mips] Allow $AT to be used as a register name
Browse files Browse the repository at this point in the history
This patch allows $AT to be used as a register name in assembly files.
Currently only $at is recognized as a valid register name.

Patch by Stanislav Ocovaj.

Differential Revision: https://reviews.llvm.org/D34348

llvm-svn: 306007
  • Loading branch information
petar-jovanovic committed Jun 22, 2017
1 parent f2c349c commit 636851b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Expand Up @@ -5107,7 +5107,7 @@ int MipsAsmParser::matchCPURegisterName(StringRef Name) {

CC = StringSwitch<unsigned>(Name)
.Case("zero", 0)
.Case("at", 1)
.Cases("at", "AT", 1)
.Case("a0", 4)
.Case("a1", 5)
.Case("a2", 6)
Expand Down
1 change: 1 addition & 0 deletions llvm/test/MC/Mips/mips-register-names-o32.s
Expand Up @@ -7,6 +7,7 @@
.set noat
addiu $zero, $zero, 0 # CHECK: encoding: [0x24,0x00,0x00,0x00]
addiu $at, $zero, 0 # CHECK: encoding: [0x24,0x01,0x00,0x00]
addiu $AT, $zero, 0 # CHECK: encoding: [0x24,0x01,0x00,0x00]
addiu $v0, $zero, 0 # CHECK: encoding: [0x24,0x02,0x00,0x00]
addiu $v1, $zero, 0 # CHECK: encoding: [0x24,0x03,0x00,0x00]
addiu $a0, $zero, 0 # CHECK: encoding: [0x24,0x04,0x00,0x00]
Expand Down
1 change: 1 addition & 0 deletions llvm/test/MC/Mips/mips64-register-names-n32-n64.s
Expand Up @@ -13,6 +13,7 @@
.set noat
daddiu $zero, $zero, 0 # CHECK: encoding: [0x64,0x00,0x00,0x00]
daddiu $at, $zero, 0 # CHECK: encoding: [0x64,0x01,0x00,0x00]
daddiu $AT, $zero, 0 # CHECK: encoding: [0x64,0x01,0x00,0x00]
daddiu $v0, $zero, 0 # CHECK: encoding: [0x64,0x02,0x00,0x00]
daddiu $v1, $zero, 0 # CHECK: encoding: [0x64,0x03,0x00,0x00]
daddiu $a0, $zero, 0 # CHECK: encoding: [0x64,0x04,0x00,0x00]
Expand Down
1 change: 1 addition & 0 deletions llvm/test/MC/Mips/mips64-register-names-o32.s
Expand Up @@ -8,6 +8,7 @@
.set noat
addiu $zero, $zero, 0 # CHECK: encoding: [0x24,0x00,0x00,0x00]
addiu $at, $zero, 0 # CHECK: encoding: [0x24,0x01,0x00,0x00]
addiu $AT, $zero, 0 # CHECK: encoding: [0x24,0x01,0x00,0x00]
addiu $v0, $zero, 0 # CHECK: encoding: [0x24,0x02,0x00,0x00]
addiu $v1, $zero, 0 # CHECK: encoding: [0x24,0x03,0x00,0x00]
addiu $a0, $zero, 0 # CHECK: encoding: [0x24,0x04,0x00,0x00]
Expand Down

0 comments on commit 636851b

Please sign in to comment.