[llvm] r357395 - [AArch64] Add v8.5-a Memory Tagging STGM/LDGM instructions
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 1 07:52:18 PDT 2019
Author: davidspickett
Date: Mon Apr 1 07:52:18 2019
New Revision: 357395
URL: http://llvm.org/viewvc/llvm-project?rev=357395&view=rev
Log:
[AArch64] Add v8.5-a Memory Tagging STGM/LDGM instructions
The STGV/LDGV instructions were replaced with
STGM/LDGM. The encodings remain the same but there
is no longer writeback so there are no unpredictable
encodings to check for.
The specfication can be found here:
https://developer.arm.com/docs/ddi0596/c
Differential Revision: https://reviews.llvm.org/D60064
Removed:
llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte-unpredictable.txt
Modified:
llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td
llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
llvm/trunk/test/MC/AArch64/armv8.5a-mte-error.s
llvm/trunk/test/MC/AArch64/armv8.5a-mte.s
llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte.txt
Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td?rev=357395&r1=357394&r2=357395&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td Mon Apr 1 07:52:18 2019
@@ -4024,7 +4024,7 @@ class BaseMemTag<bits<2> opc1, bits<2> o
class MemTagVector<bit Load, string asm_insn, string asm_opnds,
dag oops, dag iops>
: BaseMemTag<{0b1, Load}, 0b00, asm_insn, asm_opnds,
- "$Rn = $wback, at earlyclobber $wback", oops, iops> {
+ "", oops, iops> {
bits<5> Rt;
let Inst{20-12} = 0b000000000;
Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td?rev=357395&r1=357394&r2=357395&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td Mon Apr 1 07:52:18 2019
@@ -1256,12 +1256,11 @@ def : InstAlias<"cmpp $lhs, $rhs", (SUBP
def LDG : MemTagLoad<"ldg", "\t$Rt, [$Rn, $offset]">;
def : InstAlias<"ldg $Rt, [$Rn]", (LDG GPR64:$Rt, GPR64sp:$Rn, 0), 1>;
-def LDGV : MemTagVector<1, "ldgv", "\t$Rt, [$Rn]!",
- (outs GPR64sp:$wback, GPR64:$Rt), (ins GPR64sp:$Rn)> {
- let DecoderMethod = "DecodeLoadAllocTagArrayInstruction";
-}
-def STGV : MemTagVector<0, "stgv", "\t$Rt, [$Rn]!",
- (outs GPR64sp:$wback), (ins GPR64:$Rt, GPR64sp:$Rn)>;
+def LDGM : MemTagVector<1, "ldgm", "\t$Rt, [$Rn]",
+ (outs GPR64:$Rt), (ins GPR64sp:$Rn)>;
+def STGM : MemTagVector<0, "stgm", "\t$Rt, [$Rn]",
+ (outs), (ins GPR64:$Rt, GPR64sp:$Rn)>;
+
defm STG : MemTagStore<0b00, "stg">;
defm STZG : MemTagStore<0b01, "stzg">;
Modified: llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp?rev=357395&r1=357394&r2=357395&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp Mon Apr 1 07:52:18 2019
@@ -4096,15 +4096,6 @@ bool AArch64AsmParser::validateInstructi
"unpredictable STXP instruction, status is also a source");
break;
}
- case AArch64::LDGV: {
- unsigned Rt = Inst.getOperand(0).getReg();
- unsigned Rn = Inst.getOperand(1).getReg();
- if (RI->isSubRegisterEq(Rt, Rn)) {
- return Error(Loc[0],
- "unpredictable LDGV instruction, writeback register is also "
- "the target register");
- }
- }
}
Modified: llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp?rev=357395&r1=357394&r2=357395&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp Mon Apr 1 07:52:18 2019
@@ -219,11 +219,6 @@ static DecodeStatus DecodeImm8OptLsl(MCI
static DecodeStatus DecodeSVEIncDecImm(MCInst &Inst, unsigned Imm,
uint64_t Addr, const void *Decoder);
-static DecodeStatus DecodeLoadAllocTagArrayInstruction(MCInst &Inst,
- uint32_t insn,
- uint64_t address,
- const void* Decoder);
-
static bool Check(DecodeStatus &Out, DecodeStatus In) {
switch (In) {
case MCDisassembler::Success:
@@ -1851,25 +1846,3 @@ static DecodeStatus DecodeSVEIncDecImm(M
Inst.addOperand(MCOperand::createImm(Imm + 1));
return Success;
}
-
-static DecodeStatus DecodeLoadAllocTagArrayInstruction(MCInst &Inst,
- uint32_t insn,
- uint64_t address,
- const void* Decoder) {
- unsigned Rn = fieldFromInstruction(insn, 5, 5);
- unsigned Rt = fieldFromInstruction(insn, 0, 5);
-
- // Outputs
- DecodeGPR64spRegisterClass(Inst, Rn, address, Decoder);
- DecodeGPR64RegisterClass(Inst, Rt, address, Decoder);
-
- // Input (Rn again)
- Inst.addOperand(Inst.getOperand(0));
-
- //Do this post decode since the raw number for xzr and sp is the same
- if (Inst.getOperand(0).getReg() == Inst.getOperand(1).getReg()) {
- return SoftFail;
- } else {
- return Success;
- }
-}
Modified: llvm/trunk/test/MC/AArch64/armv8.5a-mte-error.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/armv8.5a-mte-error.s?rev=357395&r1=357394&r2=357395&view=diff
==============================================================================
--- llvm/trunk/test/MC/AArch64/armv8.5a-mte-error.s (original)
+++ llvm/trunk/test/MC/AArch64/armv8.5a-mte-error.s Mon Apr 1 07:52:18 2019
@@ -813,57 +813,48 @@ ldg x0, [w1]
// CHECK: invalid operand for instruction
// CHECK-NEXT: ldg x0, [w1]
-ldgv
-ldgv x0
-ldgv x0, [x1]
-ldgv sp, [x0]!
-ldgv x3, [x3]!
-ldgv w0, [x1]!
-ldgv x0, [w1]!
-ldgv #1, [x1]!
-ldgv x0, [#1]!
+ldgm
+ldgm x0
+ldgm w0, [x1]
+ldgm x0, [w1]
+ldgm #1, [x1]
+ldgm x0, [#1]
+ldgm sp, [x0]
// CHECK: too few operands for instruction
-// CHECK-NEXT: ldgv
+// CHECK-NEXT: ldgm
// CHECK: too few operands for instruction
-// CHECK-NEXT: ldgv x0
-// CHECK: too few operands for instruction
-// CHECK-NEXT: ldgv x0, [x1]
+// CHECK-NEXT: ldgm x0
// CHECK: invalid operand for instruction
-// CHECK-NEXT: ldgv sp, [x0]!
-// CHECK: unpredictable LDGV instruction, writeback register is also the target register
-// CHECK-NEXT: ldgv x3, [x3]!
+// CHECK-NEXT: ldgm w0, [x1]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: ldgv w0, [x1]!
+// CHECK-NEXT: ldgm x0, [w1]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: ldgv x0, [w1]!
+// CHECK-NEXT: ldgm #1, [x1]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: ldgv #1, [x1]!
+// CHECK-NEXT: ldgm x0, [#1]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: ldgv x0, [#1]!
+// CHECK-NEXT: ldgm sp, [x0]
-stgv
-stgv x0
-stgv x0, [x1]
-stgv sp, [x0]!
-stgv w0, [x0]!
-stgv x0, [w0]!
-stgv #1, [x1]!
-stgv x0, [#1]!
+stgm
+stgm x0
+stgm sp, [x0]
+stgm w0, [x0]
+stgm x0, [w0]
+stgm #1, [x1]
+stgm x0, [#1]
// CHECK: too few operands for instruction
-// CHECK-NEXT: stgv
-// CHECK: too few operands for instruction
-// CHECK-NEXT: stgv x0
+// CHECK-NEXT: stgm
// CHECK: too few operands for instruction
-// CHECK-NEXT: stgv x0, [x1]
+// CHECK-NEXT: stgm x0
// CHECK: invalid operand for instruction
-// CHECK-NEXT: stgv sp, [x0]!
+// CHECK-NEXT: stgm sp, [x0]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: stgv w0, [x0]!
+// CHECK-NEXT: stgm w0, [x0]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: stgv x0, [w0]!
+// CHECK-NEXT: stgm x0, [w0]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: stgv #1, [x1]!
+// CHECK-NEXT: stgm #1, [x1]
// CHECK: invalid operand for instruction
-// CHECK-NEXT: stgv x0, [#1]!
+// CHECK-NEXT: stgm x0, [#1]
Modified: llvm/trunk/test/MC/AArch64/armv8.5a-mte.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/armv8.5a-mte.s?rev=357395&r1=357394&r2=357395&view=diff
==============================================================================
--- llvm/trunk/test/MC/AArch64/armv8.5a-mte.s (original)
+++ llvm/trunk/test/MC/AArch64/armv8.5a-mte.s Mon Apr 1 07:52:18 2019
@@ -534,24 +534,24 @@ ldg x3, [x4, #4080]
// NOMTE: instruction requires: mte
// NOMTE: instruction requires: mte
-ldgv x0, [x1]!
-ldgv x1, [sp]!
-ldgv xzr, [x2]!
+ldgm x0, [x1]
+ldgm x1, [sp]
+ldgm xzr, [x2]
-// CHECK: ldgv x0, [x1]! // encoding: [0x20,0x00,0xe0,0xd9]
-// CHECK: ldgv x1, [sp]! // encoding: [0xe1,0x03,0xe0,0xd9]
-// CHECK: ldgv xzr, [x2]! // encoding: [0x5f,0x00,0xe0,0xd9]
+// CHECK: ldgm x0, [x1] // encoding: [0x20,0x00,0xe0,0xd9]
+// CHECK: ldgm x1, [sp] // encoding: [0xe1,0x03,0xe0,0xd9]
+// CHECK: ldgm xzr, [x2] // encoding: [0x5f,0x00,0xe0,0xd9]
// NOMTE: instruction requires: mte
// NOMTE: instruction requires: mte
-stgv x0, [x1]!
-stgv x1, [sp]!
-stgv xzr, [x2]!
+stgm x0, [x1]
+stgm x1, [sp]
+stgm xzr, [x2]
-// CHECK: stgv x0, [x1]! // encoding: [0x20,0x00,0xa0,0xd9]
-// CHECK: stgv x1, [sp]! // encoding: [0xe1,0x03,0xa0,0xd9]
-// CHECK: stgv xzr, [x2]! // encoding: [0x5f,0x00,0xa0,0xd9]
+// CHECK: stgm x0, [x1] // encoding: [0x20,0x00,0xa0,0xd9]
+// CHECK: stgm x1, [sp] // encoding: [0xe1,0x03,0xa0,0xd9]
+// CHECK: stgm xzr, [x2] // encoding: [0x5f,0x00,0xa0,0xd9]
// NOMTE: instruction requires: mte
// NOMTE: instruction requires: mte
Removed: llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte-unpredictable.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte-unpredictable.txt?rev=357394&view=auto
==============================================================================
--- llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte-unpredictable.txt (original)
+++ llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte-unpredictable.txt (removed)
@@ -1,7 +0,0 @@
-# RUN: llvm-mc -triple=aarch64 -mattr=+mte -disassemble < %s 2>&1 | FileCheck %s
-
-# ldgv x1, [x1]!
-[0x21,0x00,0xe0,0xd9]
-
-# CHECK: warning: potentially undefined instruction encoding
-# CHECK-NEXT: [0x21,0x00,0xe0,0xd9]
Modified: llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte.txt?rev=357395&r1=357394&r2=357395&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte.txt (original)
+++ llvm/trunk/test/MC/Disassembler/AArch64/armv8.5a-mte.txt Mon Apr 1 07:52:18 2019
@@ -408,12 +408,12 @@
[0xe1,0x03,0xa0,0xd9]
[0x5f,0x00,0xa0,0xd9]
-# CHECK: ldgv x0, [x1]!
-# CHECK: ldgv x1, [sp]!
-# CHECK: ldgv xzr, [x2]!
-# CHECK: stgv x0, [x1]!
-# CHECK: stgv x1, [sp]!
-# CHECK: stgv xzr, [x2]!
+# CHECK: ldgm x0, [x1]
+# CHECK: ldgm x1, [sp]
+# CHECK: ldgm xzr, [x2]
+# CHECK: stgm x0, [x1]
+# CHECK: stgm x1, [sp]
+# CHECK: stgm xzr, [x2]
# NOMTE: warning: invalid instruction encoding
# NOMTE-NEXT: [0x20,0x00,0xe0,0xd9]
More information about the llvm-commits
mailing list