how to use clang with libmvec glibc's short vector math library

Viewed 315

It is possible to use gcc with short vector math library (libmvec) with -ftree-vectorize and -ffast-math. I want to ask how to use libmvec with clang. I figure out there is an option -fveclib= for clang. But it does not accept -fveclib=libmvec.

https://godbolt.org/z/jqsbSu

1 Answers

As of LLVM 12, you can use -fveclib=libmvec to force CLANG to use libmvec. If your code uses mathematical functions (sin, cos, exp, pow) you can experience a large improvement in performance.

Related