[llvm] r245437 - Map %fprs to %asr6 in the Sparc assembler parser.

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 06:55:14 PDT 2015


Author: joerg
Date: Wed Aug 19 08:55:14 2015
New Revision: 245437

URL: http://llvm.org/viewvc/llvm-project?rev=245437&view=rev
Log:
Map %fprs to %asr6 in the Sparc assembler parser.

Modified:
    llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
    llvm/trunk/test/MC/Sparc/sparc-special-registers.s

Modified: llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp?rev=245437&r1=245436&r2=245437&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp Wed Aug 19 08:55:14 2015
@@ -879,6 +879,13 @@ bool SparcAsmParser::matchRegisterName(c
       return true;
     }
 
+    // %fprs is an alias of %asr6.
+    if (name.equals("fprs")) {
+      RegNo = ASRRegs[6];
+      RegKind = SparcOperand::rk_Special;
+      return true;
+    }
+
     if (name.equals("icc")) {
       RegNo = Sparc::ICC;
       RegKind = SparcOperand::rk_Special;

Modified: llvm/trunk/test/MC/Sparc/sparc-special-registers.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Sparc/sparc-special-registers.s?rev=245437&r1=245436&r2=245437&view=diff
==============================================================================
--- llvm/trunk/test/MC/Sparc/sparc-special-registers.s (original)
+++ llvm/trunk/test/MC/Sparc/sparc-special-registers.s Wed Aug 19 08:55:14 2015
@@ -33,3 +33,9 @@
 
         ! CHECK: wr %i0, 5, %tbr          ! encoding: [0x81,0x9e,0x20,0x05]
         wr %i0, 5, %tbr
+
+        ! CHECK: rd %asr6, %i0         ! encoding: [0xb1,0x41,0x80,0x00]
+        rd %fprs, %i0
+
+        ! CHECK: wr %i0, 7, %asr6      ! encoding: [0x8d,0x86,0x20,0x07]
+        wr %i0, 7, %fprs




More information about the llvm-commits mailing list