<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - sqrt and pow should produce consistent results even in SSE2 available x86 32bit environment"
   href="https://bugs.webkit.org/show_bug.cgi?id=157787">157787</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>sqrt and pow should produce consistent results even in SSE2 available x86 32bit environment
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>utatane.tea&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In x86 32bit environment with SSE2 availability, some strange situation occurs.

1. C runtime is compiled with x87

C runtime is compiled with x87 since SSE2 is not considered.
This should be since binary packages (e.g. Debian i686) should consider the processor capabilities conservatively.

2. DFG JIT emits floating point operations in SSE2

But DFG JIT consult CPUID to determine SSE2 availability.
As a result, while C runtime is compiled with x87, DFG JIT code uses SSE2 operations (like sqrtsd, muld etc.)

Since while x87 has 80bit precision SSE has 64bit precision, this produces inconsistent results in C runtime and DFG JIT code.
While both 80 / 64 bit precision is ok, at least we need to ensure that the result with the same argument should be the same in all the JIT tiers.
Currently, while DFG JIT produces 64bit precision values, C runtime produces 80bit precision values.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>