-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARC][IAS] Add illtrap
alias for unimp
#105928
Conversation
This follows GNU and Solaris behavior of allowing both mnemonics all the time.
@llvm/pr-subscribers-backend-sparc Author: Koakuma (koachan) ChangesThis follows GNU and Solaris behavior of allowing both mnemonics all the time. Fixes #105639. Full diff: https://github.com/llvm/llvm-project/pull/105928.diff 2 Files Affected:
diff --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index e77b7f5c376bf4..722e0463b7bcaa 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 GNU & 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
|
@llvm/pr-subscribers-mc Author: Koakuma (koachan) ChangesThis follows GNU and Solaris behavior of allowing both mnemonics all the time. Fixes #105639. Full diff: https://github.com/llvm/llvm-project/pull/105928.diff 2 Files Affected:
diff --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index e77b7f5c376bf4..722e0463b7bcaa 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 GNU & 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
|
CC-ing @alexrp too. |
It looks like GNU as doesn't allow it when targeting V8:
|
Oh, interesting. Seems like using On the other hand Solaris does allow both mnemonics even when explicitly targeting V8:
I'm slightly leaning towards using Solaris behavior in this particular case but in any case either choice is okay by me. |
I'm not sure we should be looking at the Solaris toolchain at all. llvm-based toolchain isn't a drop-in replacement for it. |
This follows Solaris behavior of allowing both mnemonics all the time.
Fixes #105639.