Debian Codegraph @

flang/test/Lower/PowerPC/ppc-intrinsics.f90

raw
1 ! RUN: %flang_fc1 -flang-experimental-hlfir -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
2 ! REQUIRES: target=powerpc{{.*}}
3
4 ! CHECK-LABEL: fmadd_testr
5 subroutine fmadd_testr(a, x, y)
6 real :: a, x, y, z
7 z = fmadd(a, x, y)
8 ! LLVMIR: call contract float @llvm.fma.f32(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})
9 end
10
11 ! CHECK-LABEL: fmadd_testd
12 subroutine fmadd_testd(a, x, y)
13 real(8) :: a, x, y, z
14 z = fmadd(a, x, y)
15 ! LLVMIR: call contract double @llvm.fma.f64(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})
16 end
17
18 ! CHECK-LABEL: fnmadd_testr
19 subroutine fnmadd_testr(a, x, y)
20 real :: a, x, y, z
21 z = fnmadd(a, x, y)
22 ! LLVMIR: call contract float @llvm.ppc.fnmadds(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})
23 end
24
25 ! CHECK-LABEL: fnmadd_testd
26 subroutine fnmadd_testd(a, x, y)
27 real(8) :: a, x, y, z
28 z = fnmadd(a, x, y)
29 ! LLVMIR: call contract double @llvm.ppc.fnmadd(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})
30 end
31
32 ! CHECK-LABEL: fmsub_testr
33 subroutine fmsub_testr(a, x, y)
34 real :: a, x, y, z
35 z = fmsub(a, x, y)
36 ! LLVMIR: call contract float @llvm.ppc.fmsubs(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})
37 end
38
39 ! CHECK-LABEL: fmsub_testd
40 subroutine fmsub_testd(a, x, y)
41 real(8) :: a, x, y, z
42 z = fmsub(a, x, y)
43 ! LLVMIR: call contract double @llvm.ppc.fmsub(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})
44 end
45
46 ! CHECK-LABEL: fnmsub_testr
47 subroutine fnmsub_testr(a, x, y)
48 real :: a, x, y, z
49 z = fnmsub(a, x, y)
50 ! LLVMIR: call contract float @llvm.ppc.fnmsub.f32(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})
51 end
52
53 ! CHECK-LABEL: fnmsub_testd
54 subroutine fnmsub_testd(a, x, y)
55 real(8) :: a, x, y, z
56 z = fnmsub(a, x, y)
57 ! LLVMIR: call contract double @llvm.ppc.fnmsub.f64(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})
58 end
59
60 ! CHECK-LABEL: fctid_test
61 subroutine fctid_test(x)
62 real(8) :: x, r
63 r = fctid(x)
64 ! LLVMIR: call contract double @llvm.ppc.fctid(double %{{[0-9]}})
65 end
66
67 ! CHECK-LABEL: fctidz_test
68 subroutine fctidz_test(x)
69 real(8) :: x, r
70 r = fctidz(x)
71 ! LLVMIR: call contract double @llvm.ppc.fctidz(double %{{[0-9]}})
72 end
73
74 ! CHECK-LABEL: fctiw_test
75 subroutine fctiw_test(x)
76 real(8) :: x, r
77 r = fctiw(x)
78 ! LLVMIR: call contract double @llvm.ppc.fctiw(double %{{[0-9]}})
79 end
80
81 ! CHECK-LABEL: fctiwz_test
82 subroutine fctiwz_test(x)
83 real(8) :: x, r
84 r = fctiwz(x)
85 ! LLVMIR: call contract double @llvm.ppc.fctiwz(double %{{[0-9]}})
86 end
87
88 ! CHECK-LABEL: fctudz_test
89 subroutine fctudz_test(x)
90 real(8) :: x, r
91 r = fctudz(x)
92 ! LLVMIR: call contract double @llvm.ppc.fctudz(double %{{[0-9]}})
93 end
94
95 ! CHECK-LABEL: fctuwz_test
96 subroutine fctuwz_test(x)
97 real(8) :: x, r
98 r = fctuwz(x)
99 ! LLVMIR: call contract double @llvm.ppc.fctuwz(double %{{[0-9]}})
100 end
101
102 ! CHECK-LABEL: fcfi_test
103 subroutine fcfi_test(i)
104 real(8) :: i, r
105 r = fcfi(i)
106 ! LLVMIR: call contract double @llvm.ppc.fcfid(double %{{[0-9]}})
107 end
108
109 ! CHECK-LABEL: fcfid_test
110 subroutine fcfid_test(i)
111 real(8) :: i, r
112 r = fcfid(i)
113 ! LLVMIR: call contract double @llvm.ppc.fcfid(double %{{[0-9]}})
114 end
115
116 ! CHECK-LABEL: fcfud_test
117 subroutine fcfud_test(i)
118 real(8) :: i, r
119 r = fcfud(i)
120 ! LLVMIR: call contract double @llvm.ppc.fcfud(double %{{[0-9]}})
121 end
122
123 ! CHECK-LABEL: fnabs_testr(x)
124 subroutine fnabs_testr(x)
125 real :: x, y
126 y = fnabs(x)
127 ! LLVMIR: call contract float @llvm.ppc.fnabss(float %{{[0-9]}})
128 end
129
130 ! CHECK-LABEL: fnabs_testd(x)
131 subroutine fnabs_testd(x)
132 real(8) :: x, y
133 y = fnabs(x)
134 ! LLVMIR: call contract double @llvm.ppc.fnabs(double %{{[0-9]}})
135 end
136
137 !CHECK-LABEL: fre_test(x)
138 subroutine fre_test(x)
139 real(8) :: x, y
140 y = fre(x)
141 ! LLVMIR: call contract double @llvm.ppc.fre(double %{{[0-9]}})
142 end
143
144 !CHECK-LABEL: fres_test(x)
145 subroutine fres_test(x)
146 real :: x, y
147 y = fres(x)
148 ! LLVMIR: call contract float @llvm.ppc.fres(float %{{[0-9]}})
149 end
150
151 !CHECK-LABEL: frsqrte_test(x)
152 subroutine frsqrte_test(x)
153 real(8) :: x, y
154 y = frsqrte(x)
155 ! LLVMIR: call contract double @llvm.ppc.frsqrte(double %{{[0-9]}})
156 end
157
158 !CHECK-LABEL: frsqrtes_test(x)
159 subroutine frsqrtes_test(x)
160 real :: x, y
161 y = frsqrtes(x)
162 ! LLVMIR: call contract float @llvm.ppc.frsqrtes(float %{{[0-9]}})
163 end
164
165 ! CHECK-LABEL: mtfsf_test
166 subroutine mtfsf_test(r)
167 real(8) :: r
168 call mtfsf(1, r)
169 ! LLVMIR: call void @llvm.ppc.mtfsf(i32 {{[0-9]}}, double %{{[0-9]}})
170 end
171
172 ! CHECK-LABEL: mtfsfi_test
173 subroutine mtfsfi_test()
174 call mtfsfi(1, 2)
175 ! LLVMIR: call void @llvm.ppc.mtfsfi(i32 {{[0-9]}}, i32 {{[0-9]}})
176 end