diff --git a/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sleef-scalable.ll b/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sleef-scalable.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sleef-scalable.ll @@ -0,0 +1,407 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt -vector-library=sleefgnuabi -replace-with-veclib -S < %s | FileCheck %s + +target triple = "aarch64-unknown-linux-gnu" + +; NOTE: The existing TLI mappings are not used since the -replace-with-veclib pass is broken for scalable vectors. + +define @llvm_ceil_vscale_f64( %in) { +; CHECK-LABEL: @llvm_ceil_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.ceil.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.ceil.nxv2f64( %in) + ret %1 +} + +define @llvm_ceil_vscale_f32( %in) { +; CHECK-LABEL: @llvm_ceil_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.ceil.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.ceil.nxv4f32( %in) + ret %1 +} + +define @llvm_copysign_vscale_f64( %mag, %sgn) { +; CHECK-LABEL: @llvm_copysign_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.copysign.nxv2f64( [[MAG:%.*]], [[SGN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.copysign.nxv2f64( %mag, %sgn) + ret %1 +} + +define @llvm_copysign_vscale_f32( %mag, %sgn) { +; CHECK-LABEL: @llvm_copysign_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.copysign.nxv4f32( [[MAG:%.*]], [[SGN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.copysign.nxv4f32( %mag, %sgn) + ret %1 +} + +define @llvm_cos_vscale_f64( %in) { +; CHECK-LABEL: @llvm_cos_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.cos.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.cos.nxv2f64( %in) + ret %1 +} + +define @llvm_cos_vscale_f32( %in) { +; CHECK-LABEL: @llvm_cos_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.cos.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.cos.nxv4f32( %in) + ret %1 +} + +define @llvm_exp_vscale_f64( %in) { +; CHECK-LABEL: @llvm_exp_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.exp.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.exp.nxv2f64( %in) + ret %1 +} + +define @llvm_exp_vscale_f32( %in) { +; CHECK-LABEL: @llvm_exp_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.exp.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.exp.nxv4f32( %in) + ret %1 +} + +define @llvm_exp2_vscale_f64( %in) { +; CHECK-LABEL: @llvm_exp2_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.exp2.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.exp2.nxv2f64( %in) + ret %1 +} + +define @llvm_exp2_vscale_f32( %in) { +; CHECK-LABEL: @llvm_exp2_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.exp2.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.exp2.nxv4f32( %in) + ret %1 +} + +define @llvm_fabs_vscale_f64( %in) { +; CHECK-LABEL: @llvm_fabs_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.fabs.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.fabs.nxv2f64( %in) + ret %1 +} + +define @llvm_fabs_vscale_f32( %in) { +; CHECK-LABEL: @llvm_fabs_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.fabs.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.fabs.nxv4f32( %in) + ret %1 +} + +define @llvm_floor_vscale_f64( %in) { +; CHECK-LABEL: @llvm_floor_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.floor.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.floor.nxv2f64( %in) + ret %1 +} + +define @llvm_floor_vscale_f32( %in) { +; CHECK-LABEL: @llvm_floor_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.floor.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.floor.nxv4f32( %in) + ret %1 +} + +define @llvm_fma_vscale_f64( %a, %b, %c ) { +; CHECK-LABEL: @llvm_fma_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.fma.nxv2f64( [[A:%.*]], [[B:%.*]], [[C:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.fma.nxv2f64( %a, %b, %c) + ret %1 +} + +define @llvm_fma_vscale_f32( %a, %b, %c) { +; CHECK-LABEL: @llvm_fma_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.fma.nxv4f32( [[A:%.*]], [[B:%.*]], [[C:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.fma.nxv4f32( %a, %b, %c) + ret %1 +} + +define @llvm_log_vscale_f64( %in) { +; CHECK-LABEL: @llvm_log_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.log.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.log.nxv2f64( %in) + ret %1 +} + +define @llvm_log_vscale_f32( %in) { +; CHECK-LABEL: @llvm_log_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.log.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.log.nxv4f32( %in) + ret %1 +} + +define @llvm_log2_vscale_f64( %in) { +; CHECK-LABEL: @llvm_log2_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.log2.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.log2.nxv2f64( %in) + ret %1 +} + +define @llvm_log2_vscale_f32( %in) { +; CHECK-LABEL: @llvm_log2_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.log2.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.log2.nxv4f32( %in) + ret %1 +} + +define @llvm_log10_vscale_f64( %in) { +; CHECK-LABEL: @llvm_log10_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.log10.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.log10.nxv2f64( %in) + ret %1 +} + +define @llvm_log10_vscale_f32( %in) { +; CHECK-LABEL: @llvm_log10_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.log10.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.log10.nxv4f32( %in) + ret %1 +} + +define @llvm_maxnum_vscale_f64( %in0, %in1) { +; CHECK-LABEL: @llvm_maxnum_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.maxnum.nxv2f64( [[IN0:%.*]], [[IN1:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.maxnum.nxv2f64( %in0, %in1) + ret %1 +} + +define @llvm_maxnum_vscale_f32( %in0, %in1) { +; CHECK-LABEL: @llvm_maxnum_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.maxnum.nxv4f32( [[IN0:%.*]], [[IN1:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.maxnum.nxv4f32( %in0, %in1) + ret %1 +} + +define @llvm_minnum_vscale_f64( %in0, %in1) { +; CHECK-LABEL: @llvm_minnum_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.minnum.nxv2f64( [[IN0:%.*]], [[IN1:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.minnum.nxv2f64( %in0, %in1) + ret %1 +} + +define @llvm_minnum_vscale_f32( %in0, %in1) { +; CHECK-LABEL: @llvm_minnum_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.minnum.nxv4f32( [[IN0:%.*]], [[IN1:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.minnum.nxv4f32( %in0, %in1) + ret %1 +} + +define @llvm_nearbyint_vscale_f64( %in) { +; CHECK-LABEL: @llvm_nearbyint_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.nearbyint.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.nearbyint.nxv2f64( %in) + ret %1 +} + +define @llvm_nearbyint_vscale_f32( %in) { +; CHECK-LABEL: @llvm_nearbyint_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.nearbyint.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.nearbyint.nxv4f32( %in) + ret %1 +} + +define @llvm_pow_vscale_f64( %in, %pow) { +; CHECK-LABEL: @llvm_pow_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.pow.nxv2f64( [[IN:%.*]], [[POW:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.pow.nxv2f64( %in, %pow) + ret %1 +} + +define @llvm_pow_vscale_f32( %in, %pow) { +; CHECK-LABEL: @llvm_pow_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.pow.nxv4f32( [[IN:%.*]], [[POW:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.pow.nxv4f32( %in, %pow) + ret %1 +} + +define @llvm_rint_vscale_f64( %in) { +; CHECK-LABEL: @llvm_rint_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.rint.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.rint.nxv2f64( %in) + ret %1 +} + +define @llvm_rint_vscale_f32( %in) { +; CHECK-LABEL: @llvm_rint_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.rint.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.rint.nxv4f32( %in) + ret %1 +} + +define @llvm_round_vscale_f64( %in) { +; CHECK-LABEL: @llvm_round_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.round.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.round.nxv2f64( %in) + ret %1 +} + +define @llvm_round_vscale_f32( %in) { +; CHECK-LABEL: @llvm_round_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.round.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.round.nxv4f32( %in) + ret %1 +} + +define @llvm_sin_vscale_f64( %in) { +; CHECK-LABEL: @llvm_sin_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.sin.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.sin.nxv2f64( %in) + ret %1 +} + +define @llvm_sin_vscale_f32( %in) { +; CHECK-LABEL: @llvm_sin_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.sin.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.sin.nxv4f32( %in) + ret %1 +} + +define @llvm_sqrt_vscale_f64( %in) { +; CHECK-LABEL: @llvm_sqrt_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.sqrt.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.sqrt.nxv2f64( %in) + ret %1 +} + +define @llvm_sqrt_vscale_f32( %in) { +; CHECK-LABEL: @llvm_sqrt_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.sqrt.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.sqrt.nxv4f32( %in) + ret %1 +} + +define @llvm_trunc_vscale_f64( %in) { +; CHECK-LABEL: @llvm_trunc_vscale_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.trunc.nxv2f64( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.trunc.nxv2f64( %in) + ret %1 +} + +define @llvm_trunc_vscale_f32( %in) { +; CHECK-LABEL: @llvm_trunc_vscale_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.trunc.nxv4f32( [[IN:%.*]]) +; CHECK-NEXT: ret [[TMP1]] +; + %1 = call fast @llvm.trunc.nxv4f32( %in) + ret %1 +} + +declare @llvm.ceil.nxv2f64() +declare @llvm.ceil.nxv4f32() +declare @llvm.copysign.nxv2f64(, ) +declare @llvm.copysign.nxv4f32(, ) +declare @llvm.cos.nxv2f64() +declare @llvm.cos.nxv4f32() +declare @llvm.exp.nxv2f64() +declare @llvm.exp.nxv4f32() +declare @llvm.exp2.nxv2f64() +declare @llvm.exp2.nxv4f32() +declare @llvm.fabs.nxv2f64() +declare @llvm.fabs.nxv4f32() +declare @llvm.floor.nxv2f64() +declare @llvm.floor.nxv4f32() +declare @llvm.fma.nxv2f64(, , ) +declare @llvm.fma.nxv4f32(, , ) +declare @llvm.log.nxv2f64() +declare @llvm.log.nxv4f32() +declare @llvm.log2.nxv2f64() +declare @llvm.log2.nxv4f32() +declare @llvm.log10.nxv2f64() +declare @llvm.log10.nxv4f32() +declare @llvm.maxnum.nxv2f64(, ) +declare @llvm.maxnum.nxv4f32(, ) +declare @llvm.minnum.nxv2f64(, ) +declare @llvm.minnum.nxv4f32(, ) +declare @llvm.nearbyint.nxv2f64() +declare @llvm.nearbyint.nxv4f32() +declare @llvm.pow.nxv2f64(, ) +declare @llvm.pow.nxv4f32(, ) +declare @llvm.rint.nxv2f64() +declare @llvm.rint.nxv4f32() +declare @llvm.round.nxv2f64() +declare @llvm.round.nxv4f32() +declare @llvm.sin.nxv2f64() +declare @llvm.sin.nxv4f32() +declare @llvm.sqrt.nxv2f64() +declare @llvm.sqrt.nxv4f32() +declare @llvm.trunc.nxv2f64() +declare @llvm.trunc.nxv4f32() diff --git a/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sleef.ll b/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sleef.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sleef.ll @@ -0,0 +1,405 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt -vector-library=sleefgnuabi -replace-with-veclib -S < %s | FileCheck %s + +target triple = "aarch64-unknown-linux-gnu" + +define <2 x double> @llvm_ceil_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_ceil_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.ceil.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.ceil.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_ceil_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_ceil_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.ceil.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.ceil.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_copysign_f64(<2 x double> %mag, <2 x double> %sgn) { +; CHECK-LABEL: @llvm_copysign_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.copysign.v2f64(<2 x double> [[MAG:%.*]], <2 x double> [[SGN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.copysign.v2f64(<2 x double> %mag, <2 x double> %sgn) + ret <2 x double> %1 +} + +define <4 x float> @llvm_copysign_f32(<4 x float> %mag, <4 x float> %sgn) { +; CHECK-LABEL: @llvm_copysign_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.copysign.v4f32(<4 x float> [[MAG:%.*]], <4 x float> [[SGN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.copysign.v4f32(<4 x float> %mag, <4 x float> %sgn) + ret <4 x float> %1 +} + +define <2 x double> @llvm_cos_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_cos_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_cos(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.cos.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_cos_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_cos_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_cosf(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.cos.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_exp_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_exp_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_exp(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.exp.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_exp_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_exp_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_expf(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.exp.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_exp2_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_exp2_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_exp2(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.exp2.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_exp2_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_exp2_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_exp2f(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.exp2.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_fabs_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_fabs_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.fabs.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.fabs.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_fabs_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_fabs_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.fabs.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.fabs.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_floor_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_floor_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.floor.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.floor.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_floor_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_floor_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.floor.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.floor.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_fma_f64(<2 x double> %a, <2 x double> %b, <2 x double> %c ) { +; CHECK-LABEL: @llvm_fma_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.fma.v2f64(<2 x double> [[A:%.*]], <2 x double> [[B:%.*]], <2 x double> [[C:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.fma.v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c) + ret <2 x double> %1 +} + +define <4 x float> @llvm_fma_f32(<4 x float> %a, <4 x float> %b, <4 x float> %c) { +; CHECK-LABEL: @llvm_fma_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.fma.v4f32(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c) + ret <4 x float> %1 +} + +define <2 x double> @llvm_log_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_log_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_log(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.log.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_log_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_log_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_logf(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.log.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_log2_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_log2_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_log2(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.log2.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_log2_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_log2_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_log2f(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.log2.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_log10_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_log10_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_log10(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.log10.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_log10_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_log10_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_log10f(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.log10.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_maxnum_f64(<2 x double> %in0, <2 x double> %in1) { +; CHECK-LABEL: @llvm_maxnum_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.maxnum.v2f64(<2 x double> [[IN0:%.*]], <2 x double> [[IN1:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.maxnum.v2f64(<2 x double> %in0, <2 x double> %in1) + ret <2 x double> %1 +} + +define <4 x float> @llvm_maxnum_f32(<4 x float> %in0, <4 x float> %in1) { +; CHECK-LABEL: @llvm_maxnum_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> [[IN0:%.*]], <4 x float> [[IN1:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> %in0, <4 x float> %in1) + ret <4 x float> %1 +} + +define <2 x double> @llvm_minnum_f64(<2 x double> %in0, <2 x double> %in1) { +; CHECK-LABEL: @llvm_minnum_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.minnum.v2f64(<2 x double> [[IN0:%.*]], <2 x double> [[IN1:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.minnum.v2f64(<2 x double> %in0, <2 x double> %in1) + ret <2 x double> %1 +} + +define <4 x float> @llvm_minnum_f32(<4 x float> %in0, <4 x float> %in1) { +; CHECK-LABEL: @llvm_minnum_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.minnum.v4f32(<4 x float> [[IN0:%.*]], <4 x float> [[IN1:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.minnum.v4f32(<4 x float> %in0, <4 x float> %in1) + ret <4 x float> %1 +} + +define <2 x double> @llvm_nearbyint_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_nearbyint_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.nearbyint.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.nearbyint.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_nearbyint_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_nearbyint_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.nearbyint.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.nearbyint.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_pow_f64(<2 x double> %in, <2 x double> %pow) { +; CHECK-LABEL: @llvm_pow_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.pow.v2f64(<2 x double> [[IN:%.*]], <2 x double> [[POW:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %in, <2 x double> %pow) + ret <2 x double> %1 +} + +define <4 x float> @llvm_pow_f32(<4 x float> %in, <4 x float> %pow) { +; CHECK-LABEL: @llvm_pow_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.pow.v4f32(<4 x float> [[IN:%.*]], <4 x float> [[POW:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %in, <4 x float> %pow) + ret <4 x float> %1 +} + +define <2 x double> @llvm_rint_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_rint_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.rint.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.rint.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_rint_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_rint_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.rint.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.rint.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_round_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_round_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.round.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.round.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_round_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_round_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.round.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.round.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_sin_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_sin_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_sin(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.sin.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_sin_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_sin_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_sinf(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.sin.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_sqrt_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_sqrt_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_sqrt_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_sqrt_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +define <2 x double> @llvm_trunc_f64(<2 x double> %in) { +; CHECK-LABEL: @llvm_trunc_f64( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.trunc.v2f64(<2 x double> [[IN:%.*]]) +; CHECK-NEXT: ret <2 x double> [[TMP1]] +; + %1 = call fast <2 x double> @llvm.trunc.v2f64(<2 x double> %in) + ret <2 x double> %1 +} + +define <4 x float> @llvm_trunc_f32(<4 x float> %in) { +; CHECK-LABEL: @llvm_trunc_f32( +; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.trunc.v4f32(<4 x float> [[IN:%.*]]) +; CHECK-NEXT: ret <4 x float> [[TMP1]] +; + %1 = call fast <4 x float> @llvm.trunc.v4f32(<4 x float> %in) + ret <4 x float> %1 +} + +declare <2 x double> @llvm.ceil.v2f64(<2 x double>) +declare <4 x float> @llvm.ceil.v4f32(<4 x float>) +declare <2 x double> @llvm.copysign.v2f64(<2 x double>, <2 x double>) +declare <4 x float> @llvm.copysign.v4f32(<4 x float>, <4 x float>) +declare <2 x double> @llvm.cos.v2f64(<2 x double>) +declare <4 x float> @llvm.cos.v4f32(<4 x float>) +declare <2 x double> @llvm.exp.v2f64(<2 x double>) +declare <4 x float> @llvm.exp.v4f32(<4 x float>) +declare <2 x double> @llvm.exp2.v2f64(<2 x double>) +declare <4 x float> @llvm.exp2.v4f32(<4 x float>) +declare <2 x double> @llvm.fabs.v2f64(<2 x double>) +declare <4 x float> @llvm.fabs.v4f32(<4 x float>) +declare <2 x double> @llvm.floor.v2f64(<2 x double>) +declare <4 x float> @llvm.floor.v4f32(<4 x float>) +declare <2 x double> @llvm.fma.v2f64(<2 x double>, <2 x double>, <2 x double>) +declare <4 x float> @llvm.fma.v4f32(<4 x float>, <4 x float>, <4 x float>) +declare <2 x double> @llvm.log.v2f64(<2 x double>) +declare <4 x float> @llvm.log.v4f32(<4 x float>) +declare <2 x double> @llvm.log2.v2f64(<2 x double>) +declare <4 x float> @llvm.log2.v4f32(<4 x float>) +declare <2 x double> @llvm.log10.v2f64(<2 x double>) +declare <4 x float> @llvm.log10.v4f32(<4 x float>) +declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>) +declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>) +declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>) +declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>) +declare <2 x double> @llvm.nearbyint.v2f64(<2 x double>) +declare <4 x float> @llvm.nearbyint.v4f32(<4 x float>) +declare <2 x double> @llvm.pow.v2f64(<2 x double>, <2 x double>) +declare <4 x float> @llvm.pow.v4f32(<4 x float>, <4 x float>) +declare <2 x double> @llvm.rint.v2f64(<2 x double>) +declare <4 x float> @llvm.rint.v4f32(<4 x float>) +declare <2 x double> @llvm.round.v2f64(<2 x double>) +declare <4 x float> @llvm.round.v4f32(<4 x float>) +declare <2 x double> @llvm.sin.v2f64(<2 x double>) +declare <4 x float> @llvm.sin.v4f32(<4 x float>) +declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) +declare <4 x float> @llvm.sqrt.v4f32(<4 x float>) +declare <2 x double> @llvm.trunc.v2f64(<2 x double>) +declare <4 x float> @llvm.trunc.v4f32(<4 x float>) diff --git a/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sqrt.ll b/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sqrt.ll deleted file mode 100644 --- a/llvm/test/CodeGen/AArch64/replace-intrinsics-with-veclib-sqrt.ll +++ /dev/null @@ -1,50 +0,0 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -vector-library=sleefgnuabi -replace-with-veclib -S < %s | FileCheck %s - -target triple = "aarch64-unknown-linux-gnu" - -define <2 x double> @llvm_sqrt_f64(<2 x double> %in) { -; CHECK-LABEL: define {{[^@]+}}@llvm_sqrt_f64 -; CHECK-SAME: (<2 x double> [[IN:%.*]]) { -; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> [[IN]]) -; CHECK-NEXT: ret <2 x double> [[TMP1]] -; - %1 = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> %in) - ret <2 x double> %1 -} - -define <4 x float> @llvm_sqrt_f32(<4 x float> %in) { -; CHECK-LABEL: define {{[^@]+}}@llvm_sqrt_f32 -; CHECK-SAME: (<4 x float> [[IN:%.*]]) { -; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> [[IN]]) -; CHECK-NEXT: ret <4 x float> [[TMP1]] -; - %1 = call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> %in) - ret <4 x float> %1 -} - -define @llvm_sqrt_vscale_f64( %in) { -; CHECK-LABEL: define {{[^@]+}}@llvm_sqrt_vscale_f64 -; CHECK-SAME: ( [[IN:%.*]]) { -; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.sqrt.nxv2f64( [[IN]]) -; CHECK-NEXT: ret [[TMP1]] -; - %1 = call fast @llvm.sqrt.nxv2f64( %in) - ret %1 -} - -define @llvm_sqrt_vscale_f32( %in) { -; CHECK-LABEL: define {{[^@]+}}@llvm_sqrt_vscale_f32 -; CHECK-SAME: ( [[IN:%.*]]) { -; CHECK-NEXT: [[TMP1:%.*]] = call fast @llvm.sqrt.nxv4f32( [[IN]]) -; CHECK-NEXT: ret [[TMP1]] -; - %1 = call fast @llvm.sqrt.nxv4f32( %in) - ret %1 -} - - -declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) -declare <4 x float> @llvm.sqrt.v4f32(<4 x float>) -declare @llvm.sqrt.nxv2f64() -declare @llvm.sqrt.nxv4f32()