[PATCH] Fix for PR20104. Enable GAS compliant coprocessor register name.

Stepan Dyatkovskiy stpworld at narod.ru
Mon Jun 23 16:16:14 PDT 2014


Hi Andrey,
Thanks for working on it!
I think we have to keep compatibility with GAS.. So  in general patch looks reasonable. May be it would be good to add some details what method does (see inline comments).
I've CCed Renato and Tim for approval.

================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:3086
@@ -3085,3 +3085,3 @@
 /// instruction with a symbolic operand name. Example: "p1", "p7", "c3",
-/// "c5", ...
+/// "c5", cr0, cr5 ...
 static int MatchCoprocessorOperandName(StringRef Name, char CoprocOp) {
----------------
I think, it would be good to explain the grammar in short, something like:
RegName ::= <Prefix><Number>
Number - integer in range [0, 16)
If CoprocOp is 'c', then:
Prefix ::= c|cr
If CoprocOp is 'c', then:
Prefix ::= p


================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:3093
@@ +3092,3 @@
+
+  if (Name.startswith("cr")) // For gas compatibility
+    Name = Name.drop_front();
----------------
Please place comment above "if" statement:
// For gas compatibility
if ...

http://reviews.llvm.org/D4254






More information about the llvm-commits mailing list