<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 09/05/2013 04:44 PM, Richard Hadsell
      wrote:<br>
    </div>
    <blockquote cite="mid:5228ED24.7060007@blueskystudios.com"
      type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Thanks for all the clues.  Here is the stack trace:<br>
      <pre> feholdexcept,
 __ieee754_exp2,
 exp2,
 _ZN9cgi...
</pre>
      Based on your various hints, I'm guessing that our code 'pow (2.0,
      x)' is being optimized by Clang++ to 'exp2 (x)' and not by G++. 
      We will try using exp2 explicitly and see what happens with the
      G++ version.<br>
      <br>
      Perhaps we are running into a floating-point standards issue that
      our old version of G++ is ignoring.<br>
      <br>
      We'll continue investigating tomorrow.<br>
    </blockquote>
    <br>
    We changed our code to use 'exp2 (x)' instead of 'pow (2.0, x)' and
    verified that the G++ version now calls feholdexcept.  We'll also
    run our benchmarks again to compare Clang++ with G++ on our modified
    code.<br>
    <br>
    So, the question for Clang developers is: how can we avoid the
    optimization that converts 'pow (2.0, x)' to 'exp2 (x)'?<br>
    <br>
    I don't know why the library functions differ in their need to call
    feholdexcept, but regardless of the explanation, I want to pick the
    faster one for this particular usage.<br>
    <br>
    <pre class="moz-signature" cols="256">-- 
Dick Hadsell                    203-992-6320  Fax: 203-992-6001
Reply-to:                       <a class="moz-txt-link-abbreviated" href="mailto:hadsell@blueskystudios.com">hadsell@blueskystudios.com</a>
Blue Sky Studios                <a class="moz-txt-link-freetext" href="http://www.blueskystudios.com">http://www.blueskystudios.com</a>
1 American Lane, Greenwich, CT 06831-2560
</pre>
  </body>
</html>