mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 17:39:16 +00:00
[mips] Use early exit in MipsAsmParser::matchCPURegisterName(). NFC.
Patch by Vasileios Kalintiris. Differential Revision: http://reviews.llvm.org/D5270 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fcc1a51d3d
commit
fa13b44206
@ -1657,23 +1657,24 @@ int MipsAsmParser::matchCPURegisterName(StringRef Name) {
|
||||
.Case("t9", 25)
|
||||
.Default(-1);
|
||||
|
||||
if (isABI_N32() || isABI_N64()) {
|
||||
// Although SGI documentation just cuts out t0-t3 for n32/n64,
|
||||
// GNU pushes the values of t0-t3 to override the o32/o64 values for t4-t7
|
||||
// We are supporting both cases, so for t0-t3 we'll just push them to t4-t7.
|
||||
if (8 <= CC && CC <= 11)
|
||||
CC += 4;
|
||||
if (!(isABI_N32() || isABI_N64()))
|
||||
return CC;
|
||||
|
||||
if (CC == -1)
|
||||
CC = StringSwitch<unsigned>(Name)
|
||||
.Case("a4", 8)
|
||||
.Case("a5", 9)
|
||||
.Case("a6", 10)
|
||||
.Case("a7", 11)
|
||||
.Case("kt0", 26)
|
||||
.Case("kt1", 27)
|
||||
.Default(-1);
|
||||
}
|
||||
// Although SGI documentation just cuts out t0-t3 for n32/n64,
|
||||
// GNU pushes the values of t0-t3 to override the o32/o64 values for t4-t7
|
||||
// We are supporting both cases, so for t0-t3 we'll just push them to t4-t7.
|
||||
if (8 <= CC && CC <= 11)
|
||||
CC += 4;
|
||||
|
||||
if (CC == -1)
|
||||
CC = StringSwitch<unsigned>(Name)
|
||||
.Case("a4", 8)
|
||||
.Case("a5", 9)
|
||||
.Case("a6", 10)
|
||||
.Case("a7", 11)
|
||||
.Case("kt0", 26)
|
||||
.Case("kt1", 27)
|
||||
.Default(-1);
|
||||
|
||||
return CC;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user