|
1 |
| -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "call.*(cos|sin|tan|cbrt|erf|exp|gamma|log|sqrt|copysign|dim|min|mod|hypot|nextafter|pow|fma)" --version 2 |
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "call.*(cos|sin|tan|cbrt|erf|exp[^e]|gamma|log|sqrt|copysign|dim|min|mod|hypot|nextafter|pow|fma)" --version 2 |
2 | 2 | ; RUN: opt -mattr=+neon -vector-library=sleefgnuabi -passes=inject-tli-mappings,loop-vectorize,simplifycfg -force-vector-interleave=1 -S < %s | FileCheck %s --check-prefix=SLEEF-NEON
|
3 | 3 | ; RUN: opt -mattr=+sve -vector-library=sleefgnuabi -passes=inject-tli-mappings,loop-vectorize,simplifycfg -force-vector-interleave=1 -prefer-predicate-over-epilogue=predicate-dont-vectorize -S < %s | FileCheck %s --check-prefix=SLEEF-SVE
|
4 | 4 | ; RUN: opt -mattr=+neon -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize,simplifycfg -force-vector-interleave=1 -S < %s | FileCheck %s --check-prefix=ARMPL-NEON
|
@@ -2639,3 +2639,223 @@ define void @fma_f32(ptr noalias %in.ptr, ptr noalias %out.ptr) {
|
2639 | 2639 | ret void
|
2640 | 2640 | }
|
2641 | 2641 |
|
| 2642 | +declare double @modf(double, ptr) |
| 2643 | +declare float @modff(float, ptr) |
| 2644 | + |
| 2645 | +define void @test_modf(ptr noalias %a, ptr noalias %b, ptr noalias %c) { |
| 2646 | +; SLEEF-NEON-LABEL: define void @test_modf |
| 2647 | +; SLEEF-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2648 | +; SLEEF-NEON: [[TMP5:%.*]] = call <2 x double> @_ZGVnN2vl8_modf(<2 x double> [[WIDE_LOAD:%.*]], ptr [[TMP4:%.*]]) |
| 2649 | +; |
| 2650 | +; SLEEF-SVE-LABEL: define void @test_modf |
| 2651 | +; SLEEF-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2652 | +; SLEEF-SVE: [[TMP23:%.*]] = call <vscale x 2 x double> @_ZGVsMxvl8_modf(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP22:%.*]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2653 | +; |
| 2654 | +; ARMPL-NEON-LABEL: define void @test_modf |
| 2655 | +; ARMPL-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2656 | +; ARMPL-NEON: [[TMP5:%.*]] = call <2 x double> @armpl_vmodfq_f64(<2 x double> [[WIDE_LOAD:%.*]], ptr [[TMP4:%.*]]) |
| 2657 | +; |
| 2658 | +; ARMPL-SVE-LABEL: define void @test_modf |
| 2659 | +; ARMPL-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2660 | +; ARMPL-SVE: [[TMP23:%.*]] = call <vscale x 2 x double> @armpl_svmodf_f64_x(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP22:%.*]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2661 | +; |
| 2662 | +entry: |
| 2663 | + br label %for.body |
| 2664 | + |
| 2665 | +for.body: |
| 2666 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| 2667 | + %gepa = getelementptr double, ptr %a, i64 %indvars.iv |
| 2668 | + %num = load double, ptr %gepa, align 8 |
| 2669 | + %gepb = getelementptr double, ptr %b, i64 %indvars.iv |
| 2670 | + %data = call double @modf(double %num, ptr %gepb) |
| 2671 | + %gepc = getelementptr inbounds double, ptr %c, i64 %indvars.iv |
| 2672 | + store double %data, ptr %gepc, align 8 |
| 2673 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 2674 | + %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| 2675 | + br i1 %exitcond, label %for.cond.cleanup, label %for.body |
| 2676 | + |
| 2677 | +for.cond.cleanup: |
| 2678 | + ret void |
| 2679 | +} |
| 2680 | + |
| 2681 | +define void @test_modff(ptr noalias %a, ptr noalias %b, ptr noalias %c) { |
| 2682 | +; SLEEF-NEON-LABEL: define void @test_modff |
| 2683 | +; SLEEF-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2684 | +; SLEEF-NEON: [[TMP5:%.*]] = call <4 x float> @_ZGVnN4vl4_modff(<4 x float> [[WIDE_LOAD:%.*]], ptr [[TMP4:%.*]]) |
| 2685 | +; |
| 2686 | +; SLEEF-SVE-LABEL: define void @test_modff |
| 2687 | +; SLEEF-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2688 | +; SLEEF-SVE: [[TMP23:%.*]] = call <vscale x 4 x float> @_ZGVsMxvl4_modff(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP22:%.*]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2689 | +; |
| 2690 | +; ARMPL-NEON-LABEL: define void @test_modff |
| 2691 | +; ARMPL-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2692 | +; ARMPL-NEON: [[TMP5:%.*]] = call <4 x float> @armpl_vmodfq_f32(<4 x float> [[WIDE_LOAD:%.*]], ptr [[TMP4:%.*]]) |
| 2693 | +; |
| 2694 | +; ARMPL-SVE-LABEL: define void @test_modff |
| 2695 | +; ARMPL-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2696 | +; ARMPL-SVE: [[TMP23:%.*]] = call <vscale x 4 x float> @armpl_svmodf_f32_x(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP22:%.*]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2697 | +; |
| 2698 | +entry: |
| 2699 | + br label %for.body |
| 2700 | + |
| 2701 | +for.body: |
| 2702 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| 2703 | + %gepa = getelementptr float, ptr %a, i64 %indvars.iv |
| 2704 | + %num = load float, ptr %gepa, align 8 |
| 2705 | + %gepb = getelementptr float, ptr %b, i64 %indvars.iv |
| 2706 | + %data = call float @modff(float %num, ptr %gepb) |
| 2707 | + %gepc = getelementptr inbounds float, ptr %c, i64 %indvars.iv |
| 2708 | + store float %data, ptr %gepc, align 8 |
| 2709 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 2710 | + %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| 2711 | + br i1 %exitcond, label %for.cond.cleanup, label %for.body |
| 2712 | + |
| 2713 | +for.cond.cleanup: |
| 2714 | + ret void |
| 2715 | +} |
| 2716 | + |
| 2717 | +declare void @sincos(double, ptr, ptr) |
| 2718 | +declare void @sincosf(float, ptr, ptr) |
| 2719 | + |
| 2720 | +define void @test_sincos(ptr noalias %a, ptr noalias %b, ptr noalias %c) { |
| 2721 | +; SLEEF-NEON-LABEL: define void @test_sincos |
| 2722 | +; SLEEF-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2723 | +; SLEEF-NEON: call void @_ZGVnN2vl8l8_sincos(<2 x double> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2724 | +; |
| 2725 | +; SLEEF-SVE-LABEL: define void @test_sincos |
| 2726 | +; SLEEF-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2727 | +; SLEEF-SVE: call void @_ZGVsMxvl8l8_sincos(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2728 | +; |
| 2729 | +; ARMPL-NEON-LABEL: define void @test_sincos |
| 2730 | +; ARMPL-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2731 | +; ARMPL-NEON: call void @armpl_vsincosq_f64(<2 x double> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2732 | +; |
| 2733 | +; ARMPL-SVE-LABEL: define void @test_sincos |
| 2734 | +; ARMPL-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2735 | +; ARMPL-SVE: call void @armpl_svsincos_f64_x(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2736 | +; |
| 2737 | +entry: |
| 2738 | + br label %for.body |
| 2739 | + |
| 2740 | +for.body: |
| 2741 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| 2742 | + %gepa = getelementptr double, ptr %a, i64 %indvars.iv |
| 2743 | + %num = load double, ptr %gepa, align 8 |
| 2744 | + %gepb = getelementptr double, ptr %b, i64 %indvars.iv |
| 2745 | + %gepc = getelementptr double, ptr %c, i64 %indvars.iv |
| 2746 | + call void @sincos(double %num, ptr %gepb, ptr %gepc) |
| 2747 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 2748 | + %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| 2749 | + br i1 %exitcond, label %for.cond.cleanup, label %for.body |
| 2750 | + |
| 2751 | +for.cond.cleanup: |
| 2752 | + ret void |
| 2753 | +} |
| 2754 | + |
| 2755 | +define void @test_sincosf(ptr noalias %a, ptr noalias %b, ptr noalias %c) { |
| 2756 | +; SLEEF-NEON-LABEL: define void @test_sincosf |
| 2757 | +; SLEEF-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2758 | +; SLEEF-NEON: call void @_ZGVnN4vl4l4_sincosf(<4 x float> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2759 | +; |
| 2760 | +; SLEEF-SVE-LABEL: define void @test_sincosf |
| 2761 | +; SLEEF-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2762 | +; SLEEF-SVE: call void @_ZGVsMxvl4l4_sincosf(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2763 | +; |
| 2764 | +; ARMPL-NEON-LABEL: define void @test_sincosf |
| 2765 | +; ARMPL-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2766 | +; ARMPL-NEON: call void @armpl_vsincosq_f32(<4 x float> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2767 | +; |
| 2768 | +; ARMPL-SVE-LABEL: define void @test_sincosf |
| 2769 | +; ARMPL-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2770 | +; ARMPL-SVE: call void @armpl_svsincos_f32_x(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2771 | +; |
| 2772 | +entry: |
| 2773 | + br label %for.body |
| 2774 | + |
| 2775 | +for.body: |
| 2776 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| 2777 | + %gepa = getelementptr float, ptr %a, i64 %indvars.iv |
| 2778 | + %num = load float, ptr %gepa, align 8 |
| 2779 | + %gepb = getelementptr float, ptr %b, i64 %indvars.iv |
| 2780 | + %gepc = getelementptr float, ptr %c, i64 %indvars.iv |
| 2781 | + call void @sincosf(float %num, ptr %gepb, ptr %gepc) |
| 2782 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 2783 | + %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| 2784 | + br i1 %exitcond, label %for.cond.cleanup, label %for.body |
| 2785 | + |
| 2786 | +for.cond.cleanup: |
| 2787 | + ret void |
| 2788 | +} |
| 2789 | + |
| 2790 | +declare void @sincospi(double, ptr, ptr) |
| 2791 | +declare void @sincospif(float, ptr, ptr) |
| 2792 | + |
| 2793 | +define void @test_sincospi(ptr noalias %a, ptr noalias %b, ptr noalias %c) { |
| 2794 | +; SLEEF-NEON-LABEL: define void @test_sincospi |
| 2795 | +; SLEEF-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2796 | +; SLEEF-NEON: call void @_ZGVnN2vl8l8_sincospi(<2 x double> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2797 | +; |
| 2798 | +; SLEEF-SVE-LABEL: define void @test_sincospi |
| 2799 | +; SLEEF-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2800 | +; SLEEF-SVE: call void @_ZGVsMxvl8l8_sincospi(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2801 | +; |
| 2802 | +; ARMPL-NEON-LABEL: define void @test_sincospi |
| 2803 | +; ARMPL-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2804 | +; ARMPL-NEON: call void @armpl_vsincospiq_f64(<2 x double> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2805 | +; |
| 2806 | +; ARMPL-SVE-LABEL: define void @test_sincospi |
| 2807 | +; ARMPL-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2808 | +; ARMPL-SVE: call void @armpl_svsincospi_f64_x(<vscale x 2 x double> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 2 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2809 | +; |
| 2810 | +entry: |
| 2811 | + br label %for.body |
| 2812 | + |
| 2813 | +for.body: |
| 2814 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| 2815 | + %gepa = getelementptr double, ptr %a, i64 %indvars.iv |
| 2816 | + %num = load double, ptr %gepa, align 8 |
| 2817 | + %gepb = getelementptr double, ptr %b, i64 %indvars.iv |
| 2818 | + %gepc = getelementptr double, ptr %c, i64 %indvars.iv |
| 2819 | + call void @sincospi(double %num, ptr %gepb, ptr %gepc) |
| 2820 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 2821 | + %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| 2822 | + br i1 %exitcond, label %for.cond.cleanup, label %for.body |
| 2823 | + |
| 2824 | +for.cond.cleanup: |
| 2825 | + ret void |
| 2826 | +} |
| 2827 | + |
| 2828 | +define void @test_sincospif(ptr noalias %a, ptr noalias %b, ptr noalias %c) { |
| 2829 | +; SLEEF-NEON-LABEL: define void @test_sincospif |
| 2830 | +; SLEEF-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2831 | +; SLEEF-NEON: call void @_ZGVnN4vl4l4_sincospif(<4 x float> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2832 | +; |
| 2833 | +; SLEEF-SVE-LABEL: define void @test_sincospif |
| 2834 | +; SLEEF-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2835 | +; SLEEF-SVE: call void @_ZGVsMxvl4l4_sincospif(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2836 | +; |
| 2837 | +; ARMPL-NEON-LABEL: define void @test_sincospif |
| 2838 | +; ARMPL-NEON-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2839 | +; ARMPL-NEON: call void @armpl_vsincospiq_f32(<4 x float> [[WIDE_LOAD:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]]) |
| 2840 | +; |
| 2841 | +; ARMPL-SVE-LABEL: define void @test_sincospif |
| 2842 | +; ARMPL-SVE-SAME: (ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]]) #[[ATTR0]] { |
| 2843 | +; ARMPL-SVE: call void @armpl_svsincospi_f32_x(<vscale x 4 x float> [[WIDE_MASKED_LOAD:%.*]], ptr [[TMP23:%.*]], ptr [[TMP24:%.*]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK:%.*]]) |
| 2844 | +; |
| 2845 | +entry: |
| 2846 | + br label %for.body |
| 2847 | + |
| 2848 | +for.body: |
| 2849 | + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| 2850 | + %gepa = getelementptr float, ptr %a, i64 %indvars.iv |
| 2851 | + %num = load float, ptr %gepa, align 8 |
| 2852 | + %gepb = getelementptr float, ptr %b, i64 %indvars.iv |
| 2853 | + %gepc = getelementptr float, ptr %c, i64 %indvars.iv |
| 2854 | + call void @sincospif(float %num, ptr %gepb, ptr %gepc) |
| 2855 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 2856 | + %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| 2857 | + br i1 %exitcond, label %for.cond.cleanup, label %for.body |
| 2858 | + |
| 2859 | +for.cond.cleanup: |
| 2860 | + ret void |
| 2861 | +} |
0 commit comments