[llvm] r247794 - [SPARC] Recognize st/stx operations with %fsr argument too.
Joerg Sonnenberger via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 06:30:54 PDT 2015
Author: joerg
Date: Wed Sep 16 08:30:54 2015
New Revision: 247794
URL: http://llvm.org/viewvc/llvm-project?rev=247794&view=rev
Log:
[SPARC] Recognize st/stx operations with %fsr argument too.
Modified:
llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td
llvm/trunk/test/MC/Sparc/sparc-special-registers.s
llvm/trunk/test/MC/Sparc/sparcv9-instructions.s
Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=247794&r1=247793&r2=247794&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Wed Sep 16 08:30:54 2015
@@ -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 {
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=247794&r1=247793&r2=247794&view=diff
==============================================================================
--- llvm/trunk/test/MC/Sparc/sparc-special-registers.s (original)
+++ llvm/trunk/test/MC/Sparc/sparc-special-registers.s Wed Sep 16 08:30:54 2015
@@ -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]
Modified: llvm/trunk/test/MC/Sparc/sparcv9-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Sparc/sparcv9-instructions.s?rev=247794&r1=247793&r2=247794&view=diff
==============================================================================
--- llvm/trunk/test/MC/Sparc/sparcv9-instructions.s (original)
+++ llvm/trunk/test/MC/Sparc/sparcv9-instructions.s Wed Sep 16 08:30:54 2015
@@ -100,3 +100,13 @@
! 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]
More information about the llvm-commits
mailing list