[PATCH] Fix encoding of unconditional Thumb2 branch (T4)
Gordon Keiser
gkeiser at arxan.com
Tue Apr 9 11:51:45 PDT 2013
ping
From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Gordon Keiser
Sent: Wednesday, March 27, 2013 8:25 PM
To: llvm-commits at cs.uiuc.edu
Subject: [PATCH] Fix encoding of unconditional Thumb2 branch (T4)
Hi,
A little while back someone checked in a patch to disassemble this branch correctly, but the TableGen definition was still using incorrect information as if a 20 bit immediate was involved, and the encode function neglected to right shift the immediate first (the output becomes left shifted by #1). The former item was causing the S, J1, and J2 bits of the instruction to be set incorrectly (based on bits 19-17 of the immediate rather than the calculated version from the encode function), and the latter was causing all of the branches to go twice as far as specified. This was verified both by the output from LLVM's disassembler which is correct in this case, IDA 6.4, and lots of bit checking vs. ARM's docs.
The patch also updates test cases, which were listing encoding results which didn't match what they should have been.
I don't have commit access yet, so someone who does can feel free to commit if it looks good.
Cheers,
Gordon Keiser
Software Development Engineer
Arxan Technologies
w:+1.765.889.4756 m:+1.765.237.4833
gkeiser at arxan.com<mailto:gkeiser at arxan.com> www.arxan.com<http://www.arxan.com/>
Protecting the App Economy(tm)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130409/02d3ee90/attachment.html>
More information about the llvm-commits
mailing list