[LLVM][AArch64] Remove aliases of LSUI instructions (#126072)

Removes MnemonicAliases added for instructions available with
the LSUI feature (e.g. CAS -> CAST) which are not equivalent.
The aliases stt[add|clr|set]a & stt[add|clr|set]al are also removed.
This commit is contained in:
Kerry McLaughlin
2025-02-13 09:43:16 +00:00
committed by GitHub
parent b7baf2ee8d
commit d44d806faa
4 changed files with 22 additions and 128 deletions

View File

@@ -12538,26 +12538,19 @@ multiclass STOPregister<string asm, string instr> {
!cast<Instruction>(instr # "X")>;
}
let Predicates = [HasLSUI] in
class BaseSTOPregisterLSUI<string asm, RegisterClass OP, Register Reg,
Instruction inst> :
InstAlias<asm # "\t$Rs, [$Rn]", (inst Reg, OP:$Rs, GPR64sp:$Rn)>;
InstAlias<asm # "\t$Rs, [$Rn]", (inst Reg, OP:$Rs, GPR64sp:$Rn), 0>;
multiclass STOPregisterLSUI<string asm, string instr> {
def : BaseSTOPregisterLSUI<asm # "a", GPR32, WZR,
def : BaseSTOPregisterLSUI<asm # "l", GPR32, WZR,
!cast<Instruction>(instr # "LW")>;
def : BaseSTOPregisterLSUI<asm # "l", GPR64, XZR,
!cast<Instruction>(instr # "LX")>;
def : BaseSTOPregisterLSUI<asm, GPR32, WZR,
!cast<Instruction>(instr # "W")>;
def : BaseSTOPregisterLSUI<asm # "a", GPR64, XZR,
!cast<Instruction>(instr # "X")>;
def : BaseSTOPregisterLSUI<asm # "l", GPR32, WZR,
!cast<Instruction>(instr # "W")>;
def : BaseSTOPregisterLSUI<asm # "l", GPR64, XZR,
!cast<Instruction>(instr # "X")>;
def : BaseSTOPregisterLSUI<asm # "al", GPR32, WZR,
!cast<Instruction>(instr # "W")>;
def : BaseSTOPregisterLSUI<asm # "al", GPR64, XZR,
!cast<Instruction>(instr # "X")>;
def : BaseSTOPregisterLSUI<asm, GPR32, WZR,
!cast<Instruction>(instr # "W")>;
def : BaseSTOPregisterLSUI<asm, GPR64, XZR,
def : BaseSTOPregisterLSUI<asm, GPR64, XZR,
!cast<Instruction>(instr # "X")>;
}

View File

@@ -2665,21 +2665,11 @@ defm CASLT : CompareAndSwapUnprivileged<0b11, 0, 1, "l">;
defm CASAT : CompareAndSwapUnprivileged<0b11, 1, 0, "a">;
defm CASALT : CompareAndSwapUnprivileged<0b11, 1, 1, "al">;
def : MnemonicAlias<"cas", "cast">;
def : MnemonicAlias<"casl", "caslt">;
def : MnemonicAlias<"casa", "casat">;
def : MnemonicAlias<"casal", "casalt">;
// v9.6-a atomic CASPT
defm CASPT : CompareAndSwapPairUnprivileged<0b01, 0, 0, "">;
defm CASPLT : CompareAndSwapPairUnprivileged<0b01, 0, 1, "l">;
defm CASPAT : CompareAndSwapPairUnprivileged<0b01, 1, 0, "a">;
defm CASPALT : CompareAndSwapPairUnprivileged<0b01, 1, 1, "al">;
def : MnemonicAlias<"casp", "caspt">;
def : MnemonicAlias<"caspl", "casplt">;
def : MnemonicAlias<"caspa", "caspat">;
def : MnemonicAlias<"caspal", "caspalt">;
}
// v8.1 atomic SWP
@@ -2694,11 +2684,6 @@ let Predicates = [HasLSUI] in {
defm SWPTA : SwapLSUI<1, 0, "a">;
defm SWPTL : SwapLSUI<0, 1, "l">;
defm SWPTAL : SwapLSUI<1, 1, "al">;
def : MnemonicAlias<"swp", "swpt">;
def : MnemonicAlias<"swpa", "swpta">;
def : MnemonicAlias<"swpl", "swptl">;
def : MnemonicAlias<"swpal", "swptal">;
}
// v9.6-a unprivileged atomic LD<OP> (FEAT_LSUI)
@@ -4863,22 +4848,14 @@ let Predicates = [HasLSUI] in {
defm LDTXRW : LoadUnprivilegedLSUI<0b10, GPR32, "ldtxr">;
defm LDTXRX : LoadUnprivilegedLSUI<0b11, GPR64, "ldtxr">;
def : MnemonicAlias<"ldxr", "ldtxr">;
def LDATXRW : LoadExclusiveLSUI <0b10, 1, 1, GPR32, "ldatxr">;
def LDATXRX : LoadExclusiveLSUI <0b11, 1, 1, GPR64, "ldatxr">;
def : MnemonicAlias<"ldaxr", "ldatxr">;
defm STTXRW : StoreUnprivilegedLSUI<0b10, GPR32, "sttxr">;
defm STTXRX : StoreUnprivilegedLSUI<0b11, GPR64, "sttxr">;
def : MnemonicAlias<"stxr", "sttxr">;
def STLTXRW : StoreExclusiveLSUI<0b10, 0, 1, GPR32, "stltxr">;
def STLTXRX : StoreExclusiveLSUI<0b11, 0, 1, GPR64, "stltxr">;
def : MnemonicAlias<"stlxr", "stltxr">;
}
//===----------------------------------------------------------------------===//

View File

@@ -7,6 +7,8 @@
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mcpu=tsv110 -show-encoding < %s 2> %t | FileCheck %s
// RUN: FileCheck -check-prefix=CHECK-ERROR < %t %s
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r -show-encoding < %s 2> %t | FileCheck %s
// RUN: FileCheck -check-prefix=CHECK-ERROR < %t %s
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.1a,+lse,+lsui -show-encoding < %s 2> %t | FileCheck %s
// RUN: FileCheck -check-prefix=CHECK-ERROR < %t %s
.text

View File

@@ -313,42 +313,16 @@ _func:
// ERROR: instruction requires: lsui
sttaddl w0, [x2]
// CHECK: ldtadd w0, wzr, [x2] // encoding: [0x5f,0x04,0x20,0x19]
// CHECK: ldtaddl w0, wzr, [x2] // encoding: [0x5f,0x04,0x60,0x19]
// ERROR: instruction requires: lsui
sttaddl w2, [sp]
// CHECK: ldtadd w2, wzr, [sp] // encoding: [0xff,0x07,0x22,0x19]
// CHECK: ldtaddl w2, wzr, [sp] // encoding: [0xff,0x07,0x62,0x19]
// ERROR: instruction requires: lsui
sttaddl x0, [x2]
// CHECK: ldtadd x0, xzr, [x2] // encoding: [0x5f,0x04,0x20,0x59]
// CHECK: ldtaddl x0, xzr, [x2] // encoding: [0x5f,0x04,0x60,0x59]
// ERROR: instruction requires: lsui
sttaddl x2, [sp]
// CHECK: ldtadd x2, xzr, [sp] // encoding: [0xff,0x07,0x22,0x59]
// ERROR: instruction requires: lsui
sttadda w0, [x2]
// CHECK: ldtadd w0, wzr, [x2] // encoding: [0x5f,0x04,0x20,0x19]
// ERROR: instruction requires: lsui
sttadda w2, [sp]
// CHECK: ldtadd w2, wzr, [sp] // encoding: [0xff,0x07,0x22,0x19]
// ERROR: instruction requires: lsui
sttadda x0, [x2]
// CHECK: ldtadd x0, xzr, [x2] // encoding: [0x5f,0x04,0x20,0x59]
// ERROR: instruction requires: lsui
sttadda x2, [sp]
// CHECK: ldtadd x2, xzr, [sp] // encoding: [0xff,0x07,0x22,0x59]
// ERROR: instruction requires: lsui
sttaddal w0, [x2]
// CHECK: ldtadd w0, wzr, [x2] // encoding: [0x5f,0x04,0x20,0x19]
// ERROR: instruction requires: lsui
sttaddal w2, [sp]
// CHECK: ldtadd w2, wzr, [sp] // encoding: [0xff,0x07,0x22,0x19]
// ERROR: instruction requires: lsui
sttaddal x0, [x2]
// CHECK: ldtadd x0, xzr, [x2] // encoding: [0x5f,0x04,0x20,0x59]
// ERROR: instruction requires: lsui
sttaddal x2, [sp]
// CHECK: ldtadd x2, xzr, [sp] // encoding: [0xff,0x07,0x22,0x59]
// CHECK: ldtaddl x2, xzr, [sp] // encoding: [0xff,0x07,0x62,0x59]
// ERROR: instruction requires: lsui
sttclr w0, [x2]
@@ -362,45 +336,19 @@ _func:
// ERROR: instruction requires: lsui
sttclr x2, [sp]
// CHECK: ldtclr x2, xzr, [sp] // encoding: [0xff,0x17,0x22,0x59]
// ERROR: instruction requires: lsui
sttclra w0, [x2]
// CHECK: ldtclr w0, wzr, [x2] // encoding: [0x5f,0x14,0x20,0x19]
// ERROR: instruction requires: lsui
sttclra w2, [sp]
// CHECK: ldtclr w2, wzr, [sp] // encoding: [0xff,0x17,0x22,0x19]
// ERROR: instruction requires: lsui
sttclra x0, [x2]
// CHECK: ldtclr x0, xzr, [x2] // encoding: [0x5f,0x14,0x20,0x59]
// ERROR: instruction requires: lsui
sttclra x2, [sp]
// CHECK: ldtclr x2, xzr, [sp] // encoding: [0xff,0x17,0x22,0x59]
// ERROR: instruction requires: lsui
sttclrl w0, [x2]
// CHECK: ldtclr w0, wzr, [x2] // encoding: [0x5f,0x14,0x20,0x19]
// CHECK: ldtclrl w0, wzr, [x2] // encoding: [0x5f,0x14,0x60,0x19]
// ERROR: instruction requires: lsui
sttclrl w2, [sp]
// CHECK: ldtclr w2, wzr, [sp] // encoding: [0xff,0x17,0x22,0x19]
// CHECK: ldtclrl w2, wzr, [sp] // encoding: [0xff,0x17,0x62,0x19]
// ERROR: instruction requires: lsui
sttclrl x0, [x2]
// CHECK: ldtclr x0, xzr, [x2] // encoding: [0x5f,0x14,0x20,0x59]
// CHECK: ldtclrl x0, xzr, [x2] // encoding: [0x5f,0x14,0x60,0x59]
// ERROR: instruction requires: lsui
sttclrl x2, [sp]
// CHECK: ldtclr x2, xzr, [sp] // encoding: [0xff,0x17,0x22,0x59]
// ERROR: instruction requires: lsui
sttclral w0, [x2]
// CHECK: ldtclr w0, wzr, [x2] // encoding: [0x5f,0x14,0x20,0x19]
// ERROR: instruction requires: lsui
sttclral x2, [sp]
// CHECK: ldtclr x2, xzr, [sp] // encoding: [0xff,0x17,0x22,0x59]
// ERROR: instruction requires: lsui
sttclral x0, [x2]
// CHECK: ldtclr x0, xzr, [x2] // encoding: [0x5f,0x14,0x20,0x59]
// ERROR: instruction requires: lsui
sttclral x2, [sp]
// CHECK: ldtclr x2, xzr, [sp] // encoding: [0xff,0x17,0x22,0x59]
// CHECK: ldtclrl x2, xzr, [sp] // encoding: [0xff,0x17,0x62,0x59]
// ERROR: instruction requires: lsui
sttset w0, [x2]
@@ -414,45 +362,19 @@ _func:
// ERROR: instruction requires: lsui
sttset x2, [sp]
// CHECK: ldtset x2, xzr, [sp] // encoding: [0xff,0x37,0x22,0x59]
// ERROR: instruction requires: lsui
sttseta w0, [x2]
// CHECK: ldtset w0, wzr, [x2] // encoding: [0x5f,0x34,0x20,0x19]
// ERROR: instruction requires: lsui
sttseta w2, [sp]
// CHECK: ldtset w2, wzr, [sp] // encoding: [0xff,0x37,0x22,0x19]
// ERROR: instruction requires: lsui
sttseta x0, [x2]
// CHECK: ldtset x0, xzr, [x2] // encoding: [0x5f,0x34,0x20,0x59]
// ERROR: instruction requires: lsui
sttseta x2, [sp]
// CHECK: ldtset x2, xzr, [sp] // encoding: [0xff,0x37,0x22,0x59]
// ERROR: instruction requires: lsui
sttsetl w0, [x2]
// CHECK: ldtset w0, wzr, [x2] // encoding: [0x5f,0x34,0x20,0x19]
// CHECK: ldtsetl w0, wzr, [x2] // encoding: [0x5f,0x34,0x60,0x19]
// ERROR: instruction requires: lsui
sttsetl w2, [sp]
// CHECK: ldtset w2, wzr, [sp] // encoding: [0xff,0x37,0x22,0x19]
// CHECK: ldtsetl w2, wzr, [sp] // encoding: [0xff,0x37,0x62,0x19]
// ERROR: instruction requires: lsui
sttsetl x0, [x2]
// CHECK: ldtset x0, xzr, [x2] // encoding: [0x5f,0x34,0x20,0x59]
// CHECK: ldtsetl x0, xzr, [x2] // encoding: [0x5f,0x34,0x60,0x59]
// ERROR: instruction requires: lsui
sttsetl x2, [sp]
// CHECK: ldtset x2, xzr, [sp] // encoding: [0xff,0x37,0x22,0x59]
// ERROR: instruction requires: lsui
sttsetal w0, [x2]
// CHECK: ldtset w0, wzr, [x2] // encoding: [0x5f,0x34,0x20,0x19]
// ERROR: instruction requires: lsui
sttsetal x2, [sp]
// CHECK: ldtset x2, xzr, [sp] // encoding: [0xff,0x37,0x22,0x59]
// ERROR: instruction requires: lsui
sttsetal x0, [x2]
// CHECK: ldtset x0, xzr, [x2] // encoding: [0x5f,0x34,0x20,0x59]
// ERROR: instruction requires: lsui
sttsetal x2, [sp]
// CHECK: ldtset x2, xzr, [sp] // encoding: [0xff,0x37,0x22,0x59]
// CHECK: ldtsetl x2, xzr, [sp] // encoding: [0xff,0x37,0x62,0x59]
// ERROR: instruction requires: lsui
//------------------------------------------------------------------------------