Jun Koi via llvm-dev
2016-May-23 06:44 UTC
[llvm-dev] [BUG] Mismatch between assembler & disassembler of X86 RIP-relative instruction
Hi, I found a mismatch between assembler & disassembler of X86: I assembled an instruction, then disassembled the output, but the result is not the same as the first original code: "add qword ptr [205163983024656], 1" vs " add qword ptr [1985229328], 1" Anybody knows what is wrong? Thanks. $ echo "ADD QWORD PTR [0xba9876543210], 0x1"|llvm-mc -assemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding add qword ptr [205163983024656], 1 # encoding:[0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] $ echo "0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01"|llvm-mc -disassemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding add qword ptr [1985229328], 1 # encoding: [0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160523/95953d0e/attachment.html>
Jun Koi via llvm-dev
2016-May-23 06:54 UTC
[llvm-dev] [BUG] Mismatch between assembler & disassembler of X86 RIP-relative instruction
On Mon, May 23, 2016 at 2:44 PM, Jun Koi <junkoi2004 at gmail.com> wrote:> Hi, > > I found a mismatch between assembler & disassembler of X86: I assembled an > instruction, then disassembled the output, but the result is not the same > as the first original code: "add qword ptr [205163983024656], 1" vs " add > qword ptr [1985229328], 1" > > Anybody knows what is wrong? > > Thanks. > > > $ echo "ADD QWORD PTR [0xba9876543210], 0x1"|llvm-mc -assemble > -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 > --show-encoding > add qword ptr [205163983024656], 1 # > encoding:[0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] > > $ echo "0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01"|llvm-mc -disassemble > -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding > add qword ptr [1985229328], 1 # encoding: > [0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] >To make it more clear, here is the same thing again, but with hexa immediate. You can see the difference in memory address: 0xba9876543210 vs 0x76543210. $ echo "ADD QWORD PTR [0xba9876543210], 0x1"|llvm-mc -assemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding -print-imm-hex .text add qword ptr [0xba9876543210], 0x1 # encoding: [0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] $ echo "0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01"|llvm-mc -disassemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding -print-imm-hex .text add qword ptr [0x76543210], 0x1 # encoding: [0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160523/3d6e08a2/attachment.html>
Quentin Colombet via llvm-dev
2016-May-23 16:42 UTC
[llvm-dev] [BUG] Mismatch between assembler & disassembler of X86 RIP-relative instruction
Hi Jun, Could you file a PR please? Thanks, -Quentin> On May 22, 2016, at 11:54 PM, Jun Koi via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > > > On Mon, May 23, 2016 at 2:44 PM, Jun Koi <junkoi2004 at gmail.com <mailto:junkoi2004 at gmail.com>> wrote: > Hi, > > I found a mismatch between assembler & disassembler of X86: I assembled an instruction, then disassembled the output, but the result is not the same as the first original code: "add qword ptr [205163983024656], 1" vs " add qword ptr [1985229328], 1" > > Anybody knows what is wrong? > > Thanks. > > > $ echo "ADD QWORD PTR [0xba9876543210], 0x1"|llvm-mc -assemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding > add qword ptr [205163983024656], 1 # encoding:[0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] > > $ echo "0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01"|llvm-mc -disassemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding > add qword ptr [1985229328], 1 # encoding: [0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] > > To make it more clear, here is the same thing again, but with hexa immediate. You can see the difference in memory address: 0xba9876543210 vs 0x76543210. > > > $ echo "ADD QWORD PTR [0xba9876543210], 0x1"|llvm-mc -assemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding -print-imm-hex > .text > add qword ptr [0xba9876543210], 0x1 # encoding: [0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] > > > $ echo "0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01"|llvm-mc -disassemble -triple=x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding -print-imm-hex > .text > add qword ptr [0x76543210], 0x1 # encoding: [0x48,0x83,0x04,0x25,0x10,0x32,0x54,0x76,0x01] > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160523/0e842f37/attachment.html>
Possibly Parallel Threads
- [BUG] Mismatch between assembler & disassembler of X86 RIP-relative instruction
- Dict proxy client returning empty string instead of multiline string
- Dict proxy client returning empty string instead of multiline string
- Dict proxy client returning empty string instead of multiline string
- Dict proxy client returning empty string instead of multiline string