Debian Codegraph @

gcc/testsuite/gfortran.target/aarch64/pr122408_1.f90

raw
1 ! { dg-do compile }
2 ! { dg-additional-options "-O2 -march=armv8.3-a" }
3
4 subroutine c_add_ab(n, a, c, b) ! C += A * B
5 use iso_fortran_env, only: real64
6 implicit none
7 !GCC$ ATTRIBUTES noinline :: c_add_ab
8 integer, intent(in) :: n
9 complex(real64), intent(in) :: a
10 complex(real64), intent(inout) :: c(*)
11 complex(real64), intent(in) :: b(*)
12 integer :: k
13 do k = 1, n
14 c(k) = c(k) + a * b(k)
15 end do
16 end subroutine c_add_ab
17
18 subroutine c_sub_ab(n, a, c, b) ! C -= A * B
19 use iso_fortran_env, only: real64
20 implicit none
21 !GCC$ ATTRIBUTES noinline :: c_sub_ab
22 integer, intent(in) :: n
23 complex(real64), intent(in) :: a
24 complex(real64), intent(inout) :: c(*)
25 complex(real64), intent(in) :: b(*)
26 integer :: k
27 do k = 1, n
28 c(k) = c(k) - a * b(k)
29 end do
30 end subroutine c_sub_ab
31
32 subroutine c_add_a_conjb(n, a, c, b) ! C += A * conj(B)
33 use iso_fortran_env, only: real64
34 implicit none
35 !GCC$ ATTRIBUTES noinline :: c_add_a_conjb
36 integer, intent(in) :: n
37 complex(real64), intent(in) :: a
38 complex(real64), intent(inout) :: c(*)
39 complex(real64), intent(in) :: b(*)
40 integer :: k
41 do k = 1, n
42 c(k) = c(k) + a * conjg(b(k))
43 end do
44 end subroutine c_add_a_conjb
45
46 subroutine c_sub_a_conjb(n, a, c, b) ! C -= A * conj(B)
47 use iso_fortran_env, only: real64
48 implicit none
49 !GCC$ ATTRIBUTES noinline :: c_sub_a_conjb
50 integer, intent(in) :: n
51 complex(real64), intent(in) :: a
52 complex(real64), intent(inout) :: c(*)
53 complex(real64), intent(in) :: b(*)
54 integer :: k
55 do k = 1, n
56 c(k) = c(k) - a * conjg(b(k))
57 end do
58 end subroutine c_sub_a_conjb
59
60 ! { dg-final { scan-assembler-times {fcmla\s+v[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d, #0} 2 } }
61 ! { dg-final { scan-assembler-times {fcmla\s+v[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d, #270} 2 } }