<br><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 27, 2012 at 2:57 AM, Renato Golin <span dir="ltr"><<a href="mailto:rengolin@systemcall.org" target="_blank">rengolin@systemcall.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 26 September 2012 22:08, Jan Voung <<a href="mailto:jvoung@chromium.org">jvoung@chromium.org</a>> wrote:<br>

> I think most of the instructions operands are encoded as VBR(N)<br>
> for some N number of bits, and it seems to me that VBR(8) is like ULEB?<br>
> I think that the default N is 6 bits, but I haven't tried tweaking these<br>
> parameters.<br>
<br>
</div>It has a similar purpose, but slightly different. SLEB (the signed<br>
version) wouldn't use the whole word for -1, since the sign expansion<br>
happens after the number is encoded to 7 bits package, so any negative<br>
number that can be represented using 7 bits would still be stored in a<br>
byte.<br>
<div class=""><div class="h5"><br></div></div></blockquote><div> </div><div>Ah I see.  It looks like LLVM's bitcode writer does have a signed version</div><div>of the VBRs, which is used for integer constants.  I tried using that for</div>
<div>phis and added the data to the *second sheet* in the original</div><div>spreadsheet.  See the tab "With SLEB-like Signed VBR for phi",</div><div>at the bottom.</div><div><br></div><div>It's certainly a bit better (1.3% uncompressed and 0.7% with gzip too),</div>
<div>but it's not always better, and I think it can still be done in a backward</div><div>compatible way.</div><div><br></div><div>I added numbers for what would happen if we didn't touch phis at all, too.</div><div>
<br></div><div>Finally, checked the average size of individual bc files from a build of</div><div>the llvm-test-suite (vs llvm-linked bitcode files), to make sure this isn't</div><div>really regressing sizes of small files.  The average size of such</div>
<div>small bitcode object files is ~3.5% better.  Didn't check compression</div><div>for that case though...</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">
<br>
--<br>
cheers,<br>
--renato<br>
<br>
<a href="http://systemcall.org/" target="_blank">http://systemcall.org/</a><br>
</div></div></blockquote></div><br></div>