-fveclib= allows users to choose a vectorized libm so that loops containing math functions are vectorized. This is implemented as much as possible in the same way as in clang. The driver test in veclib.f90 is copied from the clang test.
16 lines
448 B
Fortran
16 lines
448 B
Fortran
! test that -fveclib= is passed to the backend
|
|
! -target aarch64 so that ArmPL is available
|
|
! RUN: %flang -S -Ofast -fveclib=LIBMVEC -o - %s | FileCheck %s
|
|
! RUN: %flang -S -Ofast -fveclib=NoLibrary -o - %s | FileCheck %s --check-prefix=NOLIB
|
|
|
|
subroutine sb(a, b)
|
|
real :: a(:), b(:)
|
|
integer :: i
|
|
do i=1,100
|
|
! check that we used a vectorized call to powf()
|
|
! CHECK: _ZGVbN4vv_powf
|
|
! NOLIB: powf
|
|
a(i) = a(i) ** b(i)
|
|
end do
|
|
end subroutine
|