[llvm] r335594 - ARM: correctly decode VFP instructions following unpredictable t2IT
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 26 04:39:20 PDT 2018
Author: tnorthover
Date: Tue Jun 26 04:39:20 2018
New Revision: 335594
URL: http://llvm.org/viewvc/llvm-project?rev=335594&view=rev
Log:
ARM: correctly decode VFP instructions following unpredictable t2IT
When the condition code for an IT instruction is "AL" we get strange "15"
predicates on subsequent instructions. These are dealt with for most
instructions by treating them as "ARMCC::AL", but VFP takes a different path
which didn't have this code.
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp?rev=335594&r1=335593&r2=335594&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Tue Jun 26 04:39:20 2018
@@ -659,6 +659,8 @@ ThumbDisassembler::AddThumbPredicate(MCI
void ThumbDisassembler::UpdateThumbVFPPredicate(MCInst &MI) const {
unsigned CC;
CC = ITBlock.getITCC();
+ if (CC == 0xF)
+ CC = ARMCC::AL;
if (ITBlock.instrInITBlock())
ITBlock.advanceITState();
Modified: llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt?rev=335594&r1=335593&r2=335594&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt (original)
+++ llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt Tue Jun 26 04:39:20 2018
@@ -1,4 +1,4 @@
-# RUN: llvm-mc --disassemble %s -triple=thumbv7-unknown-unknown 2>&1 | grep und
+# RUN: llvm-mc --disassemble %s -triple=thumbv7-unknown-unknown 2>&1 | FileCheck %s
# rdar://10841671
0xe3 0xbf
@@ -11,8 +11,8 @@
# above sequence of junk bytes and not allowing the disassembler to abort on
# printing the final instruction in this list.
#
-# ittte al
-# vldr d19, [pc, #388]
-# vsub.f64 d17, d17, d16
-# vadd.f64 d18, d18, d19
-# vldr<und> d16, [pc, #384]
+# CHECK: ittte al
+# CHECK: vldr d19, [pc, #388]
+# CHECK: vsub.f64 d17, d17, d16
+# CHECK: vadd.f64 d18, d18, d19
+# CHECK: vldr d16, [pc, #384]
More information about the llvm-commits
mailing list