Chandler Carruth
2012-Dec-18 23:39 UTC
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
On Tue, Dec 18, 2012 at 3:36 PM, Tim Northover <t.p.northover at gmail.com>wrote:> > > Maybe it's naive, but I would expect it to be easy for each backend to > > > expose a constant N which is the length of the longest mnemonic, and > then > > > for the printer to pad to N+1 or N+2…. > > > > That would probably work for X86, but other targets (ARM in particular) > > often have operands which are printed/parsed as suffices on the mnemonic > > itself. Because of these, the backend does not statically know the > longest > > potential string-of-stuff-before-the-tab. > > Are you thinking of something beyond the ".F32.I16" suffixes (for > example)? If not, the result may not be TableGeneratable, but is > probably conservatively known as "8 + natural mnemonic length" for > these purposes. >The great thing is, if its close enough, it doesn't matter if there exist corner cases that are formatted less well. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121218/cee8616c/attachment.html>
Owen Anderson
2012-Dec-18 23:44 UTC
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
On Dec 18, 2012, at 3:39 PM, Chandler Carruth <chandlerc at google.com> wrote:> On Tue, Dec 18, 2012 at 3:36 PM, Tim Northover <t.p.northover at gmail.com> wrote: > > > Maybe it's naive, but I would expect it to be easy for each backend to > > > expose a constant N which is the length of the longest mnemonic, and then > > > for the printer to pad to N+1 or N+2…. > > > > That would probably work for X86, but other targets (ARM in particular) > > often have operands which are printed/parsed as suffices on the mnemonic > > itself. Because of these, the backend does not statically know the longest > > potential string-of-stuff-before-the-tab. > > Are you thinking of something beyond the ".F32.I16" suffixes (for > example)? If not, the result may not be TableGeneratable, but is > probably conservatively known as "8 + natural mnemonic length" for > these purposes. > > The great thing is, if its close enough, it doesn't matter if there exist corner cases that are formatted less well.It affects pretty much all ARM instructions, which can have a predicate suffix. Some can also have an S suffix. Those are not expressed to tblgen as part of the mnemonic, so it can't know about them when computing a maximum mnemonic length. --Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121218/319efc31/attachment.html>
Tim Northover
2012-Dec-18 23:54 UTC
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
> It affects pretty much all ARM instructions, which can have a predicateThat suggests to me that a Target callback may be the way to go rather than relying on TableGen getting the right answer. Realistically '\t' doesn't get it right every time at the moment. Even ignoring long instructions (which exist), InstAliases only work with a single space. Make it a well-documented pure-virtual method in the appropriate class and implementors will be even more more likely to see it. Tim. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121218/a10c1897/attachment.html>
Maybe Matching Threads
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?