<div dir="ltr">Largely because it was that way before I tweaked it :-)  I have updated to use uint8_t below.<div><br></div><div>David</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 4, 2013 at 2:13 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Hi David,<br>
      <br>
      +  // 15 is the longest single nop instruction.  Emit as many
      15-byte nops as<br>
      +  // needed, then emit a nop of the remaining length.<br>
      +  do {<br>
      +    uint64_t ThisNopLength = std::min(Count, (uint64_t) 15);<br>
      +    const uint64_t Prefixes = ThisNopLength <= 10 ? 0 :
      ThisNopLength - 10;<br>
      +    for (uint64_t i = 0; i < Prefixes; i++)<br>
      +      OW->Write8(0x66);<br>
      <br>
      Why are the types 64bit ? Looks like a shorter type would suffice
      here, short/unsigned char ?<br>
      <br>
      Thanks<br>
      <br>
      Shankar Easwaran<div><div class="h5"><br>
      <br>
      On 3/4/2013 4:06 PM, David Sehr wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <pre>The current X86 NOP padding uses one long NOP followed by the remainder in
one-byte NOPs.  If the processor actually executes those NOPs, as it
sometimes does with aligned bundling, this can have a performance impact.
 From my micro-benchmarks run on my one machine, a 15-byte NOP followed by
twelve one-byte NOPs is about 20% worse than a 15 followed by a 12.  This
patch changes NOP emission to emit as many 15-byte (the maximum) as
possible followed by at most one shorter NOP.

David

</pre>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
llvm-commits mailing list
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <br>
    <pre cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
  </font></span></div>

</blockquote></div><br></div>