[llvm] 7967221 - [PowerPC] Disable more extended mne on AIX
Jinsong Ji via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 4 13:13:49 PST 2021
Author: Jinsong Ji
Date: 2021-03-04T21:13:37Z
New Revision: 7967221a726370dc5dc44379ea1d58f952f4e274
URL: https://github.com/llvm/llvm-project/commit/7967221a726370dc5dc44379ea1d58f952f4e274
DIFF: https://github.com/llvm/llvm-project/commit/7967221a726370dc5dc44379ea1d58f952f4e274.diff
LOG: [PowerPC] Disable more extended mne on AIX
To avoid assembler errors.
Reviewed By: sfertile
Differential Revision: https://reviews.llvm.org/D97418
Added:
Modified:
llvm/lib/Target/PowerPC/PPCInstr64Bit.td
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCInstr64Bit.td b/llvm/lib/Target/PowerPC/PPCInstr64Bit.td
index 03e9d6970a30..4dbb6ce4f8ce 100644
--- a/llvm/lib/Target/PowerPC/PPCInstr64Bit.td
+++ b/llvm/lib/Target/PowerPC/PPCInstr64Bit.td
@@ -989,9 +989,9 @@ def : InstAlias<"mfxer $Rx", (MFSPR8 g8rc:$Rx, 1)>;
//Disable this alias on AIX for now because as does not support them.
let Predicates = [ModernAs] in {
- def : InstAlias<"mtudscr $Rx", (MTSPR8 3, g8rc:$Rx)>;
- def : InstAlias<"mfudscr $Rx", (MFSPR8 g8rc:$Rx, 3)>;
-}
+
+def : InstAlias<"mtudscr $Rx", (MTSPR8 3, g8rc:$Rx)>;
+def : InstAlias<"mfudscr $Rx", (MFSPR8 g8rc:$Rx, 3)>;
def : InstAlias<"mfrtcu $Rx", (MFSPR8 g8rc:$Rx, 4)>;
def : InstAlias<"mfrtcl $Rx", (MFSPR8 g8rc:$Rx, 5)>;
@@ -1050,6 +1050,8 @@ def : InstAlias<"mfpvr $RT", (MFSPR8 g8rc:$RT, 287)>;
def : InstAlias<"mfspefscr $Rx", (MFSPR8 g8rc:$Rx, 512)>;
def : InstAlias<"mtspefscr $Rx", (MTSPR8 512, g8rc:$Rx)>;
+}
+
//===----------------------------------------------------------------------===//
// Load/Store instructions.
//
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
index 41f268758913..5ad0d270ca26 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -4646,6 +4646,12 @@ def : InstAlias<"mftbu $Rx", (MFTB gprc:$Rx, 269)>;
def : InstAlias<"xnop", (XORI R0, R0, 0)>;
+def : InstAlias<"mtxer $Rx", (MTSPR 1, gprc:$Rx)>;
+def : InstAlias<"mfxer $Rx", (MFSPR gprc:$Rx, 1)>;
+
+//Disable this alias on AIX for now because as does not support them.
+let Predicates = [ModernAs] in {
+
foreach BR = 0-7 in {
def : InstAlias<"mfbr"#BR#" $Rx",
(MFDCR gprc:$Rx, !add(BR, 0x80))>,
@@ -4657,15 +4663,8 @@ foreach BR = 0-7 in {
def : InstAlias<"mtmsrd $RS", (MTMSRD gprc:$RS, 0)>;
def : InstAlias<"mtmsr $RS", (MTMSR gprc:$RS, 0)>;
-
-def : InstAlias<"mtxer $Rx", (MTSPR 1, gprc:$Rx)>;
-def : InstAlias<"mfxer $Rx", (MFSPR gprc:$Rx, 1)>;
-
-//Disable this alias on AIX for now because as does not support them.
-let Predicates = [ModernAs] in {
def : InstAlias<"mtudscr $Rx", (MTSPR 3, gprc:$Rx)>;
def : InstAlias<"mfudscr $Rx", (MFSPR gprc:$Rx, 3)>;
-}
def : InstAlias<"mfrtcu $Rx", (MFSPR gprc:$Rx, 4)>;
def : InstAlias<"mfrtcl $Rx", (MFSPR gprc:$Rx, 5)>;
@@ -4795,6 +4794,7 @@ def : InstAlias<"mfdccr $Rx", (MFSPR gprc:$Rx, 1018)>, Requires<[IsPPC4xx]>;
def : InstAlias<"mticcr $Rx", (MTSPR 1019, gprc:$Rx)>, Requires<[IsPPC4xx]>;
def : InstAlias<"mficcr $Rx", (MFSPR gprc:$Rx, 1019)>, Requires<[IsPPC4xx]>;
+}
def : InstAlias<"tlbie $RB", (TLBIE R0, gprc:$RB)>;
diff --git a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt
index 903217a1dfc3..ad5020023ba4 100644
--- a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt
+++ b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt
@@ -2235,16 +2235,20 @@
# CHECK: mfctr 2
0x7c 0x49 0x02 0xa6
-# CHECK: mtuamr 2
+# MODERN: mtuamr 2
+# OLD: mtspr 13, 2
0x7c 0x4d 0x03 0xa6
-# CHECK: mfuamr 2
+# MODERN: mfuamr 2
+# OLD: mfspr 2, 13
0x7c 0x4d 0x02 0xa6
-# CHECK: mtppr 2
+# MODERN: mtppr 2
+# OLD: mtspr 896, 2
0x7c 0x40 0xe3 0xa6
-# CHECK: mfppr 2
+# MODERN: mfppr 2
+# OLD: mfspr 2, 896
0x7c 0x40 0xe2 0xa6
# CHECK: nop
More information about the llvm-commits
mailing list