[llvm] 80836ee - [SPARCv9] allow stw as alias for st

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 06:29:45 PDT 2021


Author: Joerg Sonnenberger
Date: 2021-05-20T15:27:36+02:00
New Revision: 80836ee519eb79ac263a84891511c23a416c8565

URL: https://github.com/llvm/llvm-project/commit/80836ee519eb79ac263a84891511c23a416c8565
DIFF: https://github.com/llvm/llvm-project/commit/80836ee519eb79ac263a84891511c23a416c8565.diff

LOG: [SPARCv9] allow stw as alias for st

Strictly speaking, the architecture manual no longer uses the st
mnemonic, but that's a much more intrusive change for little gain.

Differential Revision: https://reviews.llvm.org/D96313

Added: 
    

Modified: 
    llvm/lib/Target/Sparc/SparcInstrAliases.td
    llvm/test/MC/Sparc/sparcv9-instructions.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index 8c528fca6a546..2c28e06718b7a 100644
--- a/llvm/lib/Target/Sparc/SparcInstrAliases.td
+++ b/llvm/lib/Target/Sparc/SparcInstrAliases.td
@@ -491,6 +491,7 @@ def : MnemonicAlias<"stsh", "sth">;
 
 def : MnemonicAlias<"stuha", "stha">;
 def : MnemonicAlias<"stsha", "stha">;
+def : MnemonicAlias<"stw", "st">, Requires<[HasV9]>;
 
 def : MnemonicAlias<"lduw", "ld">, Requires<[HasV9]>;
 def : MnemonicAlias<"lduwa", "lda">, Requires<[HasV9]>;

diff  --git a/llvm/test/MC/Sparc/sparcv9-instructions.s b/llvm/test/MC/Sparc/sparcv9-instructions.s
index 2f90d4360dd97..83f846b86ed18 100644
--- a/llvm/test/MC/Sparc/sparcv9-instructions.s
+++ b/llvm/test/MC/Sparc/sparcv9-instructions.s
@@ -293,3 +293,6 @@
         ! V8-NEXT: rdpr %wstate,%i5
         ! V9: rdpr %wstate, %i5         ! encoding: [0xbb,0x53,0x80,0x00]
         rdpr %wstate,%i5
+
+        ! V9: st %o1, [%o0]             ! encoding: [0xd2,0x22,0x00,0x00]
+        stw %o1, [%o0]


        


More information about the llvm-commits mailing list