<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 - B3 should have a DoubleToInt that takes a list of exceptional values"
   href="https://bugs.webkit.org/show_bug.cgi?id=154685">154685</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>B3 should have a DoubleToInt that takes a list of exceptional values
          </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>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>fpizlo&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Different hardware returns different results for double-to-int failure.  Because of that, we avoided adding DoubleToInt as an opcode in B3.

But we could add a DoubleToInt opcode that has this syntax:

&#64;result = DoubleToInt(&#64;input, &#64;negOverflow, &#64;posOverflow, &#64;negNaN, &#64;posNaN)

Where:

- &#64;negOverflow is the value we return if &#64;input is smaller than INT_MIN.
- &#64;posOverflow is the value we return if &#64;input is larger than INT_MAX.
- &#64;negNaN is the value we return if &#64;input is negative NaN.
- &#64;posNaN is the value we return if &#64;input is positive NaN.

Collectively these are the failure codes.  This means that the client could request that B3 emulates any kind of hardware doubleToInt operation.  If you want X86 behavior, you pass INT_MIN for all of the failure codes.  On ARM64, we would pass either INT_MIN or INT_MAX depending on whether it's positive or negative.</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>