<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Greg,<div><br></div><div>I understand your frustration. I've been on this mailing list for a little over a year hoping that by osmosis I could get a a better handle on writing a back end for LLVM. Although I feel more comfortable with the nomenclature, I still do not have a clue as to how to begin (actually I do, but it sounds more dramatic saying it this way). I've read the documentation, but TableGen seems to just be a glorified front end for generating C++ records. I was hoping for something that would allow me to specify my target machine (more inline with what GCC does) and then just stand back and watch the target code be generated. I guess a deeper understanding of Target classes is mandatory before proceeding to use TableGen.</div><div><br></div><div>I guess what would help would be a tutorial that shows how one goes about writing a back-end for a fictitious target machine - something similar to "Porting GCC for Dunces" (<a href="http://ftp.axis.se/pub/users/hp/pgccfd/pgccfd.pdf)">http://ftp.axis.se/pub/users/hp/pgccfd/pgccfd.pdf)</a>. Also a pre-made "Dummy" back-end that had some basic instructions would also go a long way in helping someone write a back-end.</div><div><br></div><div>Alex Karahalios</div><div><br><div><div>On Apr 11, 2009, at 5:03 PM, Greg McGary wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> <div bgcolor="#ffffff" text="#000000"> <font size="+1">As we've already seen, David Chisnall prefers hacking LLVM over GCC </font><font size="+1">(see <a class="moz-txt-link-freetext" href="http://www.informit.com/articles/article.aspx?p=1215438">http://www.informit.com/articles/article.aspx?p=1215438</a>): "In contrast, every time I look at the GCC code, it takes two people to <br> prevent me from clawing my eyeballs out."<br> <br> I'm sorry to report that so-far I have had the opposite experience.  Some years ago, I ported binutils (via CGEN) and GCC to an embedded RISC CPU and found it the process straightforward and pleasant.  CGEN was especially handy for describing a sometimes quirky RISC instruction set and offered great flexibility for factoring-out commonalities.  By contrast, I have found TableGen to be much more rigid and brittle.  There are too many constructs that need to be special-cased, and the existing ports do them in gratuitously different ways.  There also seem to be too many layers of classes and helper functions in proportion to what's being specified.  I guess that sums-up my gripe: low signal/noise and gratuitous complexity.  Sorry to be complaining rather than proposing solutions.  When I better get the hang of all of this, I expect to have some ideas on how to improve TableGen.  Is there a development plan or wishlist for TableGen?  I see nothing on the wiki yet.<br> <br> I must also say that the LLVM code is considerably "denser" because of the unfortunate choice of BiCapitalizedIdentifierNames.  Underscores lend some horizontal whitespace to names and make their subtokens visually distict.  BiCapped code is kinda like German with its cumbersome compound nouns.<br> <br> Enough complaining for now--back to banging skull on stone!  8^)<br></font></div></blockquote></div><br></div></body></html>