[llvm] 498f108 - [SPARC][IAS] Add `setuw` alias for `set`

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 08:15:42 PST 2025


Author: Koakuma
Date: 2025-02-03T23:15:39+07:00
New Revision: 498f108cc859e2dda7720f5bc121952594c97cc3

URL: https://github.com/llvm/llvm-project/commit/498f108cc859e2dda7720f5bc121952594c97cc3
DIFF: https://github.com/llvm/llvm-project/commit/498f108cc859e2dda7720f5bc121952594c97cc3.diff

LOG: [SPARC][IAS] Add `setuw` alias for `set`



Reviewers: s-barannikov, brad0, rorth

Reviewed By: s-barannikov

Pull Request: https://github.com/llvm/llvm-project/pull/125149

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index 673a2db59b0929b..906f51bb8d10b25 100644
--- a/llvm/lib/Target/Sparc/SparcInstrAliases.td
+++ b/llvm/lib/Target/Sparc/SparcInstrAliases.td
@@ -605,6 +605,8 @@ def : InstAlias<"unimp", (UNIMP 0), 0>;
 // interchangeable with `unimp` all the time.
 def : MnemonicAlias<"illtrap", "unimp">;
 
+def : MnemonicAlias<"setuw", "set">, Requires<[HasV9]>;
+
 def : MnemonicAlias<"iflush", "flush">;
 
 def : MnemonicAlias<"stub", "stb">;

diff  --git a/llvm/test/MC/Sparc/sparcv9-synthetic-instructions.s b/llvm/test/MC/Sparc/sparcv9-synthetic-instructions.s
index d387e56bf02a342..f8a99cd1bdf5ebd 100644
--- a/llvm/test/MC/Sparc/sparcv9-synthetic-instructions.s
+++ b/llvm/test/MC/Sparc/sparcv9-synthetic-instructions.s
@@ -78,3 +78,11 @@ setx (0x0123456700000000+0x0000000089abcdef), %g1, %o0
 ! V9: sllx %g1, 32, %g1                       ! encoding: [0x83,0x28,0x70,0x20]
 ! V9: or %g1, %o0, %o0                        ! encoding: [0x90,0x10,0x40,0x08]
 setx (.BB1-.BB0), %g1, %o0
+
+!! In V9, setuw is a mnemonic alias for set.
+! V8:      error: invalid instruction mnemonic
+! V9: sethi %hi(32768), %g1            ! encoding: [0x03,0b00AAAAAA,A,A]
+! V9:                                  !   fixup A - offset: 0, value: %hi(32768), kind: fixup_sparc_hi22
+setuw 32768, %g1
+! V9: mov 1, %g1 ! encoding: [0x82,0x10,0x20,0x01]
+setuw 1, %g1


        


More information about the llvm-commits mailing list