https://github.com/luke-kiernan created https://github.com/llvm/llvm-project/pull/224792
The Darwin_libsystem_m veclib table mapped 17 of the 38 stems exported by libsystem_m.dylib. This adds 16 more, in both VecFuncs.def and the DARWIN_LIBSYSTEM_M_VECFUNCS defset, bringing it to 33. The remaining 5 are round, fma, fmod, sincos and sincospi; see #223283 for why each is skipped or deferred. Fixes #223283 >From 8d5c1e260db15afdb071ed583a207a4d7cb6c251 Mon Sep 17 00:00:00 2001 From: Luke Kiernan <[email protected]> Date: Fri, 18 Sep 2026 20:40:11 -0600 Subject: [PATCH] [TLI][Darwin] Add mappings for 16 more libsystem_m vector functions Add mappings in both VecFuncs.def and the DARWIN_LIBSYSTEM_M_VECFUNCS defset. Fixes #223283 Aided by: Claude Opus 5 (1M context) --- .../test/CodeGen/veclib-darwin-libsystem-m.c | 13 + llvm/include/llvm/Analysis/VecFuncs.def | 43 + llvm/include/llvm/IR/RuntimeLibcalls.td | 34 + ...trinsics-with-veclib-darwin-libsystem-m.ll | 96 ++ .../AArch64/veclib-calls-libsystem-darwin.ll | 1114 +++++++++++++---- 5 files changed, 1079 insertions(+), 221 deletions(-) diff --git a/clang/test/CodeGen/veclib-darwin-libsystem-m.c b/clang/test/CodeGen/veclib-darwin-libsystem-m.c index 23915147ded144..c6aa78fd88f7bc 100644 --- a/clang/test/CodeGen/veclib-darwin-libsystem-m.c +++ b/clang/test/CodeGen/veclib-darwin-libsystem-m.c @@ -14,3 +14,16 @@ void apply_sin(float *A, float *B, float *C, unsigned N) { for (unsigned i = 0; i < N; i++) C[i] = sinf(A[i]) + sinf(B[i]); } + +// __exp10f is a Darwin-only spelling with no plain-named counterpart in +// math.h, so check that the mapping keyed on it is reachable from C. + +extern float __exp10f(float); + +// CHECK-LABEL: define{{.*}}@apply_exp10 +// CHECK: call <4 x float> @_simd_exp10_f4( +// +void apply_exp10(float *A, float *B, float *C, unsigned N) { + for (unsigned i = 0; i < N; i++) + C[i] = __exp10f(A[i]) + __exp10f(B[i]); +} diff --git a/llvm/include/llvm/Analysis/VecFuncs.def b/llvm/include/llvm/Analysis/VecFuncs.def index 58fe1248dae3b1..4a62c764772622 100644 --- a/llvm/include/llvm/Analysis/VecFuncs.def +++ b/llvm/include/llvm/Analysis/VecFuncs.def @@ -79,6 +79,29 @@ TLI_DEFINE_VECFUNC("exp", "_simd_exp_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("llvm.exp.f64", "_simd_exp_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("expf", "_simd_exp_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("llvm.exp.f32", "_simd_exp_f4", FIXED(4), "_ZGV_LLVM_N4v") +// clang doesn't emit an intrinsic for exp10. +TLI_DEFINE_VECFUNC("__exp10", "_simd_exp10_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("__exp10f", "_simd_exp10_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("exp2", "_simd_exp2_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("llvm.exp2.f64", "_simd_exp2_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("exp2f", "_simd_exp2_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("llvm.exp2.f32", "_simd_exp2_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("expm1", "_simd_expm1_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("expm1f", "_simd_expm1_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("log", "_simd_log_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("llvm.log.f64", "_simd_log_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("logf", "_simd_log_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("llvm.log.f32", "_simd_log_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("log10", "_simd_log10_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("llvm.log10.f64", "_simd_log10_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("log10f", "_simd_log10_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("llvm.log10.f32", "_simd_log10_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("log1p", "_simd_log1p_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("log1pf", "_simd_log1p_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("log2", "_simd_log2_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("llvm.log2.f64", "_simd_log2_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("log2f", "_simd_log2_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("llvm.log2.f32", "_simd_log2_f4", FIXED(4), "_ZGV_LLVM_N4v") // Trigonometric Functions TLI_DEFINE_VECFUNC("acos", "_simd_acos_d2", FIXED(2), "_ZGV_LLVM_N2v") @@ -103,26 +126,44 @@ TLI_DEFINE_VECFUNC("cos", "_simd_cos_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("llvm.cos.f64", "_simd_cos_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("cosf", "_simd_cos_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("llvm.cos.f32", "_simd_cos_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("__cospi", "_simd_cospi_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("__cospif", "_simd_cospi_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("sin", "_simd_sin_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("llvm.sin.f64", "_simd_sin_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("sinf", "_simd_sin_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("llvm.sin.f32", "_simd_sin_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("__sinpi", "_simd_sinpi_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("__sinpif", "_simd_sinpi_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("tan", "_simd_tan_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("llvm.tan.f64", "_simd_tan_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("tanf", "_simd_tan_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("llvm.tan.f32", "_simd_tan_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("__tanpi", "_simd_tanpi_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("__tanpif", "_simd_tanpi_f4", FIXED(4), "_ZGV_LLVM_N4v") // Floating-Point Arithmetic and Auxiliary Functions TLI_DEFINE_VECFUNC("cbrt", "_simd_cbrt_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("cbrtf", "_simd_cbrt_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("erf", "_simd_erf_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("erff", "_simd_erf_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("erfc", "_simd_erfc_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("erfcf", "_simd_erfc_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("hypot", "_simd_hypot_d2", FIXED(2), "_ZGV_LLVM_N2vv") +TLI_DEFINE_VECFUNC("hypotf", "_simd_hypot_f4", FIXED(4), "_ZGV_LLVM_N4vv") +TLI_DEFINE_VECFUNC("lgamma", "_simd_lgamma_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("lgammaf", "_simd_lgamma_f4", FIXED(4), "_ZGV_LLVM_N4v") +TLI_DEFINE_VECFUNC("nextafter", "_simd_nextafter_d2", FIXED(2), "_ZGV_LLVM_N2vv") +TLI_DEFINE_VECFUNC("nextafterf", "_simd_nextafter_f4", FIXED(4), "_ZGV_LLVM_N4vv") TLI_DEFINE_VECFUNC("pow", "_simd_pow_d2", FIXED(2), "_ZGV_LLVM_N2vv") TLI_DEFINE_VECFUNC("llvm.pow.f64", "_simd_pow_d2", FIXED(2), "_ZGV_LLVM_N2vv") TLI_DEFINE_VECFUNC("powf", "_simd_pow_f4", FIXED(4), "_ZGV_LLVM_N4vv") TLI_DEFINE_VECFUNC("llvm.pow.f32", "_simd_pow_f4", FIXED(4), "_ZGV_LLVM_N4vv") +TLI_DEFINE_VECFUNC("remainder", "_simd_remainder_d2", FIXED(2), "_ZGV_LLVM_N2vv") +TLI_DEFINE_VECFUNC("remainderf", "_simd_remainder_f4", FIXED(4), "_ZGV_LLVM_N4vv") +TLI_DEFINE_VECFUNC("tgamma", "_simd_tgamma_d2", FIXED(2), "_ZGV_LLVM_N2v") +TLI_DEFINE_VECFUNC("tgammaf", "_simd_tgamma_f4", FIXED(4), "_ZGV_LLVM_N4v") // Hyperbolic Functions TLI_DEFINE_VECFUNC("sinh", "_simd_sinh_d2", FIXED(2), "_ZGV_LLVM_N2v") @@ -144,6 +185,8 @@ TLI_DEFINE_VECFUNC("acoshf", "_simd_acosh_f4", FIXED(4), "_ZGV_LLVM_N4v") TLI_DEFINE_VECFUNC("atanh", "_simd_atanh_d2", FIXED(2), "_ZGV_LLVM_N2v") TLI_DEFINE_VECFUNC("atanhf", "_simd_atanh_f4", FIXED(4), "_ZGV_LLVM_N4v") + +// end of darwin #elif defined(TLI_DEFINE_LIBMVEC_X86_VECFUNCS) // GLIBC Vector math Functions diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td index 46b9aba86ddd6b..e44fc62820e365 100644 --- a/llvm/include/llvm/IR/RuntimeLibcalls.td +++ b/llvm/include/llvm/IR/RuntimeLibcalls.td @@ -432,6 +432,7 @@ foreach S = !listconcat(F32VectorSuffixes, F64VectorSuffixes) in { def MODF_#S : RuntimeLibcall; def NEXTAFTER_#S : RuntimeLibcall; def POW_#S : RuntimeLibcall; + def REMAINDER_#S : RuntimeLibcall; def SINCOS_#S : RuntimeLibcall; def SINCOSPI_#S : RuntimeLibcall; def SIN_#S : RuntimeLibcall; @@ -440,6 +441,7 @@ foreach S = !listconcat(F32VectorSuffixes, F64VectorSuffixes) in { def SQRT_#S : RuntimeLibcall; def TAN_#S : RuntimeLibcall; def TANH_#S : RuntimeLibcall; + def TANPI_#S : RuntimeLibcall; def TGAMMA_#S : RuntimeLibcall; def CDFNORM_#S : RuntimeLibcall; def CDFNORMINV_#S : RuntimeLibcall; @@ -3725,20 +3727,52 @@ defset list<RuntimeLibcallImpl> DARWIN_LIBSYSTEM_M_VECFUNCS = { def _simd_cos_f4 : RuntimeLibcallImpl<COS_V4F32>; def _simd_cosh_d2 : RuntimeLibcallImpl<COSH_V2F64>; def _simd_cosh_f4 : RuntimeLibcallImpl<COSH_V4F32>; + def _simd_cospi_d2 : RuntimeLibcallImpl<COSPI_V2F64>; + def _simd_cospi_f4 : RuntimeLibcallImpl<COSPI_V4F32>; def _simd_erf_d2 : RuntimeLibcallImpl<ERF_V2F64>; def _simd_erf_f4 : RuntimeLibcallImpl<ERF_V4F32>; + def _simd_erfc_d2 : RuntimeLibcallImpl<ERFC_V2F64>; + def _simd_erfc_f4 : RuntimeLibcallImpl<ERFC_V4F32>; + def _simd_exp10_d2 : RuntimeLibcallImpl<EXP10_V2F64>; + def _simd_exp10_f4 : RuntimeLibcallImpl<EXP10_V4F32>; + def _simd_exp2_d2 : RuntimeLibcallImpl<EXP2_V2F64>; + def _simd_exp2_f4 : RuntimeLibcallImpl<EXP2_V4F32>; def _simd_exp_d2 : RuntimeLibcallImpl<EXP_V2F64>; def _simd_exp_f4 : RuntimeLibcallImpl<EXP_V4F32>; + def _simd_expm1_d2 : RuntimeLibcallImpl<EXPM1_V2F64>; + def _simd_expm1_f4 : RuntimeLibcallImpl<EXPM1_V4F32>; + def _simd_hypot_d2 : RuntimeLibcallImpl<HYPOT_V2F64>; + def _simd_hypot_f4 : RuntimeLibcallImpl<HYPOT_V4F32>; + def _simd_lgamma_d2 : RuntimeLibcallImpl<LGAMMA_V2F64>; + def _simd_lgamma_f4 : RuntimeLibcallImpl<LGAMMA_V4F32>; + def _simd_log10_d2 : RuntimeLibcallImpl<LOG10_V2F64>; + def _simd_log10_f4 : RuntimeLibcallImpl<LOG10_V4F32>; + def _simd_log1p_d2 : RuntimeLibcallImpl<LOG1P_V2F64>; + def _simd_log1p_f4 : RuntimeLibcallImpl<LOG1P_V4F32>; + def _simd_log2_d2 : RuntimeLibcallImpl<LOG2_V2F64>; + def _simd_log2_f4 : RuntimeLibcallImpl<LOG2_V4F32>; + def _simd_log_d2 : RuntimeLibcallImpl<LOG_V2F64>; + def _simd_log_f4 : RuntimeLibcallImpl<LOG_V4F32>; + def _simd_nextafter_d2 : RuntimeLibcallImpl<NEXTAFTER_V2F64>; + def _simd_nextafter_f4 : RuntimeLibcallImpl<NEXTAFTER_V4F32>; def _simd_pow_d2 : RuntimeLibcallImpl<POW_V2F64>; def _simd_pow_f4 : RuntimeLibcallImpl<POW_V4F32>; + def _simd_remainder_d2 : RuntimeLibcallImpl<REMAINDER_V2F64>; + def _simd_remainder_f4 : RuntimeLibcallImpl<REMAINDER_V4F32>; def _simd_sin_d2 : RuntimeLibcallImpl<SIN_V2F64>; def _simd_sin_f4 : RuntimeLibcallImpl<SIN_V4F32>; def _simd_sinh_d2 : RuntimeLibcallImpl<SINH_V2F64>; def _simd_sinh_f4 : RuntimeLibcallImpl<SINH_V4F32>; + def _simd_sinpi_d2 : RuntimeLibcallImpl<SINPI_V2F64>; + def _simd_sinpi_f4 : RuntimeLibcallImpl<SINPI_V4F32>; def _simd_tan_d2 : RuntimeLibcallImpl<TAN_V2F64>; def _simd_tan_f4 : RuntimeLibcallImpl<TAN_V4F32>; def _simd_tanh_d2 : RuntimeLibcallImpl<TANH_V2F64>; def _simd_tanh_f4 : RuntimeLibcallImpl<TANH_V4F32>; + def _simd_tanpi_d2 : RuntimeLibcallImpl<TANPI_V2F64>; + def _simd_tanpi_f4 : RuntimeLibcallImpl<TANPI_V4F32>; + def _simd_tgamma_d2 : RuntimeLibcallImpl<TGAMMA_V2F64>; + def _simd_tgamma_f4 : RuntimeLibcallImpl<TGAMMA_V4F32>; } //===----------------------------------------------------------------------===// diff --git a/llvm/test/CodeGen/Generic/replace-intrinsics-with-veclib-darwin-libsystem-m.ll b/llvm/test/CodeGen/Generic/replace-intrinsics-with-veclib-darwin-libsystem-m.ll index 7602e1900e436b..d1a6dba8b465f1 100644 --- a/llvm/test/CodeGen/Generic/replace-intrinsics-with-veclib-darwin-libsystem-m.ll +++ b/llvm/test/CodeGen/Generic/replace-intrinsics-with-veclib-darwin-libsystem-m.ll @@ -62,3 +62,99 @@ define <3 x double> @exp_v3(<3 x double> %in) { } declare <3 x double> @llvm.exp.v3f64(<3 x double>) #0 + +define <4 x float> @exp2_v4f32(<4 x float> %in) { +; CHECK-LABEL: define {{[^@]+}}@exp2_v4f32 +; CHECK-SAME: (<4 x float> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <4 x float> @_simd_exp2_f4(<4 x float> [[IN]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %call = call <4 x float> @llvm.exp2.v4f32(<4 x float> %in) + ret <4 x float> %call +} + +declare <4 x float> @llvm.exp2.v4f32(<4 x float>) #0 + +define <2 x double> @exp2_v2f64(<2 x double> %in) { +; CHECK-LABEL: define {{[^@]+}}@exp2_v2f64 +; CHECK-SAME: (<2 x double> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x double> @_simd_exp2_d2(<2 x double> [[IN]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %call = call <2 x double> @llvm.exp2.v2f64(<2 x double> %in) + ret <2 x double> %call +} + +declare <2 x double> @llvm.exp2.v2f64(<2 x double>) #0 + +define <4 x float> @log_v4f32(<4 x float> %in) { +; CHECK-LABEL: define {{[^@]+}}@log_v4f32 +; CHECK-SAME: (<4 x float> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <4 x float> @_simd_log_f4(<4 x float> [[IN]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %call = call <4 x float> @llvm.log.v4f32(<4 x float> %in) + ret <4 x float> %call +} + +declare <4 x float> @llvm.log.v4f32(<4 x float>) #0 + +define <2 x double> @log_v2f64(<2 x double> %in) { +; CHECK-LABEL: define {{[^@]+}}@log_v2f64 +; CHECK-SAME: (<2 x double> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x double> @_simd_log_d2(<2 x double> [[IN]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %call = call <2 x double> @llvm.log.v2f64(<2 x double> %in) + ret <2 x double> %call +} + +declare <2 x double> @llvm.log.v2f64(<2 x double>) #0 + +define <4 x float> @log2_v4f32(<4 x float> %in) { +; CHECK-LABEL: define {{[^@]+}}@log2_v4f32 +; CHECK-SAME: (<4 x float> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <4 x float> @_simd_log2_f4(<4 x float> [[IN]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %call = call <4 x float> @llvm.log2.v4f32(<4 x float> %in) + ret <4 x float> %call +} + +declare <4 x float> @llvm.log2.v4f32(<4 x float>) #0 + +define <2 x double> @log2_v2f64(<2 x double> %in) { +; CHECK-LABEL: define {{[^@]+}}@log2_v2f64 +; CHECK-SAME: (<2 x double> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x double> @_simd_log2_d2(<2 x double> [[IN]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %call = call <2 x double> @llvm.log2.v2f64(<2 x double> %in) + ret <2 x double> %call +} + +declare <2 x double> @llvm.log2.v2f64(<2 x double>) #0 + +define <4 x float> @log10_v4f32(<4 x float> %in) { +; CHECK-LABEL: define {{[^@]+}}@log10_v4f32 +; CHECK-SAME: (<4 x float> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <4 x float> @_simd_log10_f4(<4 x float> [[IN]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %call = call <4 x float> @llvm.log10.v4f32(<4 x float> %in) + ret <4 x float> %call +} + +declare <4 x float> @llvm.log10.v4f32(<4 x float>) #0 + +define <2 x double> @log10_v2f64(<2 x double> %in) { +; CHECK-LABEL: define {{[^@]+}}@log10_v2f64 +; CHECK-SAME: (<2 x double> [[IN:%.*]]) { +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x double> @_simd_log10_d2(<2 x double> [[IN]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %call = call <2 x double> @llvm.log10.v2f64(<2 x double> %in) + ret <2 x double> %call +} + +declare <2 x double> @llvm.log10.v2f64(<2 x double>) #0 diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/veclib-calls-libsystem-darwin.ll b/llvm/test/Transforms/LoopVectorize/AArch64/veclib-calls-libsystem-darwin.ll index 792564226e2ed9..fe3ecc2ef2cdfc 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/veclib-calls-libsystem-darwin.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/veclib-calls-libsystem-darwin.ll @@ -51,6 +51,342 @@ for.end: ret void } +declare float @exp2f(float) nounwind readnone +define void @exp2f_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @exp2f_v4f32( +; CHECK: call <4 x float> @_simd_exp2_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @exp2f(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @exp2(double) nounwind readnone +define void @exp2_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @exp2_v2f64( +; CHECK: call <2 x double> @_simd_exp2_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @exp2(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @__exp10f(float) nounwind readnone +define void @__exp10f_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__exp10f_v4f32( +; CHECK: call <4 x float> @_simd_exp10_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @__exp10f(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @__exp10(double) nounwind readnone +define void @__exp10_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__exp10_v2f64( +; CHECK: call <2 x double> @_simd_exp10_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @__exp10(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @expm1f(float) nounwind readnone +define void @expm1f_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @expm1f_v4f32( +; CHECK: call <4 x float> @_simd_expm1_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @expm1f(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @expm1(double) nounwind readnone +define void @expm1_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @expm1_v2f64( +; CHECK: call <2 x double> @_simd_expm1_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @expm1(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @logf(float) nounwind readnone +define void @logf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @logf_v4f32( +; CHECK: call <4 x float> @_simd_log_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @logf(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @log(double) nounwind readnone +define void @log_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @log_v2f64( +; CHECK: call <2 x double> @_simd_log_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @log(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @log10f(float) nounwind readnone +define void @log10f_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @log10f_v4f32( +; CHECK: call <4 x float> @_simd_log10_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @log10f(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @log10(double) nounwind readnone +define void @log10_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @log10_v2f64( +; CHECK: call <2 x double> @_simd_log10_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @log10(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @log1pf(float) nounwind readnone +define void @log1pf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @log1pf_v4f32( +; CHECK: call <4 x float> @_simd_log1p_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @log1pf(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @log1p(double) nounwind readnone +define void @log1p_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @log1p_v2f64( +; CHECK: call <2 x double> @_simd_log1p_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @log1p(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @log2f(float) nounwind readnone +define void @log2f_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @log2f_v4f32( +; CHECK: call <4 x float> @_simd_log2_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @log2f(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @log2(double) nounwind readnone +define void @log2_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @log2_v2f64( +; CHECK: call <2 x double> @_simd_log2_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @log2(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + declare float @acosf(float) nounwind readnone define void @acos_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { ; CHECK-LABEL: @acos_v4f32( @@ -64,7 +400,247 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @acosf(float %lv) + %call = tail call float @acosf(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @acos(double) nounwind readnone +define void @acos_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @acos_v2f64( +; CHECK: call <2 x double> @_simd_acos_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @acos(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @asinf(float) nounwind readnone +define void @asinf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @asinf_v4f32( +; CHECK: call <4 x float> @_simd_asin_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @asinf(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @asin(double) nounwind readnone +define void @asin_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @asin_v2f64( +; CHECK: call <2 x double> @_simd_asin_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @asin(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + + declare float @atanf(float) nounwind readnone +define void @atanf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atanf_v4f32( +; CHECK: call <4 x float> @_simd_atan_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @atanf(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @atan(double) nounwind readnone +define void @atan_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atan_v2f64( +; CHECK: call <2 x double> @_simd_atan_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @atan(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @atan2f(float, float) nounwind readnone +define void @atan2f_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atan2f_v4f32( +; CHECK: call <4 x float> @_simd_atan2_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @atan2f(float %lv, float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @atan2(double, double) nounwind readnone +define void @atan2_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atan2_v2f64( +; CHECK: call <2 x double> @_simd_atan2_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @atan2(double %lv, double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @cosf(float) nounwind readnone +define void @cosf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @cosf_v4f32( +; CHECK: call <4 x float> @_simd_cos_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @cosf(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare double @cos(double) nounwind readnone +define void @cos_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @cos_v2f64( +; CHECK: call <2 x double> @_simd_cos_d2( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @cos(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +declare float @sinf(float) nounwind readnone +define void @sinf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @sinf_v4f32( +; CHECK: call <4 x float> @_simd_sin_f4( +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @sinf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -75,10 +651,10 @@ for.end: ret void } -declare double @acos(double) nounwind readnone -define void @acos_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @acos_v2f64( -; CHECK: call <2 x double> @_simd_acos_d2( +declare double @sin(double) nounwind readnone +define void @sin_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @sin_v2f64( +; CHECK: call <2 x double> @_simd_sin_d2( ; CHECK: ret void entry: @@ -88,7 +664,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @acos(double %lv) + %call = tail call double @sin(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -99,10 +675,10 @@ for.end: ret void } -declare float @asinf(float) nounwind readnone -define void @asinf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @asinf_v4f32( -; CHECK: call <4 x float> @_simd_asin_f4( +declare float @tanf(float) nounwind readnone +define void @tanf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tanf_v4f32( +; CHECK: call <4 x float> @_simd_tan_f4( ; CHECK: ret void entry: @@ -112,7 +688,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @asinf(float %lv) + %call = tail call float @tanf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -123,10 +699,10 @@ for.end: ret void } -declare double @asin(double) nounwind readnone -define void @asin_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @asin_v2f64( -; CHECK: call <2 x double> @_simd_asin_d2( +declare double @tan(double) nounwind readnone +define void @tan_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tan_v2f64( +; CHECK: call <2 x double> @_simd_tan_d2( ; CHECK: ret void entry: @@ -136,7 +712,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @asin(double %lv) + %call = tail call double @tan(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -147,10 +723,9 @@ for.end: ret void } - declare float @atanf(float) nounwind readnone -define void @atanf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atanf_v4f32( -; CHECK: call <4 x float> @_simd_atan_f4( +define void @tan_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tan_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_tan_f4(<4 x float> ; CHECK: ret void entry: @@ -160,7 +735,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @atanf(float %lv) + %call = tail call float @llvm.tan.f32(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -171,10 +746,9 @@ for.end: ret void } -declare double @atan(double) nounwind readnone -define void @atan_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atan_v2f64( -; CHECK: call <2 x double> @_simd_atan_d2( +define void @tan_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tan_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_tan_d2(<2 x double> ; CHECK: ret void entry: @@ -184,7 +758,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @atan(double %lv) + %call = tail call double @llvm.tan.f64(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -195,10 +769,9 @@ for.end: ret void } -declare float @atan2f(float, float) nounwind readnone -define void @atan2f_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atan2f_v4f32( -; CHECK: call <4 x float> @_simd_atan2_f4( +define void @acos_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @acos_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_acos_f4(<4 x float> ; CHECK: ret void entry: @@ -208,7 +781,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @atan2f(float %lv, float %lv) + %call = tail call float @llvm.acos.f32(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -219,10 +792,9 @@ for.end: ret void } -declare double @atan2(double, double) nounwind readnone -define void @atan2_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atan2_v2f64( -; CHECK: call <2 x double> @_simd_atan2_d2( +define void @acos_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @acos_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_acos_d2(<2 x double> ; CHECK: ret void entry: @@ -232,7 +804,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @atan2(double %lv, double %lv) + %call = tail call double @llvm.acos.f64(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -243,10 +815,9 @@ for.end: ret void } -declare float @cosf(float) nounwind readnone -define void @cosf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @cosf_v4f32( -; CHECK: call <4 x float> @_simd_cos_f4( +define void @asin_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @asin_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_asin_f4(<4 x float> ; CHECK: ret void entry: @@ -256,7 +827,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @cosf(float %lv) + %call = tail call float @llvm.asin.f32(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -267,10 +838,9 @@ for.end: ret void } -declare double @cos(double) nounwind readnone -define void @cos_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @cos_v2f64( -; CHECK: call <2 x double> @_simd_cos_d2( +define void @asin_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @asin_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_asin_d2(<2 x double> ; CHECK: ret void entry: @@ -280,7 +850,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @cos(double %lv) + %call = tail call double @llvm.asin.f64(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -291,10 +861,9 @@ for.end: ret void } -declare float @sinf(float) nounwind readnone -define void @sinf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @sinf_v4f32( -; CHECK: call <4 x float> @_simd_sin_f4( +define void @atan_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atan_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_atan_f4(<4 x float> ; CHECK: ret void entry: @@ -304,7 +873,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @sinf(float %lv) + %call = tail call float @llvm.atan.f32(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -315,10 +884,9 @@ for.end: ret void } -declare double @sin(double) nounwind readnone -define void @sin_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @sin_v2f64( -; CHECK: call <2 x double> @_simd_sin_d2( +define void @atan_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atan_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_atan_d2(<2 x double> ; CHECK: ret void entry: @@ -328,7 +896,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @sin(double %lv) + %call = tail call double @llvm.atan.f64(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -339,10 +907,9 @@ for.end: ret void } -declare float @tanf(float) nounwind readnone -define void @tanf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tanf_v4f32( -; CHECK: call <4 x float> @_simd_tan_f4( +define void @atan2_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atan2_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_atan2_f4(<4 x float> ; CHECK: ret void entry: @@ -352,7 +919,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @tanf(float %lv) + %call = tail call float @llvm.atan2.f32(float %lv, float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -363,10 +930,101 @@ for.end: ret void } -declare double @tan(double) nounwind readnone -define void @tan_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tan_v2f64( -; CHECK: call <2 x double> @_simd_tan_d2( +define void @atan2_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atan2_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_atan2_d2(<2 x double> +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @llvm.atan2.f64(double %lv, double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +define void @cosh_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @cosh_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_cosh_f4(<4 x float> +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @llvm.cosh.f32(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +define void @cosh_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @cosh_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_cosh_d2(<2 x double> +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds double, ptr %y, i64 %iv + %lv = load double, ptr %gep.y, align 4 + %call = tail call double @llvm.cosh.f64(double %lv) + %gep.x = getelementptr inbounds double, ptr %x, i64 %iv + store double %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +define void @sinh_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @sinh_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_sinh_f4(<4 x float> +; CHECK: ret void + +entry: + br label %for.body + +for.body: + %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] + %gep.y = getelementptr inbounds float, ptr %y, i64 %iv + %lv = load float, ptr %gep.y, align 4 + %call = tail call float @llvm.sinh.f32(float %lv) + %gep.x = getelementptr inbounds float, ptr %x, i64 %iv + store float %call, ptr %gep.x, align 4 + %iv.next = add i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} + +define void @sinh_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @sinh_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_sinh_d2(<2 x double> ; CHECK: ret void entry: @@ -376,7 +1034,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @tan(double %lv) + %call = tail call double @llvm.sinh.f64(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -387,9 +1045,9 @@ for.end: ret void } -define void @tan_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tan_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_tan_f4(<4 x float> +define void @tanh_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tanh_v4f32_intrinsic( +; CHECK: call <4 x float> @_simd_tanh_f4(<4 x float> ; CHECK: ret void entry: @@ -399,7 +1057,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.tan.f32(float %lv) + %call = tail call float @llvm.tanh.f32(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -410,9 +1068,9 @@ for.end: ret void } -define void @tan_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tan_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_tan_d2(<2 x double> +define void @tanh_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tanh_v2f64_intrinsic( +; CHECK: call <2 x double> @_simd_tanh_d2(<2 x double> ; CHECK: ret void entry: @@ -422,7 +1080,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.tan.f64(double %lv) + %call = tail call double @llvm.tanh.f64(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -433,9 +1091,11 @@ for.end: ret void } -define void @acos_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @acos_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_acos_f4(<4 x float> + +declare float @cbrtf(float) nounwind readnone +define void @cbrtf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @cbrtf_v4f32( +; CHECK: call <4 x float> @_simd_cbrt_f4( ; CHECK: ret void entry: @@ -445,7 +1105,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.acos.f32(float %lv) + %call = tail call float @cbrtf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -456,9 +1116,10 @@ for.end: ret void } -define void @acos_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @acos_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_acos_d2(<2 x double> +declare double @cbrt(double) nounwind readnone +define void @cbrt_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @cbrt_v2f64( +; CHECK: call <2 x double> @_simd_cbrt_d2( ; CHECK: ret void entry: @@ -468,7 +1129,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.acos.f64(double %lv) + %call = tail call double @cbrt(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -479,9 +1140,10 @@ for.end: ret void } -define void @asin_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @asin_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_asin_f4(<4 x float> +declare float @erff(float) nounwind readnone +define void @erff_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @erff_v4f32( +; CHECK: call <4 x float> @_simd_erf_f4( ; CHECK: ret void entry: @@ -491,7 +1153,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.asin.f32(float %lv) + %call = tail call float @erff(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -502,9 +1164,10 @@ for.end: ret void } -define void @asin_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @asin_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_asin_d2(<2 x double> +declare double @erf(double) nounwind readnone +define void @erf_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @erf_v2f64( +; CHECK: call <2 x double> @_simd_erf_d2( ; CHECK: ret void entry: @@ -514,7 +1177,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.asin.f64(double %lv) + %call = tail call double @erf(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -525,9 +1188,10 @@ for.end: ret void } -define void @atan_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atan_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_atan_f4(<4 x float> +declare float @powf(float, float) nounwind readnone +define void @powf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @powf_v4f32( +; CHECK: call <4 x float> @_simd_pow_f4( ; CHECK: ret void entry: @@ -537,7 +1201,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.atan.f32(float %lv) + %call = tail call float @powf(float %lv, float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -548,9 +1212,10 @@ for.end: ret void } -define void @atan_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atan_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_atan_d2(<2 x double> +declare double @pow(double, double) nounwind readnone +define void @pow_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @pow_v2f64( +; CHECK: call <2 x double> @_simd_pow_d2( ; CHECK: ret void entry: @@ -560,7 +1225,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.atan.f64(double %lv) + %call = tail call double @pow(double %lv, double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -571,9 +1236,10 @@ for.end: ret void } -define void @atan2_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atan2_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_atan2_f4(<4 x float> +declare float @sinhf(float) nounwind readnone +define void @sinhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @sinhf_v4f32( +; CHECK: call <4 x float> @_simd_sinh_f4( ; CHECK: ret void entry: @@ -583,7 +1249,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.atan2.f32(float %lv, float %lv) + %call = tail call float @sinhf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -594,9 +1260,10 @@ for.end: ret void } -define void @atan2_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atan2_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_atan2_d2(<2 x double> +declare double @sinh(double) nounwind readnone +define void @sinh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @sinh_v2f64( +; CHECK: call <2 x double> @_simd_sinh_d2( ; CHECK: ret void entry: @@ -606,7 +1273,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.atan2.f64(double %lv, double %lv) + %call = tail call double @sinh(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -617,9 +1284,10 @@ for.end: ret void } -define void @cosh_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @cosh_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_cosh_f4(<4 x float> +declare float @coshf(float) nounwind readnone +define void @coshf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @coshf_v4f32( +; CHECK: call <4 x float> @_simd_cosh_f4( ; CHECK: ret void entry: @@ -629,7 +1297,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.cosh.f32(float %lv) + %call = tail call float @coshf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -640,9 +1308,10 @@ for.end: ret void } -define void @cosh_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @cosh_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_cosh_d2(<2 x double> +declare double @cosh(double) nounwind readnone +define void @cosh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @cosh_v2f64( +; CHECK: call <2 x double> @_simd_cosh_d2( ; CHECK: ret void entry: @@ -652,7 +1321,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.cosh.f64(double %lv) + %call = tail call double @cosh(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -663,9 +1332,10 @@ for.end: ret void } -define void @sinh_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @sinh_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_sinh_f4(<4 x float> +declare float @tanhf(float) nounwind readnone +define void @tanhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tanhf_v4f32( +; CHECK: call <4 x float> @_simd_tanh_f4( ; CHECK: ret void entry: @@ -675,7 +1345,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.sinh.f32(float %lv) + %call = tail call float @tanhf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -686,9 +1356,10 @@ for.end: ret void } -define void @sinh_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @sinh_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_sinh_d2(<2 x double> +declare double @tanh(double) nounwind readnone +define void @tanh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tanh_v2f64( +; CHECK: call <2 x double> @_simd_tanh_d2( ; CHECK: ret void entry: @@ -698,7 +1369,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.sinh.f64(double %lv) + %call = tail call double @tanh(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -709,9 +1380,10 @@ for.end: ret void } -define void @tanh_v4f32_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tanh_v4f32_intrinsic( -; CHECK: call <4 x float> @_simd_tanh_f4(<4 x float> +declare float @asinhf(float) nounwind readnone +define void @asinhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @asinhf_v4f32( +; CHECK: call <4 x float> @_simd_asinh_f4( ; CHECK: ret void entry: @@ -721,7 +1393,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @llvm.tanh.f32(float %lv) + %call = tail call float @asinhf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -732,9 +1404,10 @@ for.end: ret void } -define void @tanh_v2f64_intrinsic(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tanh_v2f64_intrinsic( -; CHECK: call <2 x double> @_simd_tanh_d2(<2 x double> +declare double @asinh(double) nounwind readnone +define void @asinh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @asinh_v2f64( +; CHECK: call <2 x double> @_simd_asinh_d2( ; CHECK: ret void entry: @@ -744,7 +1417,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @llvm.tanh.f64(double %lv) + %call = tail call double @asinh(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -755,11 +1428,10 @@ for.end: ret void } - -declare float @cbrtf(float) nounwind readnone -define void @cbrtf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @cbrtf_v4f32( -; CHECK: call <4 x float> @_simd_cbrt_f4( +declare float @acoshf(float) nounwind readnone +define void @acoshf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @acoshf_v4f32( +; CHECK: call <4 x float> @_simd_acosh_f4( ; CHECK: ret void entry: @@ -769,7 +1441,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @cbrtf(float %lv) + %call = tail call float @acoshf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -780,10 +1452,10 @@ for.end: ret void } -declare double @cbrt(double) nounwind readnone -define void @cbrt_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @cbrt_v2f64( -; CHECK: call <2 x double> @_simd_cbrt_d2( +declare double @acosh(double) nounwind readnone +define void @acosh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @acosh_v2f64( +; CHECK: call <2 x double> @_simd_acosh_d2( ; CHECK: ret void entry: @@ -793,7 +1465,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @cbrt(double %lv) + %call = tail call double @acosh(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -804,10 +1476,10 @@ for.end: ret void } -declare float @erff(float) nounwind readnone -define void @erff_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @erff_v4f32( -; CHECK: call <4 x float> @_simd_erf_f4( +declare float @atanhf(float) nounwind readnone +define void @atanhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atanhf_v4f32( +; CHECK: call <4 x float> @_simd_atanh_f4( ; CHECK: ret void entry: @@ -817,7 +1489,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @erff(float %lv) + %call = tail call float @atanhf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -828,10 +1500,10 @@ for.end: ret void } -declare double @erf(double) nounwind readnone -define void @erf_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @erf_v2f64( -; CHECK: call <2 x double> @_simd_erf_d2( +declare double @atanh(double) nounwind readnone +define void @atanh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @atanh_v2f64( +; CHECK: call <2 x double> @_simd_atanh_d2( ; CHECK: ret void entry: @@ -841,7 +1513,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @erf(double %lv) + %call = tail call double @atanh(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -852,10 +1524,10 @@ for.end: ret void } -declare float @powf(float, float) nounwind readnone -define void @powf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @powf_v4f32( -; CHECK: call <4 x float> @_simd_pow_f4( +declare float @__cospif(float) nounwind readnone +define void @__cospif_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__cospif_v4f32( +; CHECK: call <4 x float> @_simd_cospi_f4( ; CHECK: ret void entry: @@ -865,7 +1537,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @powf(float %lv, float %lv) + %call = tail call float @__cospif(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -876,10 +1548,10 @@ for.end: ret void } -declare double @pow(double, double) nounwind readnone -define void @pow_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @pow_v2f64( -; CHECK: call <2 x double> @_simd_pow_d2( +declare double @__cospi(double) nounwind readnone +define void @__cospi_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__cospi_v2f64( +; CHECK: call <2 x double> @_simd_cospi_d2( ; CHECK: ret void entry: @@ -889,7 +1561,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @pow(double %lv, double %lv) + %call = tail call double @__cospi(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -900,10 +1572,10 @@ for.end: ret void } -declare float @sinhf(float) nounwind readnone -define void @sinhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @sinhf_v4f32( -; CHECK: call <4 x float> @_simd_sinh_f4( +declare float @__sinpif(float) nounwind readnone +define void @__sinpif_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__sinpif_v4f32( +; CHECK: call <4 x float> @_simd_sinpi_f4( ; CHECK: ret void entry: @@ -913,7 +1585,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @sinhf(float %lv) + %call = tail call float @__sinpif(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -924,10 +1596,10 @@ for.end: ret void } -declare double @sinh(double) nounwind readnone -define void @sinh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @sinh_v2f64( -; CHECK: call <2 x double> @_simd_sinh_d2( +declare double @__sinpi(double) nounwind readnone +define void @__sinpi_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__sinpi_v2f64( +; CHECK: call <2 x double> @_simd_sinpi_d2( ; CHECK: ret void entry: @@ -937,7 +1609,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @sinh(double %lv) + %call = tail call double @__sinpi(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -948,10 +1620,10 @@ for.end: ret void } -declare float @coshf(float) nounwind readnone -define void @coshf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @coshf_v4f32( -; CHECK: call <4 x float> @_simd_cosh_f4( +declare float @__tanpif(float) nounwind readnone +define void @__tanpif_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__tanpif_v4f32( +; CHECK: call <4 x float> @_simd_tanpi_f4( ; CHECK: ret void entry: @@ -961,7 +1633,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @coshf(float %lv) + %call = tail call float @__tanpif(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -972,10 +1644,10 @@ for.end: ret void } -declare double @cosh(double) nounwind readnone -define void @cosh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @cosh_v2f64( -; CHECK: call <2 x double> @_simd_cosh_d2( +declare double @__tanpi(double) nounwind readnone +define void @__tanpi_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @__tanpi_v2f64( +; CHECK: call <2 x double> @_simd_tanpi_d2( ; CHECK: ret void entry: @@ -985,7 +1657,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @cosh(double %lv) + %call = tail call double @__tanpi(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -996,10 +1668,10 @@ for.end: ret void } -declare float @tanhf(float) nounwind readnone -define void @tanhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tanhf_v4f32( -; CHECK: call <4 x float> @_simd_tanh_f4( +declare float @hypotf(float, float) nounwind readnone +define void @hypotf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @hypotf_v4f32( +; CHECK: call <4 x float> @_simd_hypot_f4( ; CHECK: ret void entry: @@ -1009,7 +1681,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @tanhf(float %lv) + %call = tail call float @hypotf(float %lv, float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -1020,10 +1692,10 @@ for.end: ret void } -declare double @tanh(double) nounwind readnone -define void @tanh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @tanh_v2f64( -; CHECK: call <2 x double> @_simd_tanh_d2( +declare double @hypot(double, double) nounwind readnone +define void @hypot_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @hypot_v2f64( +; CHECK: call <2 x double> @_simd_hypot_d2( ; CHECK: ret void entry: @@ -1033,7 +1705,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @tanh(double %lv) + %call = tail call double @hypot(double %lv, double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -1044,10 +1716,10 @@ for.end: ret void } -declare float @asinhf(float) nounwind readnone -define void @asinhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @asinhf_v4f32( -; CHECK: call <4 x float> @_simd_asinh_f4( +declare float @erfcf(float) nounwind readnone +define void @erfcf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @erfcf_v4f32( +; CHECK: call <4 x float> @_simd_erfc_f4( ; CHECK: ret void entry: @@ -1057,7 +1729,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @asinhf(float %lv) + %call = tail call float @erfcf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -1068,10 +1740,10 @@ for.end: ret void } -declare double @asinh(double) nounwind readnone -define void @asinh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @asinh_v2f64( -; CHECK: call <2 x double> @_simd_asinh_d2( +declare double @erfc(double) nounwind readnone +define void @erfc_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @erfc_v2f64( +; CHECK: call <2 x double> @_simd_erfc_d2( ; CHECK: ret void entry: @@ -1081,7 +1753,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @asinh(double %lv) + %call = tail call double @erfc(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -1092,10 +1764,10 @@ for.end: ret void } -declare float @acoshf(float) nounwind readnone -define void @acoshf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @acoshf_v4f32( -; CHECK: call <4 x float> @_simd_acosh_f4( +declare float @lgammaf(float) nounwind readnone +define void @lgammaf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @lgammaf_v4f32( +; CHECK: call <4 x float> @_simd_lgamma_f4( ; CHECK: ret void entry: @@ -1105,7 +1777,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @acoshf(float %lv) + %call = tail call float @lgammaf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -1116,10 +1788,10 @@ for.end: ret void } -declare double @acosh(double) nounwind readnone -define void @acosh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @acosh_v2f64( -; CHECK: call <2 x double> @_simd_acosh_d2( +declare double @lgamma(double) nounwind readnone +define void @lgamma_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @lgamma_v2f64( +; CHECK: call <2 x double> @_simd_lgamma_d2( ; CHECK: ret void entry: @@ -1129,7 +1801,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @acosh(double %lv) + %call = tail call double @lgamma(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -1140,10 +1812,10 @@ for.end: ret void } -declare float @atanhf(float) nounwind readnone -define void @atanhf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atanhf_v4f32( -; CHECK: call <4 x float> @_simd_atanh_f4( +declare float @tgammaf(float) nounwind readnone +define void @tgammaf_v4f32(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tgammaf_v4f32( +; CHECK: call <4 x float> @_simd_tgamma_f4( ; CHECK: ret void entry: @@ -1153,7 +1825,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds float, ptr %y, i64 %iv %lv = load float, ptr %gep.y, align 4 - %call = tail call float @atanhf(float %lv) + %call = tail call float @tgammaf(float %lv) %gep.x = getelementptr inbounds float, ptr %x, i64 %iv store float %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 @@ -1164,10 +1836,10 @@ for.end: ret void } -declare double @atanh(double) nounwind readnone -define void @atanh_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { -; CHECK-LABEL: @atanh_v2f64( -; CHECK: call <2 x double> @_simd_atanh_d2( +declare double @tgamma(double) nounwind readnone +define void @tgamma_v2f64(i64 %n, ptr noalias %y, ptr noalias %x) { +; CHECK-LABEL: @tgamma_v2f64( +; CHECK: call <2 x double> @_simd_tgamma_d2( ; CHECK: ret void entry: @@ -1177,7 +1849,7 @@ for.body: %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] %gep.y = getelementptr inbounds double, ptr %y, i64 %iv %lv = load double, ptr %gep.y, align 4 - %call = tail call double @atanh(double %lv) + %call = tail call double @tgamma(double %lv) %gep.x = getelementptr inbounds double, ptr %x, i64 %iv store double %call, ptr %gep.x, align 4 %iv.next = add i64 %iv, 1 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
