[llvm-commits] [llvm] r68464 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/2009-04-06-AsmModifier.ll

Bob Wilson bob.wilson at apple.com
Tue Apr 7 09:45:29 PDT 2009


On Apr 7, 2009, at 6:18 AM, Richard Pennington wrote:

> Duncan Sands wrote:
>> Hi Bob,
>>> Handle 'a' modifier in ARM inline assembly.
>>> Patch by Richard Pennington.
>> ...
>>> +    case 'a': // Don't print "#" before a global var name or  
>>> constant.
>>>     case 'c': // Don't print "$" before a global var name or  
>>> constant.
>>> +      printOperand(MI, OpNo, "no_hash");
>>> +      return false;
>> is this correct?  I talked with Richard on IRC, and some
>> testing with gcc on ARM seemed to show gcc doing something
>> different with this modifier to what Richard expected.
>> Ciao,
>> Duncan.
> Duncan,
>
> Bob put me on the right path. It was the "no_hash" that was needed.
> We match gcc now.

There is more that could be done here.  I added some comments in the  
bug report.  GCC does all sorts of elaborate things with these operand  
modifiers.  LLVM doesn't recognize most of them.  For ARM, the "a"  
modifier handles all the different ARM and Thumb addressing modes.   
The testcase in the bug report was for an immediate operand, and for  
that case, I do think Richard's patch is correct.  (One could argue  
that the testcase is not so great.  The "a" modifier is supposed to be  
used for addresses, but the argument to an SWI instruction is not an  
address.  A "c" modifier would make more sense in this case.  But, we  
want to be compatible with GCC and either "a" or "c" will do the same  
thing in this particular case.)



More information about the llvm-commits mailing list