[PATCH] D74822: [AArch64][ASMParser] Refuse equal source/destination for LDRAA/LDRAB
Pierre van Houtryve via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 19 02:32:50 PST 2020
Pierre-vh created this revision.
Pierre-vh added reviewers: DavidSpickett, dmgreen, ostannard.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74822
Files:
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/test/MC/AArch64/armv8.3a-diagnostics.s
Index: llvm/test/MC/AArch64/armv8.3a-diagnostics.s
===================================================================
--- llvm/test/MC/AArch64/armv8.3a-diagnostics.s
+++ llvm/test/MC/AArch64/armv8.3a-diagnostics.s
@@ -18,3 +18,7 @@
// CHECK: error: index must be a multiple of 8 in range [-4096, 4088].
ldrab x0, [x1, 4086]
// CHECK: error: index must be a multiple of 8 in range [-4096, 4088].
+ ldraa x0, [x0, -4096]!
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unpredictable LDRA instruction, writeback base is also a source
+ ldrab x0, [x0, -4096]!
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unpredictable LDRA instruction, writeback base is also a source
Index: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
===================================================================
--- llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -4114,6 +4114,15 @@
"unpredictable STXP instruction, status is also a source");
break;
}
+ case AArch64::LDRABwriteback:
+ case AArch64::LDRAAwriteback: {
+ unsigned Xt = Inst.getOperand(0).getReg();
+ unsigned Xn = Inst.getOperand(1).getReg();
+ if (Xt == Xn)
+ return Error(Loc[0],
+ "unpredictable LDRA instruction, writeback base is also a source");
+ break;
+ }
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74822.245358.patch
Type: text/x-patch
Size: 1349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200219/3b1b28f6/attachment.bin>
More information about the llvm-commits
mailing list