Nicolas Kaiser
2010-Dec-16 15:39 UTC
[LLVMdev] x86 disassembler: if-statement with redundant branch
Hi there! In the x86 disassembler I noticed an if-statement with a duplicated branch. Are these intended to be identical? Best regards, Nicolas Kaiser -- diff -ur llvm-2.8.orig/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c llvm-2.8/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c --- llvm-2.8.orig/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c 2010-05-06 22:59:00.000000000 +0200 +++ llvm-2.8/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c 2010-12-16 16:24:28.583323293 +0100 @@ -412,11 +412,6 @@ insn->addressSize = (hasAdSize ? 4 : 8); insn->displacementSize = 4; insn->immediateSize = 4; - } else if (insn->rexPrefix) { - insn->registerSize = (hasOpSize ? 2 : 4); - insn->addressSize = (hasAdSize ? 4 : 8); - insn->displacementSize = (hasOpSize ? 2 : 4); - insn->immediateSize = (hasOpSize ? 2 : 4); } else { insn->registerSize = (hasOpSize ? 2 : 4); insn->addressSize = (hasAdSize ? 4 : 8);
Chris Lattner
2010-Dec-17 04:53 UTC
[LLVMdev] x86 disassembler: if-statement with redundant branch
On Dec 16, 2010, at 7:39 AM, Nicolas Kaiser wrote:> Hi there! > > In the x86 disassembler I noticed an if-statement with a > duplicated branch. Are these intended to be identical?CC'ing Sean, -Chris> > Best regards, > Nicolas Kaiser > -- > diff -ur llvm-2.8.orig/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c llvm-2.8/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c > --- llvm-2.8.orig/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c 2010-05-06 22:59:00.000000000 +0200 > +++ llvm-2.8/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c 2010-12-16 16:24:28.583323293 +0100 > @@ -412,11 +412,6 @@ > insn->addressSize = (hasAdSize ? 4 : 8); > insn->displacementSize = 4; > insn->immediateSize = 4; > - } else if (insn->rexPrefix) { > - insn->registerSize = (hasOpSize ? 2 : 4); > - insn->addressSize = (hasAdSize ? 4 : 8); > - insn->displacementSize = (hasOpSize ? 2 : 4); > - insn->immediateSize = (hasOpSize ? 2 : 4); > } else { > insn->registerSize = (hasOpSize ? 2 : 4); > insn->addressSize = (hasAdSize ? 4 : 8); > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Seemingly Similar Threads
- [LLVMdev] [patch] remove redundant code in X86DisassemblerDecoder.c
- [LLVMdev] registerSize on X86 confused?
- [LLVMdev] registerSize on X86 confused?
- [LLVMdev] X86 disassembler is quite broken on handling REX
- [LLVMdev] X86 disassembler is quite broken on handling REX