1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
! RUN: bbc -emit-fir -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CHECK,CMPLX-PRECISE"
! RUN: bbc --math-runtime=precise -emit-fir -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CMPLX-PRECISE"
! RUN: %flang_fc1 -emit-fir -mllvm -outline-intrinsics %s -o - | FileCheck %s
! RUN: %flang_fc1 -fapprox-func -emit-fir -mllvm -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CMPLX-FAST"
! CHECK-LABEL: tan_testr
subroutine tan_testr(a, b)
real :: a, b
! CHECK: fir.call @fir.tan.contract.f32.f32
b = tan(a)
end subroutine
! CHECK-LABEL: tan_testd
subroutine tan_testd(a, b)
real(kind=8) :: a, b
! CHECK: fir.call @fir.tan.contract.f64.f64
b = tan(a)
end subroutine
! CHECK-LABEL: tan_testc
subroutine tan_testc(z)
complex :: z
! CHECK: fir.call @fir.tan.contract.z4.z4
z = tan(z)
end subroutine
! CHECK-LABEL: tan_testcd
subroutine tan_testcd(z)
complex(kind=8) :: z
! CHECK: fir.call @fir.tan.contract.z8.z8
z = tan(z)
end subroutine
! CHECK-LABEL: atan_testr
subroutine atan_testr(a, b)
real :: a, b
! CHECK: fir.call @fir.atan.contract.f32.f32
b = atan(a)
end subroutine
! CHECK-LABEL: atan_testd
subroutine atan_testd(a, b)
real(kind=8) :: a, b
! CHECK: fir.call @fir.atan.contract.f64.f64
b = atan(a)
end subroutine
! CHECK-LABEL: atan_testc
subroutine atan_testc(z)
complex :: z
! CHECK: fir.call @fir.atan.contract.z4.z4
z = atan(z)
end subroutine
! CHECK-LABEL: atan_testcd
subroutine atan_testcd(z)
complex(kind=8) :: z
! CHECK: fir.call @fir.atan.contract.z8.z8
z = atan(z)
end subroutine
! CHECK-LABEL: cos_testr
subroutine cos_testr(a, b)
real :: a, b
! CHECK: fir.call @fir.cos.contract.f32.f32
b = cos(a)
end subroutine
! CHECK-LABEL: cos_testd
subroutine cos_testd(a, b)
real(kind=8) :: a, b
! CHECK: fir.call @fir.cos.contract.f64.f64
b = cos(a)
end subroutine
! CHECK-LABEL: cos_testc
subroutine cos_testc(z)
complex :: z
! CHECK: fir.call @fir.cos.contract.z4.z4
z = cos(z)
end subroutine
! CHECK-LABEL: cos_testcd
subroutine cos_testcd(z)
complex(kind=8) :: z
! CHECK: fir.call @fir.cos.contract.z8.z8
z = cos(z)
end subroutine
! CHECK-LABEL: cosh_testr
subroutine cosh_testr(a, b)
real :: a, b
! CHECK: fir.call @fir.cosh.contract.f32.f32
b = cosh(a)
end subroutine
! CHECK-LABEL: cosh_testd
subroutine cosh_testd(a, b)
real(kind=8) :: a, b
! CHECK: fir.call @fir.cosh.contract.f64.f64
b = cosh(a)
end subroutine
! CHECK-LABEL: cosh_testc
subroutine cosh_testc(z)
complex :: z
! CHECK: fir.call @fir.cosh.contract.z4.z4
z = cosh(z)
end subroutine
! CHECK-LABEL: cosh_testcd
subroutine cosh_testcd(z)
complex(kind=8) :: z
! CHECK: fir.call @fir.cosh.contract.z8.z8
z = cosh(z)
end subroutine
! CHECK-LABEL: sin_testr
subroutine sin_testr(a, b)
real :: a, b
! CHECK: fir.call @fir.sin.contract.f32.f32
b = sin(a)
end subroutine
! CHECK-LABEL: sin_testd
subroutine sin_testd(a, b)
real(kind=8) :: a, b
! CHECK: fir.call @fir.sin.contract.f64.f64
b = sin(a)
end subroutine
! CHECK-LABEL: sin_testc
subroutine sin_testc(z)
complex :: z
! CHECK: fir.call @fir.sin.contract.z4.z4
z = sin(z)
end subroutine
! CHECK-LABEL: sin_testcd
subroutine sin_testcd(z)
complex(kind=8) :: z
! CHECK: fir.call @fir.sin.contract.z8.z8
z = sin(z)
end subroutine
! CHECK-LABEL: sinh_testr
subroutine sinh_testr(a, b)
real :: a, b
! CHECK: fir.call @fir.sinh.contract.f32.f32
b = sinh(a)
end subroutine
! CHECK-LABEL: sinh_testd
subroutine sinh_testd(a, b)
real(kind=8) :: a, b
! CHECK: fir.call @fir.sinh.contract.f64.f64
b = sinh(a)
end subroutine
! CHECK-LABEL: sinh_testc
subroutine sinh_testc(z)
complex :: z
! CHECK: fir.call @fir.sinh.contract.z4.z4
z = sinh(z)
end subroutine
! CHECK-LABEL: sinh_testcd
subroutine sinh_testcd(z)
complex(kind=8) :: z
! CHECK: fir.call @fir.sinh.contract.z8.z8
z = sinh(z)
end subroutine
! CHECK-LABEL: @fir.tan.contract.f32.f32
! CHECK: math.tan %{{.*}} : f32
! CHECK-LABEL: @fir.tan.contract.f64.f64
! CHECK: math.tan %{{.*}} : f64
! CHECK-LABEL: @fir.tan.contract.z4.z4
! CMPLX-FAST: complex.tan %{{.*}} : complex<f32>
! CMPLX-PRECISE: fir.call @ctanf
! CHECK-LABEL: @fir.tan.contract.z8.z8
! CMPLX-FAST: complex.tan %{{.*}} : complex<f64>
! CMPLX-PRECISE: fir.call @ctan
! CHECK-LABEL: @fir.atan.contract.f32.f32
! CHECK: math.atan %{{.*}} : f32
! CHECK-LABEL: @fir.atan.contract.f64.f64
! CHECK: math.atan %{{.*}} : f64
! CHECK-LABEL: @fir.atan.contract.z4.z4
! CHECK: fir.call @catanf
! CHECK-LABEL: @fir.atan.contract.z8.z8
! CHECK: fir.call @catan
! CHECK-LABEL: @fir.cos.contract.f32.f32
! CHECK: math.cos %{{.*}} : f32
! CHECK-LABEL: @fir.cos.contract.f64.f64
! CHECK: math.cos %{{.*}} : f64
! CHECK-LABEL: @fir.cos.contract.z4.z4
! CMPLX-FAST: complex.cos %{{.*}} : complex<f32>
! CMPLX-PRECISE: fir.call @ccosf
! CHECK-LABEL: @fir.cos.contract.z8.z8
! CMPLX-FAST: complex.cos %{{.*}} : complex<f64>
! CMPLX-PRECISE: fir.call @ccos
! CHECK-LABEL: @fir.cosh.contract.f32.f32
! CHECK: fir.call {{.*}}cosh
! CHECK-LABEL: @fir.cosh.contract.f64.f64
! CHECK: fir.call {{.*}}cosh
! CHECK-LABEL: @fir.cosh.contract.z4.z4
! CHECK: fir.call @ccoshf
! CHECK-LABEL: @fir.cosh.contract.z8.z8
! CHECK: fir.call @ccosh
! CHECK-LABEL: @fir.sin.contract.f32.f32
! CHECK: math.sin %{{.*}} : f32
! CHECK-LABEL: @fir.sin.contract.f64.f64
! CHECK: math.sin %{{.*}} : f64
! CHECK-LABEL: @fir.sin.contract.z4.z4
! CMPLX-FAST: complex.sin %{{.*}} : complex<f32>
! CMPLX-PRECISE: fir.call @csinf
! CHECK-LABEL: @fir.sin.contract.z8.z8
! CMPLX-FAST: complex.sin %{{.*}} : complex<f64>
! CMPLX-PRECISE: fir.call @csin
! CHECK-LABEL: @fir.sinh.contract.f32.f32
! CHECK: fir.call {{.*}}sinh
! CHECK-LABEL: @fir.sinh.contract.f64.f64
! CHECK: fir.call {{.*}}sinh
! CHECK-LABEL: @fir.sinh.contract.z4.z4
! CHECK: fir.call @csinhf
! CHECK-LABEL: @fir.sinh.contract.z8.z8
! CHECK: fir.call @csinh
|