The attached patch includes no test-case and isn't consistent with the rest of the file: - constants should be on the right hand side of comparisons - the braces around your single line 'if' aren't needed. On Sun, Sep 15, 2013 at 2:39 PM, James Courtier-Dutton < james.dutton at gmail.com> wrote:> I attach a patch that fixes this bug. Applies to llvm 3.4svn > > Please commit it please. > > Kind Regards > > James > > > > > On 13 September 2013 17:46, James Courtier-Dutton <james.dutton at gmail.com>wrote: > >> Hi, >> >> I am looking at the "LLVMOpInfoCallback GetOpInfo" callback. >> >> Example 1 GOOD: >> 41 c6 84 24 16 04 00 00 0c : movb $12, 1046(%r12) >> >> Makes calls to the callback with: >> Offset = 0x4, Size = 0x4 <- Octets: 16 04 00 00 >> Offset = 0x8, Size = 0x1 <- Octets: 0c >> That was correct. >> >> Example 2 BAD: >> c7 45 98 a1 ff ff ff : movl $4294967201, -104(%rbp) >> Makes calls to the callback with: >> Offset = 0x2, Size = 0x4 <- Octets: 98 a1 ff ff >> Offset = 0x3, Size = 0x4 <- Octets: a1 ff ff ff >> That is wrong. >> The callbacks should be: >> Offset = 0x2, Size = 0x1 <- Octets: 98 >> Offset = 0x3, Size = 0x4 <- Octets: a1 ff ff ff >> >> Is this a know bug? >> >> Kind Regards >> >> James >> >> > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130915/aac81a72/attachment.html>
Test case attached. It is not a test case that works within the llvm test-suite yet, but it does demonstrate the problem. I would like some advice on how to modify this test_case so that it can be added to the automated llvm test cases. On 15 September 2013 23:02, David Majnemer <david.majnemer at gmail.com> wrote:> The attached patch includes no test-case and isn't consistent with the > rest of the file: > - constants should be on the right hand side of comparisons > - the braces around your single line 'if' aren't needed. > > > > On Sun, Sep 15, 2013 at 2:39 PM, James Courtier-Dutton < > james.dutton at gmail.com> wrote: > >> I attach a patch that fixes this bug. Applies to llvm 3.4svn >> >> Please commit it please. >> >> Kind Regards >> >> James >> >> >> >> >> On 13 September 2013 17:46, James Courtier-Dutton <james.dutton at gmail.com >> > wrote: >> >>> Hi, >>> >>> I am looking at the "LLVMOpInfoCallback GetOpInfo" callback. >>> >>> Example 1 GOOD: >>> 41 c6 84 24 16 04 00 00 0c : movb $12, 1046(%r12) >>> >>> Makes calls to the callback with: >>> Offset = 0x4, Size = 0x4 <- Octets: 16 04 00 00 >>> Offset = 0x8, Size = 0x1 <- Octets: 0c >>> That was correct. >>> >>> Example 2 BAD: >>> c7 45 98 a1 ff ff ff : movl $4294967201, -104(%rbp) >>> Makes calls to the callback with: >>> Offset = 0x2, Size = 0x4 <- Octets: 98 a1 ff ff >>> Offset = 0x3, Size = 0x4 <- Octets: a1 ff ff ff >>> That is wrong. >>> The callbacks should be: >>> Offset = 0x2, Size = 0x1 <- Octets: 98 >>> Offset = 0x3, Size = 0x4 <- Octets: a1 ff ff ff >>> >>> Is this a know bug? >>> >>> Kind Regards >>> >>> James >>> >>> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130916/47fc7595/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: test_case.cpp Type: text/x-c++src Size: 2150 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130916/47fc7595/attachment.cpp>
You'd probably want to add to the test/MC/Disassembler/X86/x86-64.txt file. The '# CHECK' line verifies what the line below it disassembles to. On Sun, Sep 15, 2013 at 4:13 PM, James Courtier-Dutton < james.dutton at gmail.com> wrote:> Test case attached. It is not a test case that works within the llvm > test-suite yet, but it does demonstrate the problem. > I would like some advice on how to modify this test_case so that it can be > added to the automated llvm test cases. > > > > On 15 September 2013 23:02, David Majnemer <david.majnemer at gmail.com>wrote: > >> The attached patch includes no test-case and isn't consistent with the >> rest of the file: >> - constants should be on the right hand side of comparisons >> - the braces around your single line 'if' aren't needed. >> >> >> >> On Sun, Sep 15, 2013 at 2:39 PM, James Courtier-Dutton < >> james.dutton at gmail.com> wrote: >> >>> I attach a patch that fixes this bug. Applies to llvm 3.4svn >>> >>> Please commit it please. >>> >>> Kind Regards >>> >>> James >>> >>> >>> >>> >>> On 13 September 2013 17:46, James Courtier-Dutton < >>> james.dutton at gmail.com> wrote: >>> >>>> Hi, >>>> >>>> I am looking at the "LLVMOpInfoCallback GetOpInfo" callback. >>>> >>>> Example 1 GOOD: >>>> 41 c6 84 24 16 04 00 00 0c : movb $12, 1046(%r12) >>>> >>>> Makes calls to the callback with: >>>> Offset = 0x4, Size = 0x4 <- Octets: 16 04 00 00 >>>> Offset = 0x8, Size = 0x1 <- Octets: 0c >>>> That was correct. >>>> >>>> Example 2 BAD: >>>> c7 45 98 a1 ff ff ff : movl $4294967201, -104(%rbp) >>>> Makes calls to the callback with: >>>> Offset = 0x2, Size = 0x4 <- Octets: 98 a1 ff ff >>>> Offset = 0x3, Size = 0x4 <- Octets: a1 ff ff ff >>>> That is wrong. >>>> The callbacks should be: >>>> Offset = 0x2, Size = 0x1 <- Octets: 98 >>>> Offset = 0x3, Size = 0x4 <- Octets: a1 ff ff ff >>>> >>>> Is this a know bug? >>>> >>>> Kind Regards >>>> >>>> James >>>> >>>> >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >>> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130915/684e1d01/attachment.html>