1*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \ 2*207e5cccSFangrui Song // RUN: -disable-O0-optnone \ 3*207e5cccSFangrui Song // RUN: -flax-vector-conversions=none -emit-llvm -o - %s | opt -S -passes=mem2reg \ 4*207e5cccSFangrui Song // RUN: | FileCheck --check-prefixes=COMMON,COMMONIR,UNCONSTRAINED %s 5*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \ 6*207e5cccSFangrui Song // RUN: -disable-O0-optnone \ 7*207e5cccSFangrui Song // RUN: -ffp-exception-behavior=strict \ 8*207e5cccSFangrui Song // RUN: -flax-vector-conversions=none -emit-llvm -o - %s | opt -S -passes=mem2reg \ 9*207e5cccSFangrui Song // RUN: | FileCheck --check-prefixes=COMMON,COMMONIR,CONSTRAINED %s 10*207e5cccSFangrui Song 11*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target 12*207e5cccSFangrui Song 13*207e5cccSFangrui Song // Test new aarch64 intrinsics and types but constrained 14*207e5cccSFangrui Song 15*207e5cccSFangrui Song #include <arm_neon.h> 16*207e5cccSFangrui Song 17*207e5cccSFangrui Song // COMMON-LABEL: test_vadd_f32 18*207e5cccSFangrui Song // UNCONSTRAINED: [[ADD_I:%.*]] = fadd <2 x float> %v1, %v2 19*207e5cccSFangrui Song // CONSTRAINED: [[ADD_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 20*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[ADD_I]] 21*207e5cccSFangrui Song float32x2_t test_vadd_f32(float32x2_t v1, float32x2_t v2) { 22*207e5cccSFangrui Song return vadd_f32(v1, v2); 23*207e5cccSFangrui Song } 24*207e5cccSFangrui Song 25*207e5cccSFangrui Song // COMMON-LABEL: test_vaddq_f32 26*207e5cccSFangrui Song // UNCONSTRAINED: [[ADD_I:%.*]] = fadd <4 x float> %v1, %v2 27*207e5cccSFangrui Song // CONSTRAINED: [[ADD_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fadd.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 28*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[ADD_I]] 29*207e5cccSFangrui Song float32x4_t test_vaddq_f32(float32x4_t v1, float32x4_t v2) { 30*207e5cccSFangrui Song return vaddq_f32(v1, v2); 31*207e5cccSFangrui Song } 32*207e5cccSFangrui Song 33*207e5cccSFangrui Song // COMMON-LABEL: test_vsub_f32 34*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <2 x float> %v1, %v2 35*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fsub.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 36*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[SUB_I]] 37*207e5cccSFangrui Song float32x2_t test_vsub_f32(float32x2_t v1, float32x2_t v2) { 38*207e5cccSFangrui Song return vsub_f32(v1, v2); 39*207e5cccSFangrui Song } 40*207e5cccSFangrui Song 41*207e5cccSFangrui Song // COMMON-LABEL: test_vsubq_f32 42*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <4 x float> %v1, %v2 43*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fsub.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 44*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[SUB_I]] 45*207e5cccSFangrui Song float32x4_t test_vsubq_f32(float32x4_t v1, float32x4_t v2) { 46*207e5cccSFangrui Song return vsubq_f32(v1, v2); 47*207e5cccSFangrui Song } 48*207e5cccSFangrui Song 49*207e5cccSFangrui Song // COMMON-LABEL: test_vsubq_f64 50*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <2 x double> %v1, %v2 51*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <2 x double> @llvm.experimental.constrained.fsub.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 52*207e5cccSFangrui Song // COMMONIR: ret <2 x double> [[SUB_I]] 53*207e5cccSFangrui Song float64x2_t test_vsubq_f64(float64x2_t v1, float64x2_t v2) { 54*207e5cccSFangrui Song return vsubq_f64(v1, v2); 55*207e5cccSFangrui Song } 56*207e5cccSFangrui Song 57*207e5cccSFangrui Song // COMMON-LABEL: test_vmul_f32 58*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <2 x float> %v1, %v2 59*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fmul.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 60*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[MUL_I]] 61*207e5cccSFangrui Song float32x2_t test_vmul_f32(float32x2_t v1, float32x2_t v2) { 62*207e5cccSFangrui Song return vmul_f32(v1, v2); 63*207e5cccSFangrui Song } 64*207e5cccSFangrui Song 65*207e5cccSFangrui Song // COMMON-LABEL: test_vmulq_f32 66*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <4 x float> %v1, %v2 67*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fmul.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 68*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[MUL_I]] 69*207e5cccSFangrui Song float32x4_t test_vmulq_f32(float32x4_t v1, float32x4_t v2) { 70*207e5cccSFangrui Song return vmulq_f32(v1, v2); 71*207e5cccSFangrui Song } 72*207e5cccSFangrui Song 73*207e5cccSFangrui Song // COMMON-LABEL: test_vmulq_f64 74*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <2 x double> %v1, %v2 75*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 76*207e5cccSFangrui Song // COMMONIR: ret <2 x double> [[MUL_I]] 77*207e5cccSFangrui Song float64x2_t test_vmulq_f64(float64x2_t v1, float64x2_t v2) { 78*207e5cccSFangrui Song return vmulq_f64(v1, v2); 79*207e5cccSFangrui Song } 80*207e5cccSFangrui Song 81*207e5cccSFangrui Song // COMMON-LABEL: test_vmla_f32 82*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <2 x float> %v2, %v3 83*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fmul.v2f32(<2 x float> %v2, <2 x float> %v3, metadata !"round.tonearest", metadata !"fpexcept.strict") 84*207e5cccSFangrui Song // UNCONSTRAINED: [[ADD_I:%.*]] = fadd <2 x float> %v1, [[MUL_I]] 85*207e5cccSFangrui Song // CONSTRAINED: [[ADD_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> %v1, <2 x float> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 86*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[ADD_I]] 87*207e5cccSFangrui Song float32x2_t test_vmla_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) { 88*207e5cccSFangrui Song return vmla_f32(v1, v2, v3); 89*207e5cccSFangrui Song } 90*207e5cccSFangrui Song 91*207e5cccSFangrui Song // COMMON-LABEL: test_vmlaq_f32 92*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <4 x float> %v2, %v3 93*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fmul.v4f32(<4 x float> %v2, <4 x float> %v3, metadata !"round.tonearest", metadata !"fpexcept.strict") 94*207e5cccSFangrui Song // UNCONSTRAINED: [[ADD_I:%.*]] = fadd <4 x float> %v1, [[MUL_I]] 95*207e5cccSFangrui Song // CONSTRAINED: [[ADD_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fadd.v4f32(<4 x float> %v1, <4 x float> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 96*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[ADD_I]] 97*207e5cccSFangrui Song float32x4_t test_vmlaq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) { 98*207e5cccSFangrui Song return vmlaq_f32(v1, v2, v3); 99*207e5cccSFangrui Song } 100*207e5cccSFangrui Song 101*207e5cccSFangrui Song // COMMON-LABEL: test_vmlaq_f64 102*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <2 x double> %v2, %v3 103*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %v2, <2 x double> %v3, metadata !"round.tonearest", metadata !"fpexcept.strict") 104*207e5cccSFangrui Song // UNCONSTRAINED: [[ADD_I:%.*]] = fadd <2 x double> %v1, [[MUL_I]] 105*207e5cccSFangrui Song // CONSTRAINED: [[ADD_I:%.*]] = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %v1, <2 x double> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 106*207e5cccSFangrui Song // COMMONIR: ret <2 x double> [[ADD_I]] 107*207e5cccSFangrui Song float64x2_t test_vmlaq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) { 108*207e5cccSFangrui Song return vmlaq_f64(v1, v2, v3); 109*207e5cccSFangrui Song } 110*207e5cccSFangrui Song 111*207e5cccSFangrui Song // COMMON-LABEL: test_vmls_f32 112*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <2 x float> %v2, %v3 113*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fmul.v2f32(<2 x float> %v2, <2 x float> %v3, metadata !"round.tonearest", metadata !"fpexcept.strict") 114*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <2 x float> %v1, [[MUL_I]] 115*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fsub.v2f32(<2 x float> %v1, <2 x float> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 116*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[SUB_I]] 117*207e5cccSFangrui Song float32x2_t test_vmls_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) { 118*207e5cccSFangrui Song return vmls_f32(v1, v2, v3); 119*207e5cccSFangrui Song } 120*207e5cccSFangrui Song 121*207e5cccSFangrui Song // COMMON-LABEL: test_vmlsq_f32 122*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <4 x float> %v2, %v3 123*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fmul.v4f32(<4 x float> %v2, <4 x float> %v3, metadata !"round.tonearest", metadata !"fpexcept.strict") 124*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <4 x float> %v1, [[MUL_I]] 125*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fsub.v4f32(<4 x float> %v1, <4 x float> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 126*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[SUB_I]] 127*207e5cccSFangrui Song float32x4_t test_vmlsq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) { 128*207e5cccSFangrui Song return vmlsq_f32(v1, v2, v3); 129*207e5cccSFangrui Song } 130*207e5cccSFangrui Song 131*207e5cccSFangrui Song // COMMON-LABEL: test_vmlsq_f64 132*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <2 x double> %v2, %v3 133*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %v2, <2 x double> %v3, metadata !"round.tonearest", metadata !"fpexcept.strict") 134*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <2 x double> %v1, [[MUL_I]] 135*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <2 x double> @llvm.experimental.constrained.fsub.v2f64(<2 x double> %v1, <2 x double> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 136*207e5cccSFangrui Song // COMMONIR: ret <2 x double> [[SUB_I]] 137*207e5cccSFangrui Song float64x2_t test_vmlsq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) { 138*207e5cccSFangrui Song return vmlsq_f64(v1, v2, v3); 139*207e5cccSFangrui Song } 140*207e5cccSFangrui Song 141*207e5cccSFangrui Song // COMMON-LABEL: test_vfma_f32 142*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <2 x float> %v1 to <8 x i8> 143*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <2 x float> %v2 to <8 x i8> 144*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <2 x float> %v3 to <8 x i8> 145*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <2 x float> @llvm.fma.v2f32(<2 x float> %v2, <2 x float> %v3, <2 x float> %v1) 146*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <2 x float> @llvm.experimental.constrained.fma.v2f32(<2 x float> %v2, <2 x float> %v3, <2 x float> %v1, metadata !"round.tonearest", metadata !"fpexcept.strict") 147*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[TMP3]] 148*207e5cccSFangrui Song float32x2_t test_vfma_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) { 149*207e5cccSFangrui Song return vfma_f32(v1, v2, v3); 150*207e5cccSFangrui Song } 151*207e5cccSFangrui Song 152*207e5cccSFangrui Song // COMMON-LABEL: test_vfmaq_f32 153*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <4 x float> %v1 to <16 x i8> 154*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <4 x float> %v2 to <16 x i8> 155*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <4 x float> %v3 to <16 x i8> 156*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %v2, <4 x float> %v3, <4 x float> %v1) 157*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %v2, <4 x float> %v3, <4 x float> %v1, metadata !"round.tonearest", metadata !"fpexcept.strict") 158*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[TMP3]] 159*207e5cccSFangrui Song float32x4_t test_vfmaq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) { 160*207e5cccSFangrui Song return vfmaq_f32(v1, v2, v3); 161*207e5cccSFangrui Song } 162*207e5cccSFangrui Song 163*207e5cccSFangrui Song // COMMON-LABEL: test_vfmaq_f64 164*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <2 x double> %v1 to <16 x i8> 165*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <2 x double> %v2 to <16 x i8> 166*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <2 x double> %v3 to <16 x i8> 167*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %v2, <2 x double> %v3, <2 x double> %v1) 168*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %v2, <2 x double> %v3, <2 x double> %v1, metadata !"round.tonearest", metadata !"fpexcept.strict") 169*207e5cccSFangrui Song // COMMONIR: ret <2 x double> [[TMP3]] 170*207e5cccSFangrui Song float64x2_t test_vfmaq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) { 171*207e5cccSFangrui Song return vfmaq_f64(v1, v2, v3); 172*207e5cccSFangrui Song } 173*207e5cccSFangrui Song 174*207e5cccSFangrui Song // COMMON-LABEL: test_vfms_f32 175*207e5cccSFangrui Song // COMMONIR: [[SUB_I:%.*]] = fneg <2 x float> %v2 176*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <2 x float> %v1 to <8 x i8> 177*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <2 x float> [[SUB_I]] to <8 x i8> 178*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <2 x float> %v3 to <8 x i8> 179*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <2 x float> @llvm.fma.v2f32(<2 x float> [[SUB_I]], <2 x float> %v3, <2 x float> %v1) 180*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <2 x float> @llvm.experimental.constrained.fma.v2f32(<2 x float> [[SUB_I]], <2 x float> %v3, <2 x float> %v1, metadata !"round.tonearest", metadata !"fpexcept.strict") 181*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[TMP3]] 182*207e5cccSFangrui Song float32x2_t test_vfms_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) { 183*207e5cccSFangrui Song return vfms_f32(v1, v2, v3); 184*207e5cccSFangrui Song } 185*207e5cccSFangrui Song 186*207e5cccSFangrui Song // COMMON-LABEL: test_vfmsq_f32 187*207e5cccSFangrui Song // COMMONIR: [[SUB_I:%.*]] = fneg <4 x float> %v2 188*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <4 x float> %v1 to <16 x i8> 189*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <4 x float> [[SUB_I]] to <16 x i8> 190*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <4 x float> %v3 to <16 x i8> 191*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <4 x float> @llvm.fma.v4f32(<4 x float> [[SUB_I]], <4 x float> %v3, <4 x float> %v1) 192*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> [[SUB_I]], <4 x float> %v3, <4 x float> %v1, metadata !"round.tonearest", metadata !"fpexcept.strict") 193*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[TMP3]] 194*207e5cccSFangrui Song float32x4_t test_vfmsq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) { 195*207e5cccSFangrui Song return vfmsq_f32(v1, v2, v3); 196*207e5cccSFangrui Song } 197*207e5cccSFangrui Song 198*207e5cccSFangrui Song // COMMON-LABEL: test_vfmsq_f64 199*207e5cccSFangrui Song // COMMONIR: [[SUB_I:%.*]] = fneg <2 x double> %v2 200*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <2 x double> %v1 to <16 x i8> 201*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <2 x double> [[SUB_I]] to <16 x i8> 202*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <2 x double> %v3 to <16 x i8> 203*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[SUB_I]], <2 x double> %v3, <2 x double> %v1) 204*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> [[SUB_I]], <2 x double> %v3, <2 x double> %v1, metadata !"round.tonearest", metadata !"fpexcept.strict") 205*207e5cccSFangrui Song // COMMONIR: ret <2 x double> [[TMP3]] 206*207e5cccSFangrui Song float64x2_t test_vfmsq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) { 207*207e5cccSFangrui Song return vfmsq_f64(v1, v2, v3); 208*207e5cccSFangrui Song } 209*207e5cccSFangrui Song 210*207e5cccSFangrui Song // COMMON-LABEL: test_vdivq_f64 211*207e5cccSFangrui Song // UNCONSTRAINED: [[DIV_I:%.*]] = fdiv <2 x double> %v1, %v2 212*207e5cccSFangrui Song // CONSTRAINED: [[DIV_I:%.*]] = call <2 x double> @llvm.experimental.constrained.fdiv.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 213*207e5cccSFangrui Song // COMMONIR: ret <2 x double> [[DIV_I]] 214*207e5cccSFangrui Song float64x2_t test_vdivq_f64(float64x2_t v1, float64x2_t v2) { 215*207e5cccSFangrui Song return vdivq_f64(v1, v2); 216*207e5cccSFangrui Song } 217*207e5cccSFangrui Song 218*207e5cccSFangrui Song // COMMON-LABEL: test_vdivq_f32 219*207e5cccSFangrui Song // UNCONSTRAINED: [[DIV_I:%.*]] = fdiv <4 x float> %v1, %v2 220*207e5cccSFangrui Song // CONSTRAINED: [[DIV_I:%.*]] = call <4 x float> @llvm.experimental.constrained.fdiv.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 221*207e5cccSFangrui Song // COMMONIR: ret <4 x float> [[DIV_I]] 222*207e5cccSFangrui Song float32x4_t test_vdivq_f32(float32x4_t v1, float32x4_t v2) { 223*207e5cccSFangrui Song return vdivq_f32(v1, v2); 224*207e5cccSFangrui Song } 225*207e5cccSFangrui Song 226*207e5cccSFangrui Song // COMMON-LABEL: test_vdiv_f32 227*207e5cccSFangrui Song // UNCONSTRAINED: [[DIV_I:%.*]] = fdiv <2 x float> %v1, %v2 228*207e5cccSFangrui Song // CONSTRAINED: [[DIV_I:%.*]] = call <2 x float> @llvm.experimental.constrained.fdiv.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"round.tonearest", metadata !"fpexcept.strict") 229*207e5cccSFangrui Song // COMMONIR: ret <2 x float> [[DIV_I]] 230*207e5cccSFangrui Song float32x2_t test_vdiv_f32(float32x2_t v1, float32x2_t v2) { 231*207e5cccSFangrui Song return vdiv_f32(v1, v2); 232*207e5cccSFangrui Song } 233*207e5cccSFangrui Song 234*207e5cccSFangrui Song // COMMON-LABEL: test_vceq_f32 235*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oeq <2 x float> %v1, %v2 236*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmp.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"oeq", metadata !"fpexcept.strict") 237*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i32> 238*207e5cccSFangrui Song // COMMONIR: ret <2 x i32> [[SEXT_I]] 239*207e5cccSFangrui Song uint32x2_t test_vceq_f32(float32x2_t v1, float32x2_t v2) { 240*207e5cccSFangrui Song return vceq_f32(v1, v2); 241*207e5cccSFangrui Song } 242*207e5cccSFangrui Song 243*207e5cccSFangrui Song // COMMON-LABEL: test_vceq_f64 244*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oeq <1 x double> %a, %b 245*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <1 x i1> @llvm.experimental.constrained.fcmp.v1f64(<1 x double> %a, <1 x double> %b, metadata !"oeq", metadata !"fpexcept.strict") 246*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <1 x i1> [[CMP_I]] to <1 x i64> 247*207e5cccSFangrui Song // COMMONIR: ret <1 x i64> [[SEXT_I]] 248*207e5cccSFangrui Song uint64x1_t test_vceq_f64(float64x1_t a, float64x1_t b) { 249*207e5cccSFangrui Song return vceq_f64(a, b); 250*207e5cccSFangrui Song } 251*207e5cccSFangrui Song 252*207e5cccSFangrui Song // COMMON-LABEL: test_vceqq_f32 253*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oeq <4 x float> %v1, %v2 254*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <4 x i1> @llvm.experimental.constrained.fcmp.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"oeq", metadata !"fpexcept.strict") 255*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 256*207e5cccSFangrui Song // COMMONIR: ret <4 x i32> [[SEXT_I]] 257*207e5cccSFangrui Song uint32x4_t test_vceqq_f32(float32x4_t v1, float32x4_t v2) { 258*207e5cccSFangrui Song return vceqq_f32(v1, v2); 259*207e5cccSFangrui Song } 260*207e5cccSFangrui Song 261*207e5cccSFangrui Song // COMMON-LABEL: test_vceqq_f64 262*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oeq <2 x double> %v1, %v2 263*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmp.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"oeq", metadata !"fpexcept.strict") 264*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 265*207e5cccSFangrui Song // COMMONIR: ret <2 x i64> [[SEXT_I]] 266*207e5cccSFangrui Song uint64x2_t test_vceqq_f64(float64x2_t v1, float64x2_t v2) { 267*207e5cccSFangrui Song return vceqq_f64(v1, v2); 268*207e5cccSFangrui Song } 269*207e5cccSFangrui Song 270*207e5cccSFangrui Song // COMMON-LABEL: test_vcge_f32 271*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oge <2 x float> %v1, %v2 272*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"oge", metadata !"fpexcept.strict") 273*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i32> 274*207e5cccSFangrui Song // COMMONIR: ret <2 x i32> [[SEXT_I]] 275*207e5cccSFangrui Song uint32x2_t test_vcge_f32(float32x2_t v1, float32x2_t v2) { 276*207e5cccSFangrui Song return vcge_f32(v1, v2); 277*207e5cccSFangrui Song } 278*207e5cccSFangrui Song 279*207e5cccSFangrui Song // COMMON-LABEL: test_vcge_f64 280*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oge <1 x double> %a, %b 281*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <1 x i1> @llvm.experimental.constrained.fcmps.v1f64(<1 x double> %a, <1 x double> %b, metadata !"oge", metadata !"fpexcept.strict") 282*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <1 x i1> [[CMP_I]] to <1 x i64> 283*207e5cccSFangrui Song // COMMONIR: ret <1 x i64> [[SEXT_I]] 284*207e5cccSFangrui Song uint64x1_t test_vcge_f64(float64x1_t a, float64x1_t b) { 285*207e5cccSFangrui Song return vcge_f64(a, b); 286*207e5cccSFangrui Song } 287*207e5cccSFangrui Song 288*207e5cccSFangrui Song // COMMON-LABEL: test_vcgeq_f32 289*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oge <4 x float> %v1, %v2 290*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <4 x i1> @llvm.experimental.constrained.fcmps.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"oge", metadata !"fpexcept.strict") 291*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 292*207e5cccSFangrui Song // COMMONIR: ret <4 x i32> [[SEXT_I]] 293*207e5cccSFangrui Song uint32x4_t test_vcgeq_f32(float32x4_t v1, float32x4_t v2) { 294*207e5cccSFangrui Song return vcgeq_f32(v1, v2); 295*207e5cccSFangrui Song } 296*207e5cccSFangrui Song 297*207e5cccSFangrui Song // COMMON-LABEL: test_vcgeq_f64 298*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp oge <2 x double> %v1, %v2 299*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"oge", metadata !"fpexcept.strict") 300*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 301*207e5cccSFangrui Song // COMMONIR: ret <2 x i64> [[SEXT_I]] 302*207e5cccSFangrui Song uint64x2_t test_vcgeq_f64(float64x2_t v1, float64x2_t v2) { 303*207e5cccSFangrui Song return vcgeq_f64(v1, v2); 304*207e5cccSFangrui Song } 305*207e5cccSFangrui Song 306*207e5cccSFangrui Song // COMMON-LABEL: test_vcle_f32 307*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ole <2 x float> %v1, %v2 308*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"ole", metadata !"fpexcept.strict") 309*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i32> 310*207e5cccSFangrui Song // COMMONIR: ret <2 x i32> [[SEXT_I]] 311*207e5cccSFangrui Song uint32x2_t test_vcle_f32(float32x2_t v1, float32x2_t v2) { 312*207e5cccSFangrui Song return vcle_f32(v1, v2); 313*207e5cccSFangrui Song } 314*207e5cccSFangrui Song 315*207e5cccSFangrui Song // COMMON-LABEL: test_vcle_f64 316*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ole <1 x double> %a, %b 317*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <1 x i1> @llvm.experimental.constrained.fcmps.v1f64(<1 x double> %a, <1 x double> %b, metadata !"ole", metadata !"fpexcept.strict") 318*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <1 x i1> [[CMP_I]] to <1 x i64> 319*207e5cccSFangrui Song // COMMONIR: ret <1 x i64> [[SEXT_I]] 320*207e5cccSFangrui Song uint64x1_t test_vcle_f64(float64x1_t a, float64x1_t b) { 321*207e5cccSFangrui Song return vcle_f64(a, b); 322*207e5cccSFangrui Song } 323*207e5cccSFangrui Song 324*207e5cccSFangrui Song // COMMON-LABEL: test_vcleq_f32 325*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ole <4 x float> %v1, %v2 326*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <4 x i1> @llvm.experimental.constrained.fcmps.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"ole", metadata !"fpexcept.strict") 327*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 328*207e5cccSFangrui Song // COMMONIR: ret <4 x i32> [[SEXT_I]] 329*207e5cccSFangrui Song uint32x4_t test_vcleq_f32(float32x4_t v1, float32x4_t v2) { 330*207e5cccSFangrui Song return vcleq_f32(v1, v2); 331*207e5cccSFangrui Song } 332*207e5cccSFangrui Song 333*207e5cccSFangrui Song // COMMON-LABEL: test_vcleq_f64 334*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ole <2 x double> %v1, %v2 335*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"ole", metadata !"fpexcept.strict") 336*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 337*207e5cccSFangrui Song // COMMONIR: ret <2 x i64> [[SEXT_I]] 338*207e5cccSFangrui Song uint64x2_t test_vcleq_f64(float64x2_t v1, float64x2_t v2) { 339*207e5cccSFangrui Song return vcleq_f64(v1, v2); 340*207e5cccSFangrui Song } 341*207e5cccSFangrui Song 342*207e5cccSFangrui Song // COMMON-LABEL: test_vcgt_f32 343*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ogt <2 x float> %v1, %v2 344*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"ogt", metadata !"fpexcept.strict") 345*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i32> 346*207e5cccSFangrui Song // COMMONIR: ret <2 x i32> [[SEXT_I]] 347*207e5cccSFangrui Song uint32x2_t test_vcgt_f32(float32x2_t v1, float32x2_t v2) { 348*207e5cccSFangrui Song return vcgt_f32(v1, v2); 349*207e5cccSFangrui Song } 350*207e5cccSFangrui Song 351*207e5cccSFangrui Song // COMMON-LABEL: test_vcgt_f64 352*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ogt <1 x double> %a, %b 353*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <1 x i1> @llvm.experimental.constrained.fcmps.v1f64(<1 x double> %a, <1 x double> %b, metadata !"ogt", metadata !"fpexcept.strict") 354*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <1 x i1> [[CMP_I]] to <1 x i64> 355*207e5cccSFangrui Song // COMMONIR: ret <1 x i64> [[SEXT_I]] 356*207e5cccSFangrui Song uint64x1_t test_vcgt_f64(float64x1_t a, float64x1_t b) { 357*207e5cccSFangrui Song return vcgt_f64(a, b); 358*207e5cccSFangrui Song } 359*207e5cccSFangrui Song 360*207e5cccSFangrui Song // COMMON-LABEL: test_vcgtq_f32 361*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ogt <4 x float> %v1, %v2 362*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <4 x i1> @llvm.experimental.constrained.fcmps.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"ogt", metadata !"fpexcept.strict") 363*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 364*207e5cccSFangrui Song // COMMONIR: ret <4 x i32> [[SEXT_I]] 365*207e5cccSFangrui Song uint32x4_t test_vcgtq_f32(float32x4_t v1, float32x4_t v2) { 366*207e5cccSFangrui Song return vcgtq_f32(v1, v2); 367*207e5cccSFangrui Song } 368*207e5cccSFangrui Song 369*207e5cccSFangrui Song // COMMON-LABEL: test_vcgtq_f64 370*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp ogt <2 x double> %v1, %v2 371*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"ogt", metadata !"fpexcept.strict") 372*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 373*207e5cccSFangrui Song // COMMONIR: ret <2 x i64> [[SEXT_I]] 374*207e5cccSFangrui Song uint64x2_t test_vcgtq_f64(float64x2_t v1, float64x2_t v2) { 375*207e5cccSFangrui Song return vcgtq_f64(v1, v2); 376*207e5cccSFangrui Song } 377*207e5cccSFangrui Song 378*207e5cccSFangrui Song // COMMON-LABEL: test_vclt_f32 379*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp olt <2 x float> %v1, %v2 380*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f32(<2 x float> %v1, <2 x float> %v2, metadata !"olt", metadata !"fpexcept.strict") 381*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i32> 382*207e5cccSFangrui Song // COMMONIR: ret <2 x i32> [[SEXT_I]] 383*207e5cccSFangrui Song uint32x2_t test_vclt_f32(float32x2_t v1, float32x2_t v2) { 384*207e5cccSFangrui Song return vclt_f32(v1, v2); 385*207e5cccSFangrui Song } 386*207e5cccSFangrui Song 387*207e5cccSFangrui Song // COMMON-LABEL: test_vclt_f64 388*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp olt <1 x double> %a, %b 389*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <1 x i1> @llvm.experimental.constrained.fcmps.v1f64(<1 x double> %a, <1 x double> %b, metadata !"olt", metadata !"fpexcept.strict") 390*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <1 x i1> [[CMP_I]] to <1 x i64> 391*207e5cccSFangrui Song // COMMONIR: ret <1 x i64> [[SEXT_I]] 392*207e5cccSFangrui Song uint64x1_t test_vclt_f64(float64x1_t a, float64x1_t b) { 393*207e5cccSFangrui Song return vclt_f64(a, b); 394*207e5cccSFangrui Song } 395*207e5cccSFangrui Song 396*207e5cccSFangrui Song // COMMON-LABEL: test_vcltq_f32 397*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp olt <4 x float> %v1, %v2 398*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <4 x i1> @llvm.experimental.constrained.fcmps.v4f32(<4 x float> %v1, <4 x float> %v2, metadata !"olt", metadata !"fpexcept.strict") 399*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 400*207e5cccSFangrui Song // COMMONIR: ret <4 x i32> [[SEXT_I]] 401*207e5cccSFangrui Song uint32x4_t test_vcltq_f32(float32x4_t v1, float32x4_t v2) { 402*207e5cccSFangrui Song return vcltq_f32(v1, v2); 403*207e5cccSFangrui Song } 404*207e5cccSFangrui Song 405*207e5cccSFangrui Song // COMMON-LABEL: test_vcltq_f64 406*207e5cccSFangrui Song // UNCONSTRAINED: [[CMP_I:%.*]] = fcmp olt <2 x double> %v1, %v2 407*207e5cccSFangrui Song // CONSTRAINED: [[CMP_I:%.*]] = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f64(<2 x double> %v1, <2 x double> %v2, metadata !"olt", metadata !"fpexcept.strict") 408*207e5cccSFangrui Song // COMMONIR: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 409*207e5cccSFangrui Song // COMMONIR: ret <2 x i64> [[SEXT_I]] 410*207e5cccSFangrui Song uint64x2_t test_vcltq_f64(float64x2_t v1, float64x2_t v2) { 411*207e5cccSFangrui Song return vcltq_f64(v1, v2); 412*207e5cccSFangrui Song } 413*207e5cccSFangrui Song 414*207e5cccSFangrui Song // COMMON-LABEL: test_vpadds_f32 415*207e5cccSFangrui Song // COMMONIR: [[LANE0_I:%.*]] = extractelement <2 x float> %a, i64 0 416*207e5cccSFangrui Song // COMMONIR: [[LANE1_I:%.*]] = extractelement <2 x float> %a, i64 1 417*207e5cccSFangrui Song // UNCONSTRAINED: [[VPADDD_I:%.*]] = fadd float [[LANE0_I]], [[LANE1_I]] 418*207e5cccSFangrui Song // CONSTRAINED: [[VPADDD_I:%.*]] = call float @llvm.experimental.constrained.fadd.f32(float [[LANE0_I]], float [[LANE1_I]], metadata !"round.tonearest", metadata !"fpexcept.strict" 419*207e5cccSFangrui Song // COMMONIR: ret float [[VPADDD_I]] 420*207e5cccSFangrui Song float32_t test_vpadds_f32(float32x2_t a) { 421*207e5cccSFangrui Song return vpadds_f32(a); 422*207e5cccSFangrui Song } 423*207e5cccSFangrui Song 424*207e5cccSFangrui Song // COMMON-LABEL: test_vpaddd_f64 425*207e5cccSFangrui Song // COMMONIR: [[LANE0_I:%.*]] = extractelement <2 x double> %a, i64 0 426*207e5cccSFangrui Song // COMMONIR: [[LANE1_I:%.*]] = extractelement <2 x double> %a, i64 1 427*207e5cccSFangrui Song // UNCONSTRAINED: [[VPADDD_I:%.*]] = fadd double [[LANE0_I]], [[LANE1_I]] 428*207e5cccSFangrui Song // CONSTRAINED: [[VPADDD_I:%.*]] = call double @llvm.experimental.constrained.fadd.f64(double [[LANE0_I]], double [[LANE1_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 429*207e5cccSFangrui Song // COMMONIR: ret double [[VPADDD_I]] 430*207e5cccSFangrui Song float64_t test_vpaddd_f64(float64x2_t a) { 431*207e5cccSFangrui Song return vpaddd_f64(a); 432*207e5cccSFangrui Song } 433*207e5cccSFangrui Song 434*207e5cccSFangrui Song // COMMON-LABEL: test_vcvts_f32_s32 435*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = sitofp i32 %a to float 436*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call float @llvm.experimental.constrained.sitofp.f32.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 437*207e5cccSFangrui Song // COMMONIR: ret float [[TMP0]] 438*207e5cccSFangrui Song float32_t test_vcvts_f32_s32(int32_t a) { 439*207e5cccSFangrui Song return vcvts_f32_s32(a); 440*207e5cccSFangrui Song } 441*207e5cccSFangrui Song 442*207e5cccSFangrui Song // COMMON-LABEL: test_vcvtd_f64_s64 443*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = sitofp i64 %a to double 444*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call double @llvm.experimental.constrained.sitofp.f64.i64(i64 %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 445*207e5cccSFangrui Song // COMMONIR: ret double [[TMP0]] 446*207e5cccSFangrui Song float64_t test_vcvtd_f64_s64(int64_t a) { 447*207e5cccSFangrui Song return vcvtd_f64_s64(a); 448*207e5cccSFangrui Song } 449*207e5cccSFangrui Song 450*207e5cccSFangrui Song // COMMON-LABEL: test_vcvts_f32_u32 451*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = uitofp i32 %a to float 452*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call float @llvm.experimental.constrained.uitofp.f32.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 453*207e5cccSFangrui Song // COMMONIR: ret float [[TMP0]] 454*207e5cccSFangrui Song float32_t test_vcvts_f32_u32(uint32_t a) { 455*207e5cccSFangrui Song return vcvts_f32_u32(a); 456*207e5cccSFangrui Song } 457*207e5cccSFangrui Song 458*207e5cccSFangrui Song // XXX should verify the type of registers 459*207e5cccSFangrui Song // COMMON-LABEL: test_vcvtd_f64_u64 460*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = uitofp i64 %a to double 461*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call double @llvm.experimental.constrained.uitofp.f64.i64(i64 %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 462*207e5cccSFangrui Song // COMMONIR: ret double [[TMP0]] 463*207e5cccSFangrui Song float64_t test_vcvtd_f64_u64(uint64_t a) { 464*207e5cccSFangrui Song return vcvtd_f64_u64(a); 465*207e5cccSFangrui Song } 466*207e5cccSFangrui Song 467*207e5cccSFangrui Song // COMMON-LABEL: test_vceqs_f32 468*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oeq float %a, %b 469*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"oeq", metadata !"fpexcept.strict") 470*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i32 471*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCMPD_I]] 472*207e5cccSFangrui Song uint32_t test_vceqs_f32(float32_t a, float32_t b) { 473*207e5cccSFangrui Song return (uint32_t)vceqs_f32(a, b); 474*207e5cccSFangrui Song } 475*207e5cccSFangrui Song 476*207e5cccSFangrui Song // COMMON-LABEL: test_vceqd_f64 477*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oeq double %a, %b 478*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.strict") 479*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i64 480*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCMPD_I]] 481*207e5cccSFangrui Song uint64_t test_vceqd_f64(float64_t a, float64_t b) { 482*207e5cccSFangrui Song return (uint64_t)vceqd_f64(a, b); 483*207e5cccSFangrui Song } 484*207e5cccSFangrui Song 485*207e5cccSFangrui Song // COMMON-LABEL: test_vceqzs_f32 486*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oeq float %a, 0.000000e+00 487*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float 0.000000e+00, metadata !"oeq", metadata !"fpexcept.strict") 488*207e5cccSFangrui Song // COMMONIR: [[VCEQZ_I:%.*]] = sext i1 [[TMP0]] to i32 489*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCEQZ_I]] 490*207e5cccSFangrui Song uint32_t test_vceqzs_f32(float32_t a) { 491*207e5cccSFangrui Song return (uint32_t)vceqzs_f32(a); 492*207e5cccSFangrui Song } 493*207e5cccSFangrui Song 494*207e5cccSFangrui Song // COMMON-LABEL: test_vceqzd_f64 495*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oeq double %a, 0.000000e+00 496*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double %a, double 0.000000e+00, metadata !"oeq", metadata !"fpexcept.strict") 497*207e5cccSFangrui Song // COMMONIR: [[VCEQZ_I:%.*]] = sext i1 [[TMP0]] to i64 498*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCEQZ_I]] 499*207e5cccSFangrui Song uint64_t test_vceqzd_f64(float64_t a) { 500*207e5cccSFangrui Song return (uint64_t)vceqzd_f64(a); 501*207e5cccSFangrui Song } 502*207e5cccSFangrui Song 503*207e5cccSFangrui Song // COMMON-LABEL: test_vcges_f32 504*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oge float %a, %b 505*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float %b, metadata !"oge", metadata !"fpexcept.strict") 506*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i32 507*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCMPD_I]] 508*207e5cccSFangrui Song uint32_t test_vcges_f32(float32_t a, float32_t b) { 509*207e5cccSFangrui Song return (uint32_t)vcges_f32(a, b); 510*207e5cccSFangrui Song } 511*207e5cccSFangrui Song 512*207e5cccSFangrui Song // COMMON-LABEL: test_vcged_f64 513*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oge double %a, %b 514*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double %b, metadata !"oge", metadata !"fpexcept.strict") 515*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i64 516*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCMPD_I]] 517*207e5cccSFangrui Song uint64_t test_vcged_f64(float64_t a, float64_t b) { 518*207e5cccSFangrui Song return (uint64_t)vcged_f64(a, b); 519*207e5cccSFangrui Song } 520*207e5cccSFangrui Song 521*207e5cccSFangrui Song // COMMON-LABEL: test_vcgezs_f32 522*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oge float %a, 0.000000e+00 523*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float 0.000000e+00, metadata !"oge", metadata !"fpexcept.strict") 524*207e5cccSFangrui Song // COMMONIR: [[VCGEZ_I:%.*]] = sext i1 [[TMP0]] to i32 525*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCGEZ_I]] 526*207e5cccSFangrui Song uint32_t test_vcgezs_f32(float32_t a) { 527*207e5cccSFangrui Song return (uint32_t)vcgezs_f32(a); 528*207e5cccSFangrui Song } 529*207e5cccSFangrui Song 530*207e5cccSFangrui Song // COMMON-LABEL: test_vcgezd_f64 531*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp oge double %a, 0.000000e+00 532*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double 0.000000e+00, metadata !"oge", metadata !"fpexcept.strict") 533*207e5cccSFangrui Song // COMMONIR: [[VCGEZ_I:%.*]] = sext i1 [[TMP0]] to i64 534*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCGEZ_I]] 535*207e5cccSFangrui Song uint64_t test_vcgezd_f64(float64_t a) { 536*207e5cccSFangrui Song return (uint64_t)vcgezd_f64(a); 537*207e5cccSFangrui Song } 538*207e5cccSFangrui Song 539*207e5cccSFangrui Song // COMMON-LABEL: test_vcgts_f32 540*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ogt float %a, %b 541*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float %b, metadata !"ogt", metadata !"fpexcept.strict") 542*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i32 543*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCMPD_I]] 544*207e5cccSFangrui Song uint32_t test_vcgts_f32(float32_t a, float32_t b) { 545*207e5cccSFangrui Song return (uint32_t)vcgts_f32(a, b); 546*207e5cccSFangrui Song } 547*207e5cccSFangrui Song 548*207e5cccSFangrui Song // COMMON-LABEL: test_vcgtd_f64 549*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ogt double %a, %b 550*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double %b, metadata !"ogt", metadata !"fpexcept.strict") 551*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i64 552*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCMPD_I]] 553*207e5cccSFangrui Song uint64_t test_vcgtd_f64(float64_t a, float64_t b) { 554*207e5cccSFangrui Song return (uint64_t)vcgtd_f64(a, b); 555*207e5cccSFangrui Song } 556*207e5cccSFangrui Song 557*207e5cccSFangrui Song // COMMON-LABEL: test_vcgtzs_f32 558*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ogt float %a, 0.000000e+00 559*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float 0.000000e+00, metadata !"ogt", metadata !"fpexcept.strict") 560*207e5cccSFangrui Song // COMMONIR: [[VCGTZ_I:%.*]] = sext i1 [[TMP0]] to i32 561*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCGTZ_I]] 562*207e5cccSFangrui Song uint32_t test_vcgtzs_f32(float32_t a) { 563*207e5cccSFangrui Song return (uint32_t)vcgtzs_f32(a); 564*207e5cccSFangrui Song } 565*207e5cccSFangrui Song 566*207e5cccSFangrui Song // COMMON-LABEL: test_vcgtzd_f64 567*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ogt double %a, 0.000000e+00 568*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double 0.000000e+00, metadata !"ogt", metadata !"fpexcept.strict") 569*207e5cccSFangrui Song // COMMONIR: [[VCGTZ_I:%.*]] = sext i1 [[TMP0]] to i64 570*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCGTZ_I]] 571*207e5cccSFangrui Song uint64_t test_vcgtzd_f64(float64_t a) { 572*207e5cccSFangrui Song return (uint64_t)vcgtzd_f64(a); 573*207e5cccSFangrui Song } 574*207e5cccSFangrui Song 575*207e5cccSFangrui Song // COMMON-LABEL: test_vcles_f32 576*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ole float %a, %b 577*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float %b, metadata !"ole", metadata !"fpexcept.strict") 578*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i32 579*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCMPD_I]] 580*207e5cccSFangrui Song uint32_t test_vcles_f32(float32_t a, float32_t b) { 581*207e5cccSFangrui Song return (uint32_t)vcles_f32(a, b); 582*207e5cccSFangrui Song } 583*207e5cccSFangrui Song 584*207e5cccSFangrui Song // COMMON-LABEL: test_vcled_f64 585*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ole double %a, %b 586*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double %b, metadata !"ole", metadata !"fpexcept.strict") 587*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i64 588*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCMPD_I]] 589*207e5cccSFangrui Song uint64_t test_vcled_f64(float64_t a, float64_t b) { 590*207e5cccSFangrui Song return (uint64_t)vcled_f64(a, b); 591*207e5cccSFangrui Song } 592*207e5cccSFangrui Song 593*207e5cccSFangrui Song // COMMON-LABEL: test_vclezs_f32 594*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ole float %a, 0.000000e+00 595*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float 0.000000e+00, metadata !"ole", metadata !"fpexcept.strict") 596*207e5cccSFangrui Song // COMMONIR: [[VCLEZ_I:%.*]] = sext i1 [[TMP0]] to i32 597*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCLEZ_I]] 598*207e5cccSFangrui Song uint32_t test_vclezs_f32(float32_t a) { 599*207e5cccSFangrui Song return (uint32_t)vclezs_f32(a); 600*207e5cccSFangrui Song } 601*207e5cccSFangrui Song 602*207e5cccSFangrui Song // COMMON-LABEL: test_vclezd_f64 603*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp ole double %a, 0.000000e+00 604*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double 0.000000e+00, metadata !"ole", metadata !"fpexcept.strict") 605*207e5cccSFangrui Song // COMMONIR: [[VCLEZ_I:%.*]] = sext i1 [[TMP0]] to i64 606*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCLEZ_I]] 607*207e5cccSFangrui Song uint64_t test_vclezd_f64(float64_t a) { 608*207e5cccSFangrui Song return (uint64_t)vclezd_f64(a); 609*207e5cccSFangrui Song } 610*207e5cccSFangrui Song 611*207e5cccSFangrui Song // COMMON-LABEL: test_vclts_f32 612*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp olt float %a, %b 613*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float %b, metadata !"olt", metadata !"fpexcept.strict") 614*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i32 615*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCMPD_I]] 616*207e5cccSFangrui Song uint32_t test_vclts_f32(float32_t a, float32_t b) { 617*207e5cccSFangrui Song return (uint32_t)vclts_f32(a, b); 618*207e5cccSFangrui Song } 619*207e5cccSFangrui Song 620*207e5cccSFangrui Song // COMMON-LABEL: test_vcltd_f64 621*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp olt double %a, %b 622*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double %b, metadata !"olt", metadata !"fpexcept.strict") 623*207e5cccSFangrui Song // COMMONIR: [[VCMPD_I:%.*]] = sext i1 [[TMP0]] to i64 624*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCMPD_I]] 625*207e5cccSFangrui Song uint64_t test_vcltd_f64(float64_t a, float64_t b) { 626*207e5cccSFangrui Song return (uint64_t)vcltd_f64(a, b); 627*207e5cccSFangrui Song } 628*207e5cccSFangrui Song 629*207e5cccSFangrui Song // COMMON-LABEL: test_vcltzs_f32 630*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp olt float %a, 0.000000e+00 631*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float %a, float 0.000000e+00, metadata !"olt", metadata !"fpexcept.strict") 632*207e5cccSFangrui Song // COMMONIR: [[VCLTZ_I:%.*]] = sext i1 [[TMP0]] to i32 633*207e5cccSFangrui Song // COMMONIR: ret i32 [[VCLTZ_I]] 634*207e5cccSFangrui Song uint32_t test_vcltzs_f32(float32_t a) { 635*207e5cccSFangrui Song return (uint32_t)vcltzs_f32(a); 636*207e5cccSFangrui Song } 637*207e5cccSFangrui Song 638*207e5cccSFangrui Song // COMMON-LABEL: test_vcltzd_f64 639*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP0:%.*]] = fcmp olt double %a, 0.000000e+00 640*207e5cccSFangrui Song // CONSTRAINED: [[TMP0:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double %a, double 0.000000e+00, metadata !"olt", metadata !"fpexcept.strict") 641*207e5cccSFangrui Song // COMMONIR: [[VCLTZ_I:%.*]] = sext i1 [[TMP0]] to i64 642*207e5cccSFangrui Song // COMMONIR: ret i64 [[VCLTZ_I]] 643*207e5cccSFangrui Song uint64_t test_vcltzd_f64(float64_t a) { 644*207e5cccSFangrui Song return (uint64_t)vcltzd_f64(a); 645*207e5cccSFangrui Song } 646*207e5cccSFangrui Song 647*207e5cccSFangrui Song // COMMON-LABEL: test_vadd_f64 648*207e5cccSFangrui Song // UNCONSTRAINED: [[ADD_I:%.*]] = fadd <1 x double> %a, %b 649*207e5cccSFangrui Song // CONSTRAINED: [[ADD_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fadd.v1f64(<1 x double> %a, <1 x double> %b, metadata !"round.tonearest", metadata !"fpexcept.strict") 650*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[ADD_I]] 651*207e5cccSFangrui Song float64x1_t test_vadd_f64(float64x1_t a, float64x1_t b) { 652*207e5cccSFangrui Song return vadd_f64(a, b); 653*207e5cccSFangrui Song } 654*207e5cccSFangrui Song 655*207e5cccSFangrui Song // COMMON-LABEL: test_vmul_f64 656*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <1 x double> %a, %b 657*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fmul.v1f64(<1 x double> %a, <1 x double> %b, metadata !"round.tonearest", metadata !"fpexcept.strict") 658*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[MUL_I]] 659*207e5cccSFangrui Song float64x1_t test_vmul_f64(float64x1_t a, float64x1_t b) { 660*207e5cccSFangrui Song return vmul_f64(a, b); 661*207e5cccSFangrui Song } 662*207e5cccSFangrui Song 663*207e5cccSFangrui Song // COMMON-LABEL: test_vdiv_f64 664*207e5cccSFangrui Song // UNCONSTRAINED: [[DIV_I:%.*]] = fdiv <1 x double> %a, %b 665*207e5cccSFangrui Song // CONSTRAINED: [[DIV_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fdiv.v1f64(<1 x double> %a, <1 x double> %b, metadata !"round.tonearest", metadata !"fpexcept.strict") 666*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[DIV_I]] 667*207e5cccSFangrui Song float64x1_t test_vdiv_f64(float64x1_t a, float64x1_t b) { 668*207e5cccSFangrui Song return vdiv_f64(a, b); 669*207e5cccSFangrui Song } 670*207e5cccSFangrui Song 671*207e5cccSFangrui Song // COMMON-LABEL: test_vmla_f64 672*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <1 x double> %b, %c 673*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fmul.v1f64(<1 x double> %b, <1 x double> %c, metadata !"round.tonearest", metadata !"fpexcept.strict") 674*207e5cccSFangrui Song // UNCONSTRAINED: [[ADD_I:%.*]] = fadd <1 x double> %a, [[MUL_I]] 675*207e5cccSFangrui Song // CONSTRAINED: [[ADD_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fadd.v1f64(<1 x double> %a, <1 x double> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 676*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[ADD_I]] 677*207e5cccSFangrui Song float64x1_t test_vmla_f64(float64x1_t a, float64x1_t b, float64x1_t c) { 678*207e5cccSFangrui Song return vmla_f64(a, b, c); 679*207e5cccSFangrui Song } 680*207e5cccSFangrui Song 681*207e5cccSFangrui Song // COMMON-LABEL: test_vmls_f64 682*207e5cccSFangrui Song // UNCONSTRAINED: [[MUL_I:%.*]] = fmul <1 x double> %b, %c 683*207e5cccSFangrui Song // CONSTRAINED: [[MUL_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fmul.v1f64(<1 x double> %b, <1 x double> %c, metadata !"round.tonearest", metadata !"fpexcept.strict") 684*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <1 x double> %a, [[MUL_I]] 685*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fsub.v1f64(<1 x double> %a, <1 x double> [[MUL_I]], metadata !"round.tonearest", metadata !"fpexcept.strict") 686*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[SUB_I]] 687*207e5cccSFangrui Song float64x1_t test_vmls_f64(float64x1_t a, float64x1_t b, float64x1_t c) { 688*207e5cccSFangrui Song return vmls_f64(a, b, c); 689*207e5cccSFangrui Song } 690*207e5cccSFangrui Song 691*207e5cccSFangrui Song // COMMON-LABEL: test_vfma_f64 692*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 693*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <1 x double> %b to <8 x i8> 694*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <1 x double> %c to <8 x i8> 695*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <1 x double> @llvm.fma.v1f64(<1 x double> %b, <1 x double> %c, <1 x double> %a) 696*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <1 x double> @llvm.experimental.constrained.fma.v1f64(<1 x double> %b, <1 x double> %c, <1 x double> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 697*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[TMP3]] 698*207e5cccSFangrui Song float64x1_t test_vfma_f64(float64x1_t a, float64x1_t b, float64x1_t c) { 699*207e5cccSFangrui Song return vfma_f64(a, b, c); 700*207e5cccSFangrui Song } 701*207e5cccSFangrui Song 702*207e5cccSFangrui Song // COMMON-LABEL: test_vfms_f64 703*207e5cccSFangrui Song // COMMONIR: [[SUB_I:%.*]] = fneg <1 x double> %b 704*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 705*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = bitcast <1 x double> [[SUB_I]] to <8 x i8> 706*207e5cccSFangrui Song // COMMONIR: [[TMP2:%.*]] = bitcast <1 x double> %c to <8 x i8> 707*207e5cccSFangrui Song // UNCONSTRAINED: [[TMP3:%.*]] = call <1 x double> @llvm.fma.v1f64(<1 x double> [[SUB_I]], <1 x double> %c, <1 x double> %a) 708*207e5cccSFangrui Song // CONSTRAINED: [[TMP3:%.*]] = call <1 x double> @llvm.experimental.constrained.fma.v1f64(<1 x double> [[SUB_I]], <1 x double> %c, <1 x double> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 709*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[TMP3]] 710*207e5cccSFangrui Song float64x1_t test_vfms_f64(float64x1_t a, float64x1_t b, float64x1_t c) { 711*207e5cccSFangrui Song return vfms_f64(a, b, c); 712*207e5cccSFangrui Song } 713*207e5cccSFangrui Song 714*207e5cccSFangrui Song // COMMON-LABEL: test_vsub_f64 715*207e5cccSFangrui Song // UNCONSTRAINED: [[SUB_I:%.*]] = fsub <1 x double> %a, %b 716*207e5cccSFangrui Song // CONSTRAINED: [[SUB_I:%.*]] = call <1 x double> @llvm.experimental.constrained.fsub.v1f64(<1 x double> %a, <1 x double> %b, metadata !"round.tonearest", metadata !"fpexcept.strict") 717*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[SUB_I]] 718*207e5cccSFangrui Song float64x1_t test_vsub_f64(float64x1_t a, float64x1_t b) { 719*207e5cccSFangrui Song return vsub_f64(a, b); 720*207e5cccSFangrui Song } 721*207e5cccSFangrui Song 722*207e5cccSFangrui Song // COMMON-LABEL: test_vcvt_s64_f64 723*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 724*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = call <1 x i64> @llvm.aarch64.neon.fcvtzs.v1i64.v1f64(<1 x double> %a) 725*207e5cccSFangrui Song // COMMONIR: ret <1 x i64> [[TMP1]] 726*207e5cccSFangrui Song int64x1_t test_vcvt_s64_f64(float64x1_t a) { 727*207e5cccSFangrui Song return vcvt_s64_f64(a); 728*207e5cccSFangrui Song } 729*207e5cccSFangrui Song 730*207e5cccSFangrui Song // COMMON-LABEL: test_vcvt_u64_f64 731*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 732*207e5cccSFangrui Song // COMMONIR: [[TMP1:%.*]] = call <1 x i64> @llvm.aarch64.neon.fcvtzu.v1i64.v1f64(<1 x double> %a) 733*207e5cccSFangrui Song // COMMONIR: ret <1 x i64> [[TMP1]] 734*207e5cccSFangrui Song uint64x1_t test_vcvt_u64_f64(float64x1_t a) { 735*207e5cccSFangrui Song return vcvt_u64_f64(a); 736*207e5cccSFangrui Song } 737*207e5cccSFangrui Song 738*207e5cccSFangrui Song // COMMON-LABEL: test_vcvt_f64_s64 739*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> 740*207e5cccSFangrui Song // UNCONSTRAINED: [[VCVT_I:%.*]] = sitofp <1 x i64> %a to <1 x double> 741*207e5cccSFangrui Song // CONSTRAINED: [[VCVT_I:%.*]] = call <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i64(<1 x i64> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 742*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VCVT_I]] 743*207e5cccSFangrui Song float64x1_t test_vcvt_f64_s64(int64x1_t a) { 744*207e5cccSFangrui Song return vcvt_f64_s64(a); 745*207e5cccSFangrui Song } 746*207e5cccSFangrui Song 747*207e5cccSFangrui Song // COMMON-LABEL: test_vcvt_f64_u64 748*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> 749*207e5cccSFangrui Song // UNCONSTRAINED: [[VCVT_I:%.*]] = uitofp <1 x i64> %a to <1 x double> 750*207e5cccSFangrui Song // CONSTRAINED: [[VCVT_I:%.*]] = call <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i64(<1 x i64> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 751*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VCVT_I]] 752*207e5cccSFangrui Song float64x1_t test_vcvt_f64_u64(uint64x1_t a) { 753*207e5cccSFangrui Song return vcvt_f64_u64(a); 754*207e5cccSFangrui Song } 755*207e5cccSFangrui Song 756*207e5cccSFangrui Song // COMMON-LABEL: test_vrnda_f64 757*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 758*207e5cccSFangrui Song // UNCONSTRAINED: [[VRNDA1_I:%.*]] = call <1 x double> @llvm.round.v1f64(<1 x double> %a) 759*207e5cccSFangrui Song // CONSTRAINED: [[VRNDA1_I:%.*]] = call <1 x double> @llvm.experimental.constrained.round.v1f64(<1 x double> %a, metadata !"fpexcept.strict") 760*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VRNDA1_I]] 761*207e5cccSFangrui Song float64x1_t test_vrnda_f64(float64x1_t a) { 762*207e5cccSFangrui Song return vrnda_f64(a); 763*207e5cccSFangrui Song } 764*207e5cccSFangrui Song 765*207e5cccSFangrui Song // COMMON-LABEL: test_vrndp_f64 766*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 767*207e5cccSFangrui Song // UNCONSTRAINED: [[VRNDP1_I:%.*]] = call <1 x double> @llvm.ceil.v1f64(<1 x double> %a) 768*207e5cccSFangrui Song // CONSTRAINED: [[VRNDP1_I:%.*]] = call <1 x double> @llvm.experimental.constrained.ceil.v1f64(<1 x double> %a, metadata !"fpexcept.strict") 769*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VRNDP1_I]] 770*207e5cccSFangrui Song float64x1_t test_vrndp_f64(float64x1_t a) { 771*207e5cccSFangrui Song return vrndp_f64(a); 772*207e5cccSFangrui Song } 773*207e5cccSFangrui Song 774*207e5cccSFangrui Song // COMMON-LABEL: test_vrndm_f64 775*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 776*207e5cccSFangrui Song // UNCONSTRAINED: [[VRNDM1_I:%.*]] = call <1 x double> @llvm.floor.v1f64(<1 x double> %a) 777*207e5cccSFangrui Song // CONSTRAINED: [[VRNDM1_I:%.*]] = call <1 x double> @llvm.experimental.constrained.floor.v1f64(<1 x double> %a, metadata !"fpexcept.strict") 778*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VRNDM1_I]] 779*207e5cccSFangrui Song float64x1_t test_vrndm_f64(float64x1_t a) { 780*207e5cccSFangrui Song return vrndm_f64(a); 781*207e5cccSFangrui Song } 782*207e5cccSFangrui Song 783*207e5cccSFangrui Song // COMMON-LABEL: test_vrndx_f64 784*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 785*207e5cccSFangrui Song // UNCONSTRAINED: [[VRNDX1_I:%.*]] = call <1 x double> @llvm.rint.v1f64(<1 x double> %a) 786*207e5cccSFangrui Song // CONSTRAINED: [[VRNDX1_I:%.*]] = call <1 x double> @llvm.experimental.constrained.rint.v1f64(<1 x double> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 787*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VRNDX1_I]] 788*207e5cccSFangrui Song float64x1_t test_vrndx_f64(float64x1_t a) { 789*207e5cccSFangrui Song return vrndx_f64(a); 790*207e5cccSFangrui Song } 791*207e5cccSFangrui Song 792*207e5cccSFangrui Song // COMMON-LABEL: test_vrnd_f64 793*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 794*207e5cccSFangrui Song // UNCONSTRAINED: [[VRNDZ1_I:%.*]] = call <1 x double> @llvm.trunc.v1f64(<1 x double> %a) 795*207e5cccSFangrui Song // CONSTRAINED: [[VRNDZ1_I:%.*]] = call <1 x double> @llvm.experimental.constrained.trunc.v1f64(<1 x double> %a, metadata !"fpexcept.strict") 796*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VRNDZ1_I]] 797*207e5cccSFangrui Song float64x1_t test_vrnd_f64(float64x1_t a) { 798*207e5cccSFangrui Song return vrnd_f64(a); 799*207e5cccSFangrui Song } 800*207e5cccSFangrui Song 801*207e5cccSFangrui Song // COMMON-LABEL: test_vrndi_f64 802*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 803*207e5cccSFangrui Song // UNCONSTRAINED: [[VRNDI1_I:%.*]] = call <1 x double> @llvm.nearbyint.v1f64(<1 x double> %a) 804*207e5cccSFangrui Song // CONSTRAINED: [[VRNDI1_I:%.*]] = call <1 x double> @llvm.experimental.constrained.nearbyint.v1f64(<1 x double> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 805*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VRNDI1_I]] 806*207e5cccSFangrui Song float64x1_t test_vrndi_f64(float64x1_t a) { 807*207e5cccSFangrui Song return vrndi_f64(a); 808*207e5cccSFangrui Song } 809*207e5cccSFangrui Song 810*207e5cccSFangrui Song // COMMON-LABEL: test_vsqrt_f64 811*207e5cccSFangrui Song // COMMONIR: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> 812*207e5cccSFangrui Song // UNCONSTRAINED: [[VSQRT_I:%.*]] = call <1 x double> @llvm.sqrt.v1f64(<1 x double> %a) 813*207e5cccSFangrui Song // CONSTRAINED: [[VSQRT_I:%.*]] = call <1 x double> @llvm.experimental.constrained.sqrt.v1f64(<1 x double> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") 814*207e5cccSFangrui Song // COMMONIR: ret <1 x double> [[VSQRT_I]] 815*207e5cccSFangrui Song float64x1_t test_vsqrt_f64(float64x1_t a) { 816*207e5cccSFangrui Song return vsqrt_f64(a); 817*207e5cccSFangrui Song } 818