summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToma Tabacu <toma.tabacu@imgtec.com>2014-09-15 15:33:01 +0000
committerToma Tabacu <toma.tabacu@imgtec.com>2014-09-15 15:33:01 +0000
commitfda445cb834302d92abb43160aa4e8adce28b475 (patch)
treef3d9b8b3eb47ea9d39ac9d78c1b283971a6773f7
parent5c9d5bf81e4c09e97f1bfbfe122a6a0edf833cce (diff)
downloadbcm5719-llvm-fda445cb834302d92abb43160aa4e8adce28b475.tar.gz
bcm5719-llvm-fda445cb834302d92abb43160aa4e8adce28b475.zip
[mips] Use early exit in MipsAsmParser::matchCPURegisterName(). NFC.
Patch by Vasileios Kalintiris. Differential Revision: http://reviews.llvm.org/D5270 llvm-svn: 217774
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 5500a434c36..35005d2b0ff 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -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 (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);
- }
+ if (!(isABI_N32() || isABI_N64()))
+ return CC;
+
+ // 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;
}
OpenPOWER on IntegriCloud