| 1 |
! { dg-do compile } |
| 2 |
! { dg-additional-options "-O3 -ftree-parallelize-loops=2 -fno-signed-zeros -fno-trapping-math" } |
| 3 |
! { dg-additional-options "-march=armv8.3-a" { target aarch64*-*-* } } |
| 4 |
|
| 5 |
complex function cdcdot(n, cx) |
| 6 |
implicit none |
| 7 |
|
| 8 |
integer :: n, i, kx |
| 9 |
complex :: cx(*) |
| 10 |
double precision :: dsdotr, dsdoti, dt1, dt3 |
| 11 |
|
| 12 |
kx = 1 |
| 13 |
do i = 1, n |
| 14 |
dt1 = real(cx(kx)) |
| 15 |
dt3 = aimag(cx(kx)) |
| 16 |
dsdotr = dsdotr + dt1 * 2 - dt3 * 2 |
| 17 |
dsdoti = dsdoti + dt1 * 2 + dt3 * 2 |
| 18 |
kx = kx + 1 |
| 19 |
end do |
| 20 |
cdcdot = cmplx(real(dsdotr), real(dsdoti)) |
| 21 |
return |
| 22 |
end function cdcdot |