1*207e5cccSFangrui Song // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 2*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +faminmax -O3 -emit-llvm -o - %s | FileCheck %s 3*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +faminmax -S -O3 -Werror -Wall -o /dev/null %s 4*207e5cccSFangrui Song 5*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target 6*207e5cccSFangrui Song 7*207e5cccSFangrui Song #include <arm_neon.h> 8*207e5cccSFangrui Song 9*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <4 x half> @test_vamin_f16( 10*207e5cccSFangrui Song // CHECK-SAME: <4 x half> noundef [[VN:%.*]], <4 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { 11*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 12*207e5cccSFangrui Song // CHECK-NEXT: [[FAMIN2_I:%.*]] = tail call <4 x half> @llvm.aarch64.neon.famin.v4f16(<4 x half> [[VN]], <4 x half> [[VM]]) 13*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x half> [[FAMIN2_I]] 14*207e5cccSFangrui Song // 15*207e5cccSFangrui Song float16x4_t test_vamin_f16(float16x4_t vn, float16x4_t vm) { 16*207e5cccSFangrui Song return vamin_f16(vn, vm); 17*207e5cccSFangrui Song } 18*207e5cccSFangrui Song 19*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <8 x half> @test_vaminq_f16( 20*207e5cccSFangrui Song // CHECK-SAME: <8 x half> noundef [[VN:%.*]], <8 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 21*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 22*207e5cccSFangrui Song // CHECK-NEXT: [[FAMIN2_I:%.*]] = tail call <8 x half> @llvm.aarch64.neon.famin.v8f16(<8 x half> [[VN]], <8 x half> [[VM]]) 23*207e5cccSFangrui Song // CHECK-NEXT: ret <8 x half> [[FAMIN2_I]] 24*207e5cccSFangrui Song // 25*207e5cccSFangrui Song float16x8_t test_vaminq_f16(float16x8_t vn, float16x8_t vm) { 26*207e5cccSFangrui Song return vaminq_f16(vn, vm); 27*207e5cccSFangrui Song } 28*207e5cccSFangrui Song 29*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <2 x float> @test_vamin_f32( 30*207e5cccSFangrui Song // CHECK-SAME: <2 x float> noundef [[VN:%.*]], <2 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 31*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 32*207e5cccSFangrui Song // CHECK-NEXT: [[FAMIN2_I:%.*]] = tail call <2 x float> @llvm.aarch64.neon.famin.v2f32(<2 x float> [[VN]], <2 x float> [[VM]]) 33*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[FAMIN2_I]] 34*207e5cccSFangrui Song // 35*207e5cccSFangrui Song float32x2_t test_vamin_f32(float32x2_t vn, float32x2_t vm) { 36*207e5cccSFangrui Song return vamin_f32(vn, vm); 37*207e5cccSFangrui Song } 38*207e5cccSFangrui Song 39*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <4 x float> @test_vaminq_f32( 40*207e5cccSFangrui Song // CHECK-SAME: <4 x float> noundef [[VN:%.*]], <4 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 41*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 42*207e5cccSFangrui Song // CHECK-NEXT: [[FAMIN2_I:%.*]] = tail call <4 x float> @llvm.aarch64.neon.famin.v4f32(<4 x float> [[VN]], <4 x float> [[VM]]) 43*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[FAMIN2_I]] 44*207e5cccSFangrui Song // 45*207e5cccSFangrui Song float32x4_t test_vaminq_f32(float32x4_t vn, float32x4_t vm) { 46*207e5cccSFangrui Song return vaminq_f32(vn, vm); 47*207e5cccSFangrui Song } 48*207e5cccSFangrui Song 49*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <2 x double> @test_vaminq_f64( 50*207e5cccSFangrui Song // CHECK-SAME: <2 x double> noundef [[VN:%.*]], <2 x double> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 51*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 52*207e5cccSFangrui Song // CHECK-NEXT: [[FAMIN2_I:%.*]] = tail call <2 x double> @llvm.aarch64.neon.famin.v2f64(<2 x double> [[VN]], <2 x double> [[VM]]) 53*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x double> [[FAMIN2_I]] 54*207e5cccSFangrui Song // 55*207e5cccSFangrui Song float64x2_t test_vaminq_f64(float64x2_t vn, float64x2_t vm) { 56*207e5cccSFangrui Song return vaminq_f64(vn, vm); 57*207e5cccSFangrui Song } 58*207e5cccSFangrui Song 59*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <4 x half> @test_vamax_f16( 60*207e5cccSFangrui Song // CHECK-SAME: <4 x half> noundef [[VN:%.*]], <4 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 61*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 62*207e5cccSFangrui Song // CHECK-NEXT: [[FAMAX2_I:%.*]] = tail call <4 x half> @llvm.aarch64.neon.famax.v4f16(<4 x half> [[VN]], <4 x half> [[VM]]) 63*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x half> [[FAMAX2_I]] 64*207e5cccSFangrui Song // 65*207e5cccSFangrui Song float16x4_t test_vamax_f16(float16x4_t vn, float16x4_t vm) { 66*207e5cccSFangrui Song return vamax_f16(vn, vm); 67*207e5cccSFangrui Song } 68*207e5cccSFangrui Song 69*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <8 x half> @test_vamaxq_f16( 70*207e5cccSFangrui Song // CHECK-SAME: <8 x half> noundef [[VN:%.*]], <8 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 71*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 72*207e5cccSFangrui Song // CHECK-NEXT: [[FAMAX2_I:%.*]] = tail call <8 x half> @llvm.aarch64.neon.famax.v8f16(<8 x half> [[VN]], <8 x half> [[VM]]) 73*207e5cccSFangrui Song // CHECK-NEXT: ret <8 x half> [[FAMAX2_I]] 74*207e5cccSFangrui Song // 75*207e5cccSFangrui Song float16x8_t test_vamaxq_f16(float16x8_t vn, float16x8_t vm) { 76*207e5cccSFangrui Song return vamaxq_f16(vn, vm); 77*207e5cccSFangrui Song } 78*207e5cccSFangrui Song 79*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <2 x float> @test_vamax_f32( 80*207e5cccSFangrui Song // CHECK-SAME: <2 x float> noundef [[VN:%.*]], <2 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 81*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 82*207e5cccSFangrui Song // CHECK-NEXT: [[FAMAX2_I:%.*]] = tail call <2 x float> @llvm.aarch64.neon.famax.v2f32(<2 x float> [[VN]], <2 x float> [[VM]]) 83*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[FAMAX2_I]] 84*207e5cccSFangrui Song // 85*207e5cccSFangrui Song float32x2_t test_vamax_f32(float32x2_t vn, float32x2_t vm) { 86*207e5cccSFangrui Song return vamax_f32(vn, vm); 87*207e5cccSFangrui Song } 88*207e5cccSFangrui Song 89*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <4 x float> @test_vamaxq_f32( 90*207e5cccSFangrui Song // CHECK-SAME: <4 x float> noundef [[VN:%.*]], <4 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 91*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 92*207e5cccSFangrui Song // CHECK-NEXT: [[FAMAX2_I:%.*]] = tail call <4 x float> @llvm.aarch64.neon.famax.v4f32(<4 x float> [[VN]], <4 x float> [[VM]]) 93*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[FAMAX2_I]] 94*207e5cccSFangrui Song // 95*207e5cccSFangrui Song float32x4_t test_vamaxq_f32(float32x4_t vn, float32x4_t vm) { 96*207e5cccSFangrui Song return vamaxq_f32(vn, vm); 97*207e5cccSFangrui Song } 98*207e5cccSFangrui Song 99*207e5cccSFangrui Song // CHECK-LABEL: define dso_local <2 x double> @test_vamaxq_f64( 100*207e5cccSFangrui Song // CHECK-SAME: <2 x double> noundef [[VN:%.*]], <2 x double> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] { 101*207e5cccSFangrui Song // CHECK-NEXT: [[ENTRY:.*:]] 102*207e5cccSFangrui Song // CHECK-NEXT: [[FAMAX2_I:%.*]] = tail call <2 x double> @llvm.aarch64.neon.famax.v2f64(<2 x double> [[VN]], <2 x double> [[VM]]) 103*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x double> [[FAMAX2_I]] 104*207e5cccSFangrui Song // 105*207e5cccSFangrui Song float64x2_t test_vamaxq_f64(float64x2_t vn, float64x2_t vm) { 106*207e5cccSFangrui Song return vamaxq_f64(vn, vm); 107*207e5cccSFangrui Song } 108