[PATCH v2] X86: disambiguate unqualified btr, bts

Ramkumar Ramachandra artagnon at gmail.com
Tue Jul 16 01:26:57 PDT 2013


Ramkumar Ramachandra wrote:
> Stephen Checkoway wrote:
>> bt $n, mem becomes btl $(n % 32), mem + 4*(n / 32)
>
> Yeah, and the same logic should be applied to all bit-test
> instructions.  Pointers for a patch, please?

It looks like doing this using instruction aliases will result in a
huge amount of duplication, but that does seem to be the existing
convention.  The larger problem seems to be that
MatchInstructionImpl() is too primitive: See d5b2f1a (move the
"sh[lr]d op,op" -> "shld $1, op,op" aliases to the .td file.,
2010-11-06), where Lattner comments out a slew of instructions saying
that the matcher is incapable of matching a fixed immediate.  So, I'd
like to look into improving MatchInstructionImpl(), which is generated
at utils/TableGen/AsmMatcherEmitter.cpp:2853.  Or is that a lost
cause, and should be we open-coding it
lib/Target/X86/AsmParser/X86AsmParser.cpp?  I suppose we could inject
something into ParseInstruction(), following the examples of outb, inb
etc.  Yeah, I think that's what we should do: I'll try to whip up a
patch shortly.



More information about the llvm-commits mailing list