<html>
    <head>
      <base href="https://bugs.llvm.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 - [X86] Add support for X86ISD float2int constant folding"
   href="https://bugs.llvm.org/show_bug.cgi?id=37798">37798</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86] Add support for X86ISD float2int constant folding
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>llvm-dev@redking.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>andrea.dibiagio@gmail.com, craig.topper@gmail.com, filcab@gmail.com, greg.bedwell@sony.com, lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>Depends on</th>
          <td>37751
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Split off from [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [X86] CVTTPD2DQ/CVTTPS2DQ intrinsics must not map to ISD::FP_TO_SINT etc."
   href="show_bug.cgi?id=37751">Bug #37751</a>].

Now that we've standardised to using X86ISD opcodes for float2int conversions:

      // Vector float/double to signed/unsigned integer.
      CVTP2SI, CVTP2UI, CVTP2SI_RND, CVTP2UI_RND,
      // Scalar float/double to signed/unsigned integer.
      CVTS2SI_RND, CVTS2UI_RND,

      // Vector float/double to signed/unsigned integer with truncation.
      CVTTP2SI, CVTTP2UI, CVTTP2SI_RND, CVTTP2UI_RND,
      // Scalar float/double to signed/unsigned integer with truncation.
      CVTTS2SI_RND, CVTTS2UI_RND,

We should investigate adding safe constant folding support to these. We could
at least support exact conversions (these should be rounding mode independent
for non-truncation instructions?).

For truncation instructions we can probably accept inexact conversions as well,
as long as no underflow/overflow occurs - this would need to be tested to
confirm.</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [X86] CVTTPD2DQ/CVTTPS2DQ intrinsics must not map to ISD::FP_TO_SINT etc."
   href="https://bugs.llvm.org/show_bug.cgi?id=37751">Bug 37751</a>] [X86] CVTTPD2DQ/CVTTPS2DQ intrinsics must not map to ISD::FP_TO_SINT etc.
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>