fortrangoingonforty/armfortas / c58f8be

Browse files

Add fixture: f32 vectorize with two scalar broadcasts

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
c58f8be7cb25b87e55ce7b2fa98a159c541e498a
Parents
5136203
Tree
97ff141

1 changed file

StatusFile+-
A test_programs/do_loop_vectorize_f32.f90 24 0
test_programs/do_loop_vectorize_f32.f90added
@@ -0,0 +1,24 @@
1
+! Float DO-loop vectorization. The body has a load + invariant scalar
2
+! broadcast and a load * invariant scalar broadcast, both producing
3
+! 4×f32 vectors. Without the DupEl-vs-DupGen fix, isel would emit
4
+! `dup.4s v0, sN` which the assembler rejects.
5
+!
6
+! CHECK: 2.5000000E0
7
+! CHECK: 6.4000000E1
8
+program test_do_loop_vectorize_f32
9
+  implicit none
10
+  integer :: i
11
+  real(4) :: a(32), b(32), c(32)
12
+
13
+  do i = 1, 32
14
+    b(i) = real(i, 4)
15
+  end do
16
+
17
+  do i = 1, 32
18
+    a(i) = b(i) + 1.5
19
+    c(i) = b(i) * 2.0
20
+  end do
21
+
22
+  print *, a(1)
23
+  print *, c(32)
24
+end program test_do_loop_vectorize_f32