<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">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<br>
      <br>
      On 3/4/2013 4:06 PM, David Sehr wrote:<br>
    </div>
    <blockquote
cite="mid:CAJ8AG-Bef_B0BmTQ42n55_s2Y4PJ1CVyahQspCJh9zEwpO4FgA@mail.gmail.com"
      type="cite">
      <pre wrap="">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 class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
  </body>
</html>