|
1 |
| -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --scrub-attributes --filter "call.*(acos|asin|atan|cos|cosh|exp|log|sin|sinh|pow|ceil|copysign|fabs|floor|fma|m..num|nearbyint|rint|round|sqrt|tan|tanh|trunc)" --version 2 |
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --scrub-attributes --filter "call.*(acos|asin|atan|atan2|cos|cosh|exp|log|sin|sinh|pow|ceil|copysign|fabs|floor|fma|m..num|nearbyint|rint|round|sqrt|tan|tanh|trunc)" --version 2 |
2 | 2 |
|
3 | 3 | ; RUN: opt -mattr=+neon -vector-library=sleefgnuabi -passes=inject-tli-mappings,loop-vectorize,simplifycfg -force-vector-interleave=1 -S < %s | FileCheck %s --check-prefix=SLEEF-NEON
|
4 | 4 | ; RUN: opt -mattr=+sve -vector-library=sleefgnuabi -passes=inject-tli-mappings,loop-vectorize,simplifycfg -force-vector-interleave=1 -prefer-predicate-over-epilogue=predicate-dont-vectorize -S < %s | FileCheck %s --check-prefix=SLEEF-SVE
|
@@ -231,6 +231,79 @@ define void @atan_f32(ptr noalias %in.ptr, ptr %out.ptr) {
|
231 | 231 | ret void
|
232 | 232 | }
|
233 | 233 |
|
| 234 | +declare double @llvm.atan2.f64(double, double) |
| 235 | +declare float @llvm.atan2.f32(float, float) |
| 236 | + |
| 237 | +define void @atan2_f64(ptr noalias %in.ptr, ptr %out.ptr) { |
| 238 | +; SLEEF-NEON-LABEL: define void @atan2_f64 |
| 239 | +; SLEEF-NEON-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 240 | +; SLEEF-NEON: [[TMP3:%.*]] = call <2 x double> @_ZGVnN2vv_atan2(<2 x double> [[WIDE_LOAD:%.*]], <2 x double> [[WIDE_LOAD]]) |
| 241 | +; |
| 242 | +; SLEEF-SVE-LABEL: define void @atan2_f64 |
| 243 | +; SLEEF-SVE-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 244 | +; SLEEF-SVE: [[TMP13:%.*]] = call <vscale x 2 x double> @_ZGVsMxvv_atan2(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], <vscale x 2 x double> [[WIDE_MASKED_LOAD]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 245 | +; |
| 246 | +; ARMPL-NEON-LABEL: define void @atan2_f64 |
| 247 | +; ARMPL-NEON-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 248 | +; ARMPL-NEON: [[TMP3:%.*]] = call <2 x double> @armpl_vatan2q_f64(<2 x double> [[WIDE_LOAD:%.*]], <2 x double> [[WIDE_LOAD]]) |
| 249 | +; |
| 250 | +; ARMPL-SVE-LABEL: define void @atan2_f64 |
| 251 | +; ARMPL-SVE-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 252 | +; ARMPL-SVE: [[TMP13:%.*]] = call <vscale x 2 x double> @armpl_svatan2_f64_x(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], <vscale x 2 x double> [[WIDE_MASKED_LOAD]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 253 | +; |
| 254 | + entry: |
| 255 | + br label %for.body |
| 256 | + |
| 257 | + for.body: |
| 258 | + %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] |
| 259 | + %in.gep = getelementptr inbounds double, ptr %in.ptr, i64 %iv |
| 260 | + %in = load double, ptr %in.gep, align 8 |
| 261 | + %call = tail call double @llvm.atan2.f64(double %in, double %in) |
| 262 | + %out.gep = getelementptr inbounds double, ptr %out.ptr, i64 %iv |
| 263 | + store double %call, ptr %out.gep, align 8 |
| 264 | + %iv.next = add nuw nsw i64 %iv, 1 |
| 265 | + %exitcond = icmp eq i64 %iv.next, 1000 |
| 266 | + br i1 %exitcond, label %for.end, label %for.body |
| 267 | + |
| 268 | + for.end: |
| 269 | + ret void |
| 270 | +} |
| 271 | + |
| 272 | +define void @atan2_f32(ptr noalias %in.ptr, ptr %out.ptr) { |
| 273 | +; SLEEF-NEON-LABEL: define void @atan2_f32 |
| 274 | +; SLEEF-NEON-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 275 | +; SLEEF-NEON: [[TMP3:%.*]] = call <4 x float> @_ZGVnN4vv_atan2f(<4 x float> [[WIDE_LOAD:%.*]], <4 x float> [[WIDE_LOAD]]) |
| 276 | +; |
| 277 | +; SLEEF-SVE-LABEL: define void @atan2_f32 |
| 278 | +; SLEEF-SVE-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 279 | +; SLEEF-SVE: [[TMP13:%.*]] = call <vscale x 4 x float> @_ZGVsMxvv_atan2f(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], <vscale x 4 x float> [[WIDE_MASKED_LOAD]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 280 | +; |
| 281 | +; ARMPL-NEON-LABEL: define void @atan2_f32 |
| 282 | +; ARMPL-NEON-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 283 | +; ARMPL-NEON: [[TMP3:%.*]] = call <4 x float> @armpl_vatan2q_f32(<4 x float> [[WIDE_LOAD:%.*]], <4 x float> [[WIDE_LOAD]]) |
| 284 | +; |
| 285 | +; ARMPL-SVE-LABEL: define void @atan2_f32 |
| 286 | +; ARMPL-SVE-SAME: (ptr noalias [[IN_PTR:%.*]], ptr [[OUT_PTR:%.*]]) #[[ATTR1]] { |
| 287 | +; ARMPL-SVE: [[TMP13:%.*]] = call <vscale x 4 x float> @armpl_svatan2_f32_x(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], <vscale x 4 x float> [[WIDE_MASKED_LOAD]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 288 | +; |
| 289 | + entry: |
| 290 | + br label %for.body |
| 291 | + |
| 292 | + for.body: |
| 293 | + %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] |
| 294 | + %in.gep = getelementptr inbounds float, ptr %in.ptr, i64 %iv |
| 295 | + %in = load float, ptr %in.gep, align 8 |
| 296 | + %call = tail call float @llvm.atan2.f32(float %in, float %in) |
| 297 | + %out.gep = getelementptr inbounds float, ptr %out.ptr, i64 %iv |
| 298 | + store float %call, ptr %out.gep, align 4 |
| 299 | + %iv.next = add nuw nsw i64 %iv, 1 |
| 300 | + %exitcond = icmp eq i64 %iv.next, 1000 |
| 301 | + br i1 %exitcond, label %for.end, label %for.body |
| 302 | + |
| 303 | + for.end: |
| 304 | + ret void |
| 305 | +} |
| 306 | + |
234 | 307 | declare double @llvm.ceil.f64(double)
|
235 | 308 | declare float @llvm.ceil.f32(float)
|
236 | 309 |
|
|
0 commit comments