[llvm-commits] [llvm] r68464 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/2009-04-06-AsmModifier.ll
bob.wilson at apple.com
Tue Apr 7 11:45:29 CDT 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
>>> case 'c': // Don't print "$" before a global var name or
>>> + 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.
> 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