<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64664>64664</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang 15 fails to compile program using `smmintrin.h` on ppc64el
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          madscientist159
      </td>
    </tr>
</table>

<pre>
    Updating Clang to version 15 yields new compilation errors on an existing program that includes the `smmintrin.h` compatibility header.  These errors originate from within Clang's own internal header files, not from the application itself.

```
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:71:25: error: use of undeclared identifier '__builtin_mffs'
    __fpscr_save.__fr = __builtin_mffs();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:74:5: error: use of undeclared identifier '__builtin_mtfsf'
 __builtin_mtfsf(0b00000011, __fpscr_save.__fr);
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:86:25: error: use of undeclared identifier '__builtin_mffsl'; did you mean '__builtin_infl'?
    __fpscr_save.__fr = __builtin_mffsl();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:86:25: note: '__builtin_infl' declared here
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:89:5: error: use of undeclared identifier '__builtin_set_fpscr_rn'
 __builtin_set_fpscr_rn(0b00);
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:105:5: error: use of undeclared identifier '__builtin_set_fpscr_rn'
 __builtin_set_fpscr_rn(__fpscr_save.__fpscr);
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:131:25: error: use of undeclared identifier '__builtin_mffsl'; did you mean '__builtin_infl'?
    __fpscr_save.__fr = __builtin_mffsl();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:86:25: note: '__builtin_infl' declared here
    __fpscr_save.__fr = __builtin_mffsl();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:133:5: error: use of undeclared identifier '__builtin_mtfsf'
 __builtin_mtfsf(0b00000011, __fpscr_save.__fr);
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:162:25: error: use of undeclared identifier '__builtin_mffs'
    __fpscr_save.__fr = __builtin_mffs();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:165:5: error: use of undeclared identifier '__builtin_mtfsf'
 __builtin_mtfsf(0b00000011, __fpscr_save.__fr);
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:177:25: error: use of undeclared identifier '__builtin_mffsl'; did you mean '__builtin_infl'?
    __fpscr_save.__fr = __builtin_mffsl();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:86:25: note: '__builtin_infl' declared here
    __fpscr_save.__fr = __builtin_mffsl();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:180:5: error: use of undeclared identifier '__builtin_set_fpscr_rn'
 __builtin_set_fpscr_rn(0b00);
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:196:5: error: use of undeclared identifier '__builtin_set_fpscr_rn'
 __builtin_set_fpscr_rn(__fpscr_save.__fpscr);
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:222:25: error: use of undeclared identifier '__builtin_mffsl'; did you mean '__builtin_infl'?
    __fpscr_save.__fr = __builtin_mffsl();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:86:25: note: '__builtin_infl' declared here
    __fpscr_save.__fr = __builtin_mffsl();
 ^
/usr/lib/llvm-15/lib/clang/15.0.7/include/ppc_wrappers/smmintrin.h:224:5: error: use of undeclared identifier '__builtin_mtfsf'
 __builtin_mtfsf(0b00000011, __fpscr_save.__fr);
```

This issue may have been introduced in this patch series:
https://reviews.llvm.org/D119407
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsmM2O4zYMgJ9GvhA1JPkvPvgws2meYHsOZIuOWciSIclJ8_aFnTS7MzuXNthgOjtBoISQRPMjKUahCoEOFrFhxTMrtoma4-B8MyodOkIbKURR1Enr9Ln5Y9Iqkj3AF6PsAaKDI_pAzoIo4ExodACLJ-jcOJFRcZlB750P4CwoC_gXhVXB5N3BqxHioCKQ7cysMUAcEFjJwziSjZ5sOrCSr9pUpJYMxTMMqDT6FODrgAFv6j0dyKqI0Hs3woniQPZiJpNVAHeyQDait8pcVUBPBgOTX8C6eNm2PF9Nk6HuYjvFgKZPGd8y_nQdS359X0S5m4NncmeoXUZzHH8TxU3uLgbsRJHytGJyd0VlcjdN3f7k1TShD0zuvmfOnirBsidZsOzpArh8mQOC62G2GjujPGogvcSnJ_TAZLXftzOZSHY_9n1gsrpYCACw3_dT6Pw-qCOm-33vgWVbeL1hw2TNsufrNlb8_nMRc5Y9_WfC2If-G-IPExve8vUlxBLgH_gfSrop7w2mWVCzZ9Ck4exmGFHZl6vI9pdFu38XdfPosH_nDOsiLp9vgcDNLwN6_LkW1XckYsB49bK3b-Xjy_k1LR_qbsGLx9G9TrhFeCxtdnfd_Dxq75pJZNmv8rMhSvnhLwGivKc8_b_CWVWftelj16YN_8g3ibr8hW4SUt5dfD9P67tmkvK9_AF93VJYx68DBaAQZoRRnWFQR4QWce1ieKfnbjHOQlyWTSp2AwT0hIFlVwVDjNMqyR2TO49HwlNIF--lzi8O2wpR57xKdJPpOqtVgo0oa1FvyiLLk6HpOs5LXutcKp7zSrRF18q6UBvJ86qs24QayWXGNyLnuSiyPNVSK63bru-UqDolWM5xVGRuT01WoKbMyzJPjGrRhLXtJKXF04WWScmKbeKbNc7tfAgs54ZC_GZ7EikabNbAgyigV2QCRHdtO-GtuTQHsoc3GkrOwjR1ZY4mmb1pXnrqQHGY27Rz4zXZ_sm5ybs_sYtLhi2GLhm1gvwdAAD__y_vGQI">