[PATCH] D77463: [ARM] Remove condition that could never be true
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 7 02:10:17 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG14c1e987546e: [ARM] Remove condition that could never be true (authored by psmith).
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77463/new/
https://reviews.llvm.org/D77463
Files:
llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/test/MC/Disassembler/ARM/invalid-armv7.txt
Index: llvm/test/MC/Disassembler/ARM/invalid-armv7.txt
===================================================================
--- llvm/test/MC/Disassembler/ARM/invalid-armv7.txt
+++ llvm/test/MC/Disassembler/ARM/invalid-armv7.txt
@@ -146,7 +146,30 @@
# CHECK: potentially undefined instruction encoding
# CHECK-NEXT: [0x05 0x70 0xd7 0xe6]
+#------------------------------------------------------------------------------
+# Undefined encodings for ldrexd
+#------------------------------------------------------------------------------
+# Opcode=242 Name=LDREXD Format=ARM_FORMAT_LDSTEX(6)
+# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+# -------------------------------------------------------------------------------------------------
+# | 1: 1: 1: 0| 0: 0: 0: 1| 1: 0: 1: 1| 0: 0: 1: 1| 0: 0: 0: 1| 1: 1: 1: 1| 1: 0: 0: 1| 1: 1: 1: 1|
+# -------------------------------------------------------------------------------------------------
+#
+
+# ARM v8 Architecture Reference Manual F5.1.84 LDREXD
+# t = UInt(Rt); t2 = t + 1; n = UInt(Rn);
+# if Rt<0> == '1' || t2 == 15 || n == 15 then UNPREDICTABLE;
+
+[0x9f 0x1f 0xb3 0xe1]
+# CHECK: potentially undefined instruction encoding
+# CHECK-NEXT: [0x9f 0x1f 0xb3 0xe1]
+
+# FIXME: should be potentially undefined but no register pair R14_R15 defined to
+# to return.
+[0x9f 0xef 0xb3 0xe1]
+# CHECK: invalid instruction encoding
+# CHECK-NEXT: [0x9f 0xef 0xb3 0xe1]
#------------------------------------------------------------------------------
# Undefined encodings for mcr
Index: llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
===================================================================
--- llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -1225,10 +1225,12 @@
uint64_t Address, const void *Decoder) {
DecodeStatus S = MCDisassembler::Success;
+ // According to the Arm ARM RegNo = 14 is undefined, but we return fail
+ // rather than SoftFail as there is no GPRPair table entry for index 7.
if (RegNo > 13)
return MCDisassembler::Fail;
- if ((RegNo & 1) || RegNo == 0xe)
+ if (RegNo & 1)
S = MCDisassembler::SoftFail;
unsigned RegisterPair = GPRPairDecoderTable[RegNo/2];
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77463.255615.patch
Type: text/x-patch
Size: 2330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200407/4daf3e24/attachment-0001.bin>
More information about the llvm-commits
mailing list