[llvm] 7955760 - [SPARC][IAS] Add `illtrap` alias for `unimp` (#105928)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 05:28:42 PDT 2024


Author: Koakuma
Date: 2024-08-29T19:28:38+07:00
New Revision: 7955760bc82c792b84a4d97913f5b8e0f4902108

URL: https://github.com/llvm/llvm-project/commit/7955760bc82c792b84a4d97913f5b8e0f4902108
DIFF: https://github.com/llvm/llvm-project/commit/7955760bc82c792b84a4d97913f5b8e0f4902108.diff

LOG: [SPARC][IAS] Add `illtrap` alias for `unimp` (#105928)

This follows Solaris behavior of allowing both mnemonics all the time.

Fixes https://github.com/llvm/llvm-project/issues/105639.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index e77b7f5c376bf4..673a2db59b0929 100644
--- a/llvm/lib/Target/Sparc/SparcInstrAliases.td
+++ b/llvm/lib/Target/Sparc/SparcInstrAliases.td
@@ -601,6 +601,10 @@ def : InstAlias<"flush", (FLUSH), 0>;
 // unimp -> unimp 0
 def : InstAlias<"unimp", (UNIMP 0), 0>;
 
+// Not in spec, but we follow Solaris behavior of having `illtrap`
+// interchangeable with `unimp` all the time.
+def : MnemonicAlias<"illtrap", "unimp">;
+
 def : MnemonicAlias<"iflush", "flush">;
 
 def : MnemonicAlias<"stub", "stb">;

diff  --git a/llvm/test/MC/Sparc/sparc-misc-instructions.s b/llvm/test/MC/Sparc/sparc-misc-instructions.s
index 0547575eb3db51..8119088cd0dbb1 100644
--- a/llvm/test/MC/Sparc/sparc-misc-instructions.s
+++ b/llvm/test/MC/Sparc/sparc-misc-instructions.s
@@ -6,3 +6,9 @@
 
         ! CHECK: unimp 0   ! encoding: [0x00,0x00,0x00,0x00]
         unimp 0
+
+        ! CHECK: unimp 0   ! encoding: [0x00,0x00,0x00,0x00]
+        illtrap
+
+        ! CHECK: unimp 0   ! encoding: [0x00,0x00,0x00,0x00]
+        illtrap 0


        


More information about the llvm-commits mailing list