[PATCH] D36741: [AArch64] Remove DecodeAuthLoadWriteback

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 08:09:11 PDT 2017


samparker created this revision.
Herald added subscribers: kristof.beyls, javed.absar, rengolin, aemerson.

The BaseAuthLoad instruction class was incorrectly passing an empty constraint string to its parent, so I have corrected this. This makes the DecodeAuthLoadWriteback function redundant, so I've also removed it.

Thanks to Ahmed for bringing this to my attention!


https://reviews.llvm.org/D36741

Files:
  lib/Target/AArch64/AArch64InstrFormats.td
  lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp


Index: lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
===================================================================
--- lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
+++ lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
@@ -1609,24 +1609,3 @@
   return Success;
 }
 
-static DecodeStatus DecodeAuthLoadWriteback(llvm::MCInst &Inst, uint32_t insn,
-                                            uint64_t Address,
-                                            const void *Decoder) {
-  unsigned Rt = fieldFromInstruction(insn, 0, 5);
-  unsigned Rn = fieldFromInstruction(insn, 5, 5);
-  unsigned Imm9 = fieldFromInstruction(insn, 12, 9);
-  unsigned S = fieldFromInstruction(insn, 22, 1);
-
-  unsigned Imm = Imm9 | (S << 9);
-
-  // Address writeback
-  DecodeGPR64spRegisterClass(Inst, Rn, Address, Decoder);
-  // Destination
-  DecodeGPR64RegisterClass(Inst, Rt, Address, Decoder);
-  // Address
-  DecodeGPR64spRegisterClass(Inst, Rn, Address, Decoder);
-  // Offset
-  DecodeSImm<10>(Inst, Imm, Address, Decoder);
-
-  return Success;
-}
Index: lib/Target/AArch64/AArch64InstrFormats.td
===================================================================
--- lib/Target/AArch64/AArch64InstrFormats.td
+++ lib/Target/AArch64/AArch64InstrFormats.td
@@ -1169,7 +1169,7 @@
 let mayLoad = 1 in
 class BaseAuthLoad<bit M, bit W, dag oops, dag iops, string asm,
                    string operands, string cstr, Operand opr>
-  : I<oops, iops, asm, operands, "", []>, Sched<[]> {
+  : I<oops, iops, asm, operands, cstr, []>, Sched<[]> {
   bits<10> offset;
   bits<5> Rn;
   bits<5> Rt;
@@ -1185,14 +1185,13 @@
 }
 
 multiclass AuthLoad<bit M, string asm, Operand opr> {
-  def indexed   : BaseAuthLoad<M, 0, (outs GPR64:$Rt), (ins GPR64sp:$Rn, opr:$offset),
+  def indexed   : BaseAuthLoad<M, 0, (outs GPR64:$Rt),
+                               (ins GPR64sp:$Rn, opr:$offset),
                                asm, "\t$Rt, [$Rn, $offset]", "", opr>;
   def writeback : BaseAuthLoad<M, 1, (outs GPR64sp:$wback, GPR64:$Rt),
                                (ins GPR64sp:$Rn, opr:$offset),
                                asm, "\t$Rt, [$Rn, $offset]!",
-                               "$Rn = $wback, at earlyclobber $wback", opr> {
-    let DecoderMethod = "DecodeAuthLoadWriteback";
-  }
+                               "$Rn = $wback, at earlyclobber $wback", opr>;
 
   def : InstAlias<asm # "\t$Rt, [$Rn]",
                   (!cast<Instruction>(NAME # "indexed") GPR64:$Rt, GPR64sp:$Rn, 0)>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36741.111167.patch
Type: text/x-patch
Size: 2513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170815/59d60f14/attachment.bin>


More information about the llvm-commits mailing list