<html><body bgcolor="#FFFFFF"><div>Alignment: I'd like to understand what the runtime really needs. Can't it produce data structures that contain the addresses of things, no matter where they end up? Or offsets? </div><div><br></div><div><br></div><div><br></div><div>As well, can't we have the frontend be very conservative? Align each basic int & float type to its size, even if not required? Didn't I already do that? E.g. 64 bit ints don't generally need 64bit alignment on 32 bit targets, but I'm ok giving it. Front end can insert padding explicitly. (this area bit me, you may recall, gcc/cygwin was aligning 64bit double float to 64bits, adding in padding where frontend didn't..I had to peel the onion quite a bit to debug that...)</div><div><br></div><div><br></div><div>We could also generate compile-time asserts that frontend & backend layouts match. ?</div><div><br></div><div><br></div><div>Anyway, yes, gcc and Visual C++ have extensions that inhibit any padding-for-alignment.<br>If push-comes-to shove, we can use such extensions. gcc extensions are commonly available in other compilers also. Probably in Sun cc & clang for example.</div><div><br></div><div><br></div><div>I'm not sure we need this, but it is available. In the shorter term the need is maybe more likely.</div><div><br></div><div><br></div><div>(eventually, I still dream of testing on AIX, VMs, Irix, HPUX -- not gcc, & maybe a K&R option. :) )</div><div><br></div><div><br></div><div>I also wonder about a hybrid where the frontend computes suggested but not mandatory offsets/layout. Provide integers & symbols, like. So to keep existing backends working more easily. Maybe that is a waste of effort.</div><div><br></div><div><br></div><div>Packing: indeed, I would like to eliminate the endian-dependentness in the frontend. And word-size knowledge. (Yes, I know I repeat myself.)</div><div><br></div><div><br></div><div> - Jay (briefly/pocket-sized-computer-aka-phone)</div><div><br>On Sep 9, 2012, at 11:49 AM, Dragiša Durić <<a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>Can we have network order packing too, while you are lifting level of description?<div><br>
<br><div><div>On Sep 9, 2012, at 5:05 PM, Antony Hosking wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yes, agreed, these need to be properly typed too.<div>First step will be to lift the M3CG interface.</div><div>Problem: The compiler needs to control layout so that the run-time system knows where to find things. This means that we need to assert alignments and layouts produced by the backend are the same as those in the front-end. LLVM has nice ways to do this. How will we do it in the C backend? Does C have sufficient control over alignment?</div><div><br><div><div>On Sep 9, 2012, at 10:53 AM, Jay <<a href="mailto:jay.krell@cornell.edu"><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a></a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div bgcolor="#FFFFFF"><div>Btw, can this include "segment"/globals? Can they each be separate named variables? At least some of them?</div><div><br></div><div><br> - Jay (briefly/pocket-sized-computer-aka-phone)</div><div><br>On Sep 9, 2012, at 7:48 AM, Antony Hosking <<a href="mailto:hosking@cs.purdue.edu"><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a></a>> wrote:<br><br></div><div></div><blockquote type="cite">I’m looking at it...<div><br></div><div>First step is to lift slightly the level of M3CG to use properly typed memory access, instead of untyped address + offset.</div><div>
<br><div><div>On Sep 9, 2012, at 2:32 AM, Dragiša Durić <<a href="mailto:dragisha@m3w.org"></a><a href="mailto:dragisha@m3w.org"><a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a></a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">I hope somebody will take on LLVM :).</div><br class="Apple-interchange-newline"></blockquote></div><br></div></blockquote></div></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></body></html>