@@ -739,3 +739,146 @@ uint64x2_t test_vpaddlq_u32(uint32x4_t a) {
739
739
// LLVM: [[VPADDL1_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.uaddlp.v2i64.v4i32(<4 x i32> [[A]])
740
740
// LLVM: ret <2 x i64> [[VPADDL1_I]]
741
741
}
742
+
743
+ int8x8_t test_vabs_s8 (int8x8_t a ) {
744
+ return vabs_s8 (a );
745
+
746
+ // CIR-LABEL: vabs_s8
747
+ // CIR: cir.abs {{%.*}} : !cir.vector<!s8i x 8>
748
+
749
+ // LLVM: {{.*}}test_vabs_s8(<8 x i8>{{.*}}[[a:%.*]])
750
+ // LLVM: [[VABS_I:%.*]] = call <8 x i8> @llvm.abs.v8i8(<8 x i8> [[a]], i1 false)
751
+ // LLVM: ret <8 x i8> [[VABS_I]]
752
+ }
753
+
754
+ int8x16_t test_vabsq_s8 (int8x16_t a ) {
755
+ return vabsq_s8 (a );
756
+
757
+ // CIR-LABEL: vabsq_s8
758
+ // CIR: cir.abs {{%.*}} : !cir.vector<!s8i x 16>
759
+
760
+ // LLVM: {{.*}}test_vabsq_s8(<16 x i8>{{.*}}[[a:%.*]])
761
+ // LLVM: [[VABS_I:%.*]] = call <16 x i8> @llvm.abs.v16i8(<16 x i8> [[a]], i1 false)
762
+ // LLVM: ret <16 x i8> [[VABS_I]]
763
+ }
764
+
765
+ int16x4_t test_vabs_s16 (int16x4_t a ) {
766
+ return vabs_s16 (a );
767
+
768
+ // CIR-LABEL: vabs_s16
769
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 8>), !cir.vector<!s16i x 4>
770
+ // CIR: cir.abs [[TMP0]] : !cir.vector<!s16i x 4>
771
+
772
+ // LLVM: {{.*}}test_vabs_s16(<4 x i16>{{.*}}[[a:%.*]])
773
+ // LLVM: [[VABS1_I:%.*]] = call <4 x i16> @llvm.abs.v4i16(<4 x i16> [[a]], i1 false)
774
+ // LLVM: ret <4 x i16> [[VABS1_I]]
775
+ }
776
+
777
+ int16x8_t test_vabsq_s16 (int16x8_t a ) {
778
+ return vabsq_s16 (a );
779
+
780
+ // CIR-LABEL: vabsq_s16
781
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 16>), !cir.vector<!s16i x 8>
782
+ // CIR: cir.abs [[TMP0]] : !cir.vector<!s16i x 8>
783
+
784
+ // LLVM: {{.*}}test_vabsq_s16(<8 x i16>{{.*}}[[a:%.*]])
785
+ // LLVM: [[VABS1_I:%.*]] = call <8 x i16> @llvm.abs.v8i16(<8 x i16> [[a]], i1 false)
786
+ // LLVM: ret <8 x i16> [[VABS1_I]]
787
+ }
788
+
789
+ int32x2_t test_vabs_s32 (int32x2_t a ) {
790
+ return vabs_s32 (a );
791
+
792
+ // CIR-LABEL: vabs_s32
793
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 8>), !cir.vector<!s32i x 2>
794
+ // CIR: cir.abs [[TMP0]] : !cir.vector<!s32i x 2>
795
+
796
+ // LLVM: {{.*}}test_vabs_s32(<2 x i32>{{.*}}[[a:%.*]])
797
+ // LLVM: [[VABS1_I:%.*]] = call <2 x i32> @llvm.abs.v2i32(<2 x i32> [[a]], i1 false)
798
+ // LLVM: ret <2 x i32> [[VABS1_I]]
799
+ }
800
+
801
+ int32x4_t test_vabsq_s32 (int32x4_t a ) {
802
+ return vabsq_s32 (a );
803
+
804
+ // CIR-LABEL: vabsq_s32
805
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 16>), !cir.vector<!s32i x 4>
806
+ // CIR: cir.abs [[TMP0]] : !cir.vector<!s32i x 4>
807
+
808
+ // LLVM: {{.*}}test_vabsq_s32(<4 x i32>{{.*}}[[a:%.*]])
809
+ // LLVM: [[VABS1_I:%.*]] = call <4 x i32> @llvm.abs.v4i32(<4 x i32> [[a]], i1 false)
810
+ // LLVM: ret <4 x i32> [[VABS1_I]]
811
+ }
812
+
813
+ int64x1_t test_vabs_s64 (int64x1_t a ) {
814
+ return vabs_s64 (a );
815
+
816
+ // CIR-LABEL: vabs_s64
817
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 8>), !cir.vector<!s64i x 1>
818
+ // CIR: cir.abs [[TMP0]] : !cir.vector<!s64i x 1>
819
+
820
+ // LLVM: {{.*}}test_vabs_s64(<1 x i64>{{.*}}[[a:%.*]])
821
+ // LLVM: [[VABS1_I:%.*]] = call <1 x i64> @llvm.abs.v1i64(<1 x i64> [[a]], i1 false)
822
+ // LLVM: ret <1 x i64> [[VABS1_I]]
823
+ }
824
+
825
+ int64x2_t test_vabsq_s64 (int64x2_t a ) {
826
+ return vabsq_s64 (a );
827
+
828
+ // CIR-LABEL: vabsq_s64
829
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 16>), !cir.vector<!s64i x 2>
830
+ // CIR: cir.abs [[TMP0]] : !cir.vector<!s64i x 2>
831
+
832
+ // LLVM: {{.*}}test_vabsq_s64(<2 x i64>{{.*}}[[a:%.*]])
833
+ // LLVM: [[VABS1_I:%.*]] = call <2 x i64> @llvm.abs.v2i64(<2 x i64> [[a]], i1 false)
834
+ // LLVM: ret <2 x i64> [[VABS1_I]]
835
+ }
836
+
837
+
838
+ float32x2_t test_vabs_f32 (float32x2_t a ) {
839
+ return vabs_f32 (a );
840
+
841
+ // CIR-LABEL: vabs_f32
842
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 8>), !cir.vector<!cir.float x 2>
843
+ // CIR: cir.fabs [[TMP0]] : !cir.vector<!cir.float x 2>
844
+
845
+ // LLVM: {{.*}}test_vabs_f32(<2 x float>{{.*}}[[a:%.*]])
846
+ // LLVM: [[VABS_F:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[a]])
847
+ // LLVM: ret <2 x float> [[VABS_F]]
848
+ }
849
+
850
+ float32x4_t test_vabsq_f32 (float32x4_t a ) {
851
+ return vabsq_f32 (a );
852
+
853
+ // CIR-LABEL: vabsq_f32
854
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 16>), !cir.vector<!cir.float x 4>
855
+ // CIR: cir.fabs [[TMP0]] : !cir.vector<!cir.float x 4>
856
+
857
+ // LLVM: {{.*}}test_vabsq_f32(<4 x float>{{.*}}[[a:%.*]])
858
+ // LLVM: [[VABS_F:%.*]] = call <4 x float> @llvm.fabs.v4f32(<4 x float> [[a]])
859
+ // LLVM: ret <4 x float> [[VABS_F]]
860
+ }
861
+
862
+ float64x1_t test_vabs_f64 (float64x1_t a ) {
863
+ return vabs_f64 (a );
864
+
865
+ // CIR-LABEL: vabs_f64
866
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 8>), !cir.vector<!cir.double x 1>
867
+ // CIR: cir.fabs [[TMP0]] : !cir.vector<!cir.double x 1>
868
+
869
+ // LLVM: {{.*}}test_vabs_f64(<1 x double>{{.*}}[[a:%.*]])
870
+ // LLVM: [[VABS_F:%.*]] = call <1 x double> @llvm.fabs.v1f64(<1 x double> [[a]])
871
+ // LLVM: ret <1 x double> [[VABS_F]]
872
+ }
873
+
874
+ float64x2_t test_vabsq_f64 (float64x2_t a ) {
875
+ return vabsq_f64 (a );
876
+
877
+ // CIR-LABEL: vabsq_f64
878
+ // CIR: [[TMP0:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.vector<!s8i x 16>), !cir.vector<!cir.double x 2>
879
+ // CIR: cir.fabs [[TMP0]] : !cir.vector<!cir.double x 2>
880
+
881
+ // LLVM: {{.*}}test_vabsq_f64(<2 x double>{{.*}}[[a:%.*]])
882
+ // LLVM: [[VABS_F:%.*]] = call <2 x double> @llvm.fabs.v2f64(<2 x double> [[a]])
883
+ // LLVM: ret <2 x double> [[VABS_F]]
884
+ }
0 commit comments