<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 - Make clang accept the -msahf command-line option to activate the +sahf feature for the backend"
   href="https://bugs.llvm.org/show_bug.cgi?id=36037">36037</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Make clang accept the -msahf command-line option to activate the +sahf feature for the backend
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jonlooney@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19719" name="attach_19719" title="Patch to add support for the -msahf option.">attachment 19719</a> <a href="attachment.cgi?id=19719&action=edit" title="Patch to add support for the -msahf option.">[details]</a></span>
Patch to add support for the -msahf option.

The +sahf feature is important because it makes LLVM produce correct and more
efficient x86-64 code (see <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Incorrect use of pushf/popf enables/disables interrupts on amd64 kernels"
   href="show_bug.cgi?id=36028">Bug 36028</a>, for example).

Therefore, it would be helpful if a user could activate this feature on the
command-line and have clang pipe the feature through to the backend.

GCC uses -msahf for this feature, and the backend already recognizes the +sahf
feature. All that is needed is to teach clang to pass this on to the backend.

The attached patch seems to do that.

The mapping of feature support onto CPUs may not be complete; rather, it was
chosen to match LLVM's idea of which CPUs support this feature (see
lib/Target/X86/X86.td).</pre>
        </div>
      </p>


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

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