Skip to content

Conversation

@koachan
Copy link
Contributor

@koachan koachan commented Jan 29, 2025

No description provided.

Created using spr 1.3.4
@llvmbot llvmbot added backend:Sparc llvm:mc Machine (object) code labels Jan 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 29, 2025

@llvm/pr-subscribers-backend-sparc

Author: Koakuma (koachan)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/124951.diff

2 Files Affected:

  • (modified) llvm/lib/Target/Sparc/SparcInstrAliases.td (+2)
  • (modified) llvm/test/MC/Sparc/sparc-synthetic-instructions.s (+7)
diff --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index 673a2db59b0929..cfc0b4735c91c4 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">;
+
 def : MnemonicAlias<"iflush", "flush">;
 
 def : MnemonicAlias<"stub", "stb">;
diff --git a/llvm/test/MC/Sparc/sparc-synthetic-instructions.s b/llvm/test/MC/Sparc/sparc-synthetic-instructions.s
index 5652f868419504..9c6db2836af176 100644
--- a/llvm/test/MC/Sparc/sparc-synthetic-instructions.s
+++ b/llvm/test/MC/Sparc/sparc-synthetic-instructions.s
@@ -54,6 +54,13 @@
         ! CHECK:                                 !   fixup A - offset: 0, value: %lo(2147483647), kind: fixup_sparc_lo10
         set 2147483647, %o1
 
+        !! setuw is a mnemonic alias for set.
+        ! CHECK: sethi %hi(32768), %g1            ! encoding: [0x03,0b00AAAAAA,A,A]
+        ! CHECK:                                  !   fixup A - offset: 0, value: %hi(32768), kind: fixup_sparc_hi22
+        setuw 32768, %g1
+        ! CHECK: mov 1, %g1 ! encoding: [0x82,0x10,0x20,0x01]
+        setuw 1, %g1
+
         ! CHECK: xnor %g1, %g0, %g2               ! encoding: [0x84,0x38,0x40,0x00]
         not %g1, %g2
         ! CHECK: xnor %g1, %g0, %g1               ! encoding: [0x82,0x38,0x40,0x00]

@llvmbot
Copy link
Member

llvmbot commented Jan 29, 2025

@llvm/pr-subscribers-mc

Author: Koakuma (koachan)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/124951.diff

2 Files Affected:

  • (modified) llvm/lib/Target/Sparc/SparcInstrAliases.td (+2)
  • (modified) llvm/test/MC/Sparc/sparc-synthetic-instructions.s (+7)
diff --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index 673a2db59b0929..cfc0b4735c91c4 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">;
+
 def : MnemonicAlias<"iflush", "flush">;
 
 def : MnemonicAlias<"stub", "stb">;
diff --git a/llvm/test/MC/Sparc/sparc-synthetic-instructions.s b/llvm/test/MC/Sparc/sparc-synthetic-instructions.s
index 5652f868419504..9c6db2836af176 100644
--- a/llvm/test/MC/Sparc/sparc-synthetic-instructions.s
+++ b/llvm/test/MC/Sparc/sparc-synthetic-instructions.s
@@ -54,6 +54,13 @@
         ! CHECK:                                 !   fixup A - offset: 0, value: %lo(2147483647), kind: fixup_sparc_lo10
         set 2147483647, %o1
 
+        !! setuw is a mnemonic alias for set.
+        ! CHECK: sethi %hi(32768), %g1            ! encoding: [0x03,0b00AAAAAA,A,A]
+        ! CHECK:                                  !   fixup A - offset: 0, value: %hi(32768), kind: fixup_sparc_hi22
+        setuw 32768, %g1
+        ! CHECK: mov 1, %g1 ! encoding: [0x82,0x10,0x20,0x01]
+        setuw 1, %g1
+
         ! CHECK: xnor %g1, %g0, %g2               ! encoding: [0x84,0x38,0x40,0x00]
         not %g1, %g2
         ! CHECK: xnor %g1, %g0, %g1               ! encoding: [0x82,0x38,0x40,0x00]

@koachan koachan changed the title [SPARC] Add setuw alias for set [SPARC][IAS] Add setuw alias for set Jan 29, 2025
@koachan
Copy link
Contributor Author

koachan commented Jan 31, 2025

That is odd, spr seems to be doing odd things after I updated the commit messages.
Anyway, new PR is at #125149.

@koachan koachan closed this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:Sparc llvm:mc Machine (object) code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants