[SPARC] Recognize st/stx operations with %fsr argument too.
authorJoerg Sonnenberger <joerg@bec.de>
Wed, 16 Sep 2015 13:30:54 +0000 (13:30 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Wed, 16 Sep 2015 13:30:54 +0000 (13:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247794 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcInstrInfo.td
test/MC/Sparc/sparc-special-registers.s
test/MC/Sparc/sparcv9-instructions.s

index 5da4983eab4e1c57c24ef1f3df76508eeacc1c33..0beef34ba8539c6496eb2c3bb4397309f0278a55 100644 (file)
@@ -486,6 +486,22 @@ let DecoderMethod = "DecodeStoreQFP" in
   defm STQF  : StoreA<"stq", 0b100110, 0b110110, store, QFPRegs, f128>,
                Requires<[HasV9, HasHardQuad]>;
 
+let DecoderMethod = "DecodeStoreFP" in
+  let Defs = [FSR] in {
+    let rd = 0 in {
+      def STFSRrr : F3_1<3, 0b100101, (outs MEMrr:$addr), (ins),
+                     "st %fsr, [$addr]", []>;
+      def STFSRri : F3_2<3, 0b100101, (outs MEMri:$addr), (ins),
+                     "st %fsr, [$addr]", []>;
+    }
+    let rd = 1 in {
+      def STXFSRrr : F3_1<3, 0b100101, (outs MEMrr:$addr), (ins),
+                     "stx %fsr, [$addr]", []>, Requires<[HasV9]>;
+      def STXFSRri : F3_2<3, 0b100101, (outs MEMri:$addr), (ins),
+                     "stx %fsr, [$addr]", []>, Requires<[HasV9]>;
+    }
+  }
+
 // Section B.8 - SWAP Register with Memory Instruction
 // (Atomic swap)
 let Constraints = "$val = $dst", DecoderMethod = "DecodeSWAP" in {
index 9eaab2ee2f43130e151f154faed06314004fcb4f..235c4cfedcf840ad9ca2a220cfb357d499250993 100644 (file)
@@ -45,3 +45,9 @@
 
         ! CHECK: ld [%g2+%i5], %fsr    ! encoding: [0xc1,0x08,0x80,0x1d]
         ld [%g2 + %i5],%fsr
+
+        ! CHECK: st %fsr, [%g2+20]     ! encoding: [0xc1,0x28,0xa0,0x14]
+        st %fsr,[%g2 + 20]
+
+        ! CHECK: st %fsr, [%g2+%i5]    ! encoding: [0xc1,0x28,0x80,0x1d]
+        st %fsr,[%g2 + %i5]
index c1bb224d2585fdfcdfa342d6582d152e33d3c6bd..98e3096e18f4b70b99606964c32f16aff913ed28 100644 (file)
         ! V8-NEXT: ldx [%g2 + %i5],%fsr
         ! V9: ldx [%g2+%i5], %fsr   ! encoding: [0xc3,0x08,0x80,0x1d]
         ldx [%g2 + %i5],%fsr
+
+        ! V8:      error: instruction requires a CPU feature not currently enabled
+        ! V8-NEXT: stx %fsr,[%g2 + 20]
+        ! V9: stx %fsr, [%g2+20]    ! encoding: [0xc3,0x28,0xa0,0x14]
+        stx %fsr,[%g2 + 20]
+
+        ! V8:      error: instruction requires a CPU feature not currently enabled
+        ! V8-NEXT: stx %fsr,[%g2 + %i5]
+        ! V9: stx %fsr, [%g2+%i5]   ! encoding: [0xc3,0x28,0x80,0x1d]
+        stx %fsr,[%g2 + %i5]