[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:
Toma Tabacu
2014-09-15 15:33:01 +00:00
parent fcc1a51d3d
commit fa13b44206

View File

@@ -1657,23 +1657,24 @@ int MipsAsmParser::matchCPURegisterName(StringRef Name) {
.Case("t9", 25) .Case("t9", 25)
.Default(-1); .Default(-1);
if (isABI_N32() || isABI_N64()) { if (!(isABI_N32() || isABI_N64()))
// Although SGI documentation just cuts out t0-t3 for n32/n64, return CC;
// 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) // Although SGI documentation just cuts out t0-t3 for n32/n64,
CC = StringSwitch<unsigned>(Name) // GNU pushes the values of t0-t3 to override the o32/o64 values for t4-t7
.Case("a4", 8) // We are supporting both cases, so for t0-t3 we'll just push them to t4-t7.
.Case("a5", 9) if (8 <= CC && CC <= 11)
.Case("a6", 10) CC += 4;
.Case("a7", 11)
.Case("kt0", 26) if (CC == -1)
.Case("kt1", 27) CC = StringSwitch<unsigned>(Name)
.Default(-1); .Case("a4", 8)
} .Case("a5", 9)
.Case("a6", 10)
.Case("a7", 11)
.Case("kt0", 26)
.Case("kt1", 27)
.Default(-1);
return CC; return CC;
} }