[llvm-commits] [patch] Fix the operand order of the test instruction

Chris Lattner clattner at apple.com
Sun Nov 28 10:47:51 PST 2010


On Nov 25, 2010, at 5:04 PM, Rafael EspĂ­ndola wrote:

> 2010/11/25 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
>> I noticed that assembling "testq %rbx, %rax" and then disassembling
>> it with objdump would print "testq %rax, %rbx". The attached patch
>> fixes it, but I wonder if there is any reason why the arguments were
>> placed in this order. Is this how the darwin assembler handles them?
> 
> I just checked with darwin 10 and indeed the operand order is the one
> used by llvm-mc. It is probably not worth it to have a format specific
> hack just to match gas in both MachO and ELF.

We're not really very concerned with otool or objdump.  However, we do want diffability of .o files, so the order accepted by test in the .td files was the order required to get the generated .o file to match (darwin) gas.

-Chris



More information about the llvm-commits mailing list