<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120868>120868</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang doesn't support the full libmvec in glibc
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hjl-tools
</td>
</tr>
</table>
<pre>
Unlike GCC which reads macros defined in <bits/libm-simd-decl-stubs.h> to determine the libmvect interface in glibc,
clang 19 hard-codes the libmvec interface at clang build-time. When the new functions are added to libmvec, they
can't be used by clang 19:
```
[hjl@gnu-tgl-3 tmp]$ cat x.c
#define LIBMVEC_TYPE double
#define LIBMVEC_FUNC asin
#include <math.h>
#define N 1000
LIBMVEC_TYPE x[N], c[N];
int
main (void)
{
int i;
for(i = 0; i < N; i++)
c[i] = i / 3;
#pragma omp simd
for(i = 0; i < N; i++)
x[i] = LIBMVEC_FUNC (c[i]);
return 0;
}
[hjl@gnu-tgl-3 tmp]$ clang -S -O3 -ffast-math x.c -fopenmp
x.c:10:1: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
10 | main (void)
| ^
1 warning generated.
[hjl@gnu-tgl-3 tmp]$ gcc -S -O3 -ffast-math x.c -fopenmp
[hjl@gnu-tgl-3 tmp]$ grep call x.s
call _ZGVbN2v_asin
[hjl@gnu-tgl-3 tmp]$
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVVFv4zYM_jXKC-HAlu0kfvBD4jSHAVs3YLs7bC-FLNG2OlnyJDlt79cPdJouxQ13W2AkjPjxI0V-YUQIureINSsPrDyuxBwH5-vh0STRORNWrVMv9Udr9J8IH5oGngYtB_AoVIBRSO8CKOy0RQXaAsubVsfA-MnodkyCHlWiUJokxLkN64HldxAdKIzoR20R4oBA0DPKCNpG9J2QSFS90a1kvG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