[LLVMdev] Wrong encoding/decoding for POPC instruction of Sparc (original) (raw)
David Wiberg dwiberg at gmail.com
Fri Jul 31 10:02:31 PDT 2015
- Previous message: [LLVMdev] Wrong encoding/decoding for POPC instruction of Sparc
- Next message: [LLVMdev] [ARM]__modsi3 call in android
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi James,
Not sure if you've already found the problem but I've been looking at this issue a bit as a way to learn. What I've seen is that the wrong operand names are used for the instruction which causes the decoder emitter to fail to recognize the operands.
The attached patch changes the names of the operands and adds a test for the disassembly of the instruction. I haven't checked if there are more instructions which lack test cases. I have no commit access, if you think the patch is correct I would appreciate your help in committing it.
Regards David
2015-07-31 16:56 GMT+02:00 James Y Knight <jyknight at google.com>:
I'll look into it, thanks for the report.
On Thu, Jul 30, 2015 at 11:01 PM, Jun Koi <junkoi2004 at gmail.com> wrote:
Any ideas on this bug?
Thanks.
On Wed, Jul 29, 2015 at 12:17 AM, Jun Koi <junkoi2004 at gmail.com> wrote: Hello, There is an issue in the latest Sparc code: while we can encode POPC, decode results in crash in llvm-mc $ echo "popc %g1, %g2" | ./Release+Asserts/bin/llvm-mc -assemble -triple=sparcv9 -show-encoding .text popc %g1, %g2 ! encoding: [0x85,0x70,0x00,0x01] $ echo "0x85,0x70,0x00,0x01"|./Release+Asserts/bin/llvm-mc -disassemble -triple=sparcv9 .text popc Assertion failed: (idx < size()), function operator[], file_ _/Users/jun/projects/llvm/sparc-2.git/include/llvm/ADT/SmallVector.h, line_ _143._ _0 llvm-mc 0x00000001096a5099_ _llvm::sys::PrintStackTrace(llvm::rawostream&) + 57_ _1 llvm-mc 0x00000001096a45c6_ _llvm::sys::RunSignalHandlers() + 102_ _2 llvm-mc 0x00000001096a5b95 SignalHandler(int) + 693_ _3 libsystemplatform.dylib 0x00007fff86d78f1a sigtramp + 26_ _4 libsystemplatform.dylib 0x0000000000000002 sigtramp + 2032693506_ _5 llvm-mc 0x00000001096a5836 abort + 22_ _6 llvm-mc 0x00000001096a5811 _assertrtn + 81_ _7 llvm-mc 0x000000010963f4e8_ _llvm::SparcInstPrinter::printOperand(llvm::MCInst const*, int,_ _llvm::MCSubtargetInfo const&, llvm::rawostream&) + 136_ _8 llvm-mc 0x000000010963eae0_ _llvm::SparcInstPrinter::printInstruction(llvm::MCInst const*,_ _llvm::MCSubtargetInfo const&, llvm::rawostream&) + 256_ _9 llvm-mc 0x000000010964f5e6_ _llvm::SparcInstPrinter::printInst(llvm::MCInst const*, llvm::rawostream&,_ _llvm::StringRef, llvm::MCSubtargetInfo const&) + 86_ _10 llvm-mc 0x000000010965f90f (anonymous_ _namespace)::MCAsmStreamer::EmitInstruction(llvm::MCInst const&,_ _llvm::MCSubtargetInfo const&) + 2879_ _11 llvm-mc 0x00000001096043b3_ _llvm::Disassembler::disassemble(llvm::Target const&,_ _std::_1::basicstring<char, std::_1::chartraits, _std::1::allocator > const&, llvm::MCSubtargetInfo&, llvm::MCStreamer&, llvm::MemoryBuffer&, llvm::SourceMgr&, llvm::rawostream&) + 2147 12 llvm-mc 0x0000000109607460 main + 9760 13 libdyld.dylib 0x00007fff8f34d5c9 start + 1 14 libdyld.dylib 0x0000000000000003 start + 1892362811 Stack dump: 0. Program arguments: ./Release+Asserts/bin/llvm-mc -disassemble -triple=sparcv9 Illegal instruction: 4
Any ideas on what is wrong, and how to fix this? Thank you.
LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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/20150731/c135230f/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: SparcPopcDecoding.patch Type: application/octet-stream Size: 1037 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150731/c135230f/attachment.obj>
- Previous message: [LLVMdev] Wrong encoding/decoding for POPC instruction of Sparc
- Next message: [LLVMdev] [ARM]__modsi3 call in android
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]