1*207e5cccSFangrui Song // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature 2*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s 3*207e5cccSFangrui Song 4*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target || arm-registered-target 5*207e5cccSFangrui Song 6*207e5cccSFangrui Song #include <arm_neon.h> 7*207e5cccSFangrui Song 8*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmla_n_f32 9*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], float noundef [[C:%.*]]) #[[ATTR0:[0-9]+]] { 10*207e5cccSFangrui Song // CHECK-NEXT: entry: 11*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x float> poison, float [[C]], i32 0 12*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x float> [[VECINIT_I]], float [[C]], i32 1 13*207e5cccSFangrui Song // CHECK-NEXT: [[MUL_I:%.*]] = fmul <2 x float> [[B]], [[VECINIT1_I]] 14*207e5cccSFangrui Song // CHECK-NEXT: [[ADD_I:%.*]] = fadd <2 x float> [[A]], [[MUL_I]] 15*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[ADD_I]] 16*207e5cccSFangrui Song // 17*207e5cccSFangrui Song float32x2_t test_vmla_n_f32(float32x2_t a, float32x2_t b, float32_t c) { 18*207e5cccSFangrui Song return vmla_n_f32(a, b, c); 19*207e5cccSFangrui Song } 20*207e5cccSFangrui Song 21*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlaq_n_f32 22*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], float noundef [[C:%.*]]) #[[ATTR0]] { 23*207e5cccSFangrui Song // CHECK-NEXT: entry: 24*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x float> poison, float [[C]], i32 0 25*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float [[C]], i32 1 26*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float [[C]], i32 2 27*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float [[C]], i32 3 28*207e5cccSFangrui Song // CHECK-NEXT: [[MUL_I:%.*]] = fmul <4 x float> [[B]], [[VECINIT3_I]] 29*207e5cccSFangrui Song // CHECK-NEXT: [[ADD_I:%.*]] = fadd <4 x float> [[A]], [[MUL_I]] 30*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[ADD_I]] 31*207e5cccSFangrui Song // 32*207e5cccSFangrui Song float32x4_t test_vmlaq_n_f32(float32x4_t a, float32x4_t b, float32_t c) { 33*207e5cccSFangrui Song return vmlaq_n_f32(a, b, c); 34*207e5cccSFangrui Song } 35*207e5cccSFangrui Song 36*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlsq_n_f32 37*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], float noundef [[C:%.*]]) #[[ATTR0]] { 38*207e5cccSFangrui Song // CHECK-NEXT: entry: 39*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x float> poison, float [[C]], i32 0 40*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float [[C]], i32 1 41*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float [[C]], i32 2 42*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float [[C]], i32 3 43*207e5cccSFangrui Song // CHECK-NEXT: [[MUL_I:%.*]] = fmul <4 x float> [[B]], [[VECINIT3_I]] 44*207e5cccSFangrui Song // CHECK-NEXT: [[SUB_I:%.*]] = fsub <4 x float> [[A]], [[MUL_I]] 45*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[SUB_I]] 46*207e5cccSFangrui Song // 47*207e5cccSFangrui Song float32x4_t test_vmlsq_n_f32(float32x4_t a, float32x4_t b, float32_t c) { 48*207e5cccSFangrui Song return vmlsq_n_f32(a, b, c); 49*207e5cccSFangrui Song } 50*207e5cccSFangrui Song 51*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmls_n_f32 52*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], float noundef [[C:%.*]]) #[[ATTR0]] { 53*207e5cccSFangrui Song // CHECK-NEXT: entry: 54*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x float> poison, float [[C]], i32 0 55*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x float> [[VECINIT_I]], float [[C]], i32 1 56*207e5cccSFangrui Song // CHECK-NEXT: [[MUL_I:%.*]] = fmul <2 x float> [[B]], [[VECINIT1_I]] 57*207e5cccSFangrui Song // CHECK-NEXT: [[SUB_I:%.*]] = fsub <2 x float> [[A]], [[MUL_I]] 58*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[SUB_I]] 59*207e5cccSFangrui Song // 60*207e5cccSFangrui Song float32x2_t test_vmls_n_f32(float32x2_t a, float32x2_t b, float32_t c) { 61*207e5cccSFangrui Song return vmls_n_f32(a, b, c); 62*207e5cccSFangrui Song } 63*207e5cccSFangrui Song 64*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmla_lane_f32_0 65*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 66*207e5cccSFangrui Song // CHECK-NEXT: entry: 67*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 68*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 69*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <2 x i32> zeroinitializer 70*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 71*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <2 x float> [[A]], [[MUL]] 72*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[ADD]] 73*207e5cccSFangrui Song // 74*207e5cccSFangrui Song float32x2_t test_vmla_lane_f32_0(float32x2_t a, float32x2_t b, float32x2_t v) { 75*207e5cccSFangrui Song return vmla_lane_f32(a, b, v, 0); 76*207e5cccSFangrui Song } 77*207e5cccSFangrui Song 78*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlaq_lane_f32_0 79*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 80*207e5cccSFangrui Song // CHECK-NEXT: entry: 81*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 82*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 83*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <4 x i32> zeroinitializer 84*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 85*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <4 x float> [[A]], [[MUL]] 86*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[ADD]] 87*207e5cccSFangrui Song // 88*207e5cccSFangrui Song float32x4_t test_vmlaq_lane_f32_0(float32x4_t a, float32x4_t b, float32x2_t v) { 89*207e5cccSFangrui Song return vmlaq_lane_f32(a, b, v, 0); 90*207e5cccSFangrui Song } 91*207e5cccSFangrui Song 92*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmla_laneq_f32_0 93*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 94*207e5cccSFangrui Song // CHECK-NEXT: entry: 95*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 96*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 97*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <2 x i32> zeroinitializer 98*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 99*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <2 x float> [[A]], [[MUL]] 100*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[ADD]] 101*207e5cccSFangrui Song // 102*207e5cccSFangrui Song float32x2_t test_vmla_laneq_f32_0(float32x2_t a, float32x2_t b, float32x4_t v) { 103*207e5cccSFangrui Song return vmla_laneq_f32(a, b, v, 0); 104*207e5cccSFangrui Song } 105*207e5cccSFangrui Song 106*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlaq_laneq_f32_0 107*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 108*207e5cccSFangrui Song // CHECK-NEXT: entry: 109*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 110*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 111*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <4 x i32> zeroinitializer 112*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 113*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <4 x float> [[A]], [[MUL]] 114*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[ADD]] 115*207e5cccSFangrui Song // 116*207e5cccSFangrui Song float32x4_t test_vmlaq_laneq_f32_0(float32x4_t a, float32x4_t b, float32x4_t v) { 117*207e5cccSFangrui Song return vmlaq_laneq_f32(a, b, v, 0); 118*207e5cccSFangrui Song } 119*207e5cccSFangrui Song 120*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmls_lane_f32_0 121*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 122*207e5cccSFangrui Song // CHECK-NEXT: entry: 123*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 124*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 125*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <2 x i32> zeroinitializer 126*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 127*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <2 x float> [[A]], [[MUL]] 128*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[SUB]] 129*207e5cccSFangrui Song // 130*207e5cccSFangrui Song float32x2_t test_vmls_lane_f32_0(float32x2_t a, float32x2_t b, float32x2_t v) { 131*207e5cccSFangrui Song return vmls_lane_f32(a, b, v, 0); 132*207e5cccSFangrui Song } 133*207e5cccSFangrui Song 134*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlsq_lane_f32_0 135*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 136*207e5cccSFangrui Song // CHECK-NEXT: entry: 137*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 138*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 139*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <4 x i32> zeroinitializer 140*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 141*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <4 x float> [[A]], [[MUL]] 142*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[SUB]] 143*207e5cccSFangrui Song // 144*207e5cccSFangrui Song float32x4_t test_vmlsq_lane_f32_0(float32x4_t a, float32x4_t b, float32x2_t v) { 145*207e5cccSFangrui Song return vmlsq_lane_f32(a, b, v, 0); 146*207e5cccSFangrui Song } 147*207e5cccSFangrui Song 148*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmls_laneq_f32_0 149*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 150*207e5cccSFangrui Song // CHECK-NEXT: entry: 151*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 152*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 153*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <2 x i32> zeroinitializer 154*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 155*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <2 x float> [[A]], [[MUL]] 156*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[SUB]] 157*207e5cccSFangrui Song // 158*207e5cccSFangrui Song float32x2_t test_vmls_laneq_f32_0(float32x2_t a, float32x2_t b, float32x4_t v) { 159*207e5cccSFangrui Song return vmls_laneq_f32(a, b, v, 0); 160*207e5cccSFangrui Song } 161*207e5cccSFangrui Song 162*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlsq_laneq_f32_0 163*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 164*207e5cccSFangrui Song // CHECK-NEXT: entry: 165*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 166*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 167*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <4 x i32> zeroinitializer 168*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 169*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <4 x float> [[A]], [[MUL]] 170*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[SUB]] 171*207e5cccSFangrui Song // 172*207e5cccSFangrui Song float32x4_t test_vmlsq_laneq_f32_0(float32x4_t a, float32x4_t b, float32x4_t v) { 173*207e5cccSFangrui Song return vmlsq_laneq_f32(a, b, v, 0); 174*207e5cccSFangrui Song } 175*207e5cccSFangrui Song 176*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmla_lane_f32 177*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 178*207e5cccSFangrui Song // CHECK-NEXT: entry: 179*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 180*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 181*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <2 x i32> <i32 1, i32 1> 182*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 183*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <2 x float> [[A]], [[MUL]] 184*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[ADD]] 185*207e5cccSFangrui Song // 186*207e5cccSFangrui Song float32x2_t test_vmla_lane_f32(float32x2_t a, float32x2_t b, float32x2_t v) { 187*207e5cccSFangrui Song return vmla_lane_f32(a, b, v, 1); 188*207e5cccSFangrui Song } 189*207e5cccSFangrui Song 190*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlaq_lane_f32 191*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 192*207e5cccSFangrui Song // CHECK-NEXT: entry: 193*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 194*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 195*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <4 x i32> <i32 1, i32 1, i32 1, i32 1> 196*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 197*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <4 x float> [[A]], [[MUL]] 198*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[ADD]] 199*207e5cccSFangrui Song // 200*207e5cccSFangrui Song float32x4_t test_vmlaq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t v) { 201*207e5cccSFangrui Song return vmlaq_lane_f32(a, b, v, 1); 202*207e5cccSFangrui Song } 203*207e5cccSFangrui Song 204*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmla_laneq_f32 205*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 206*207e5cccSFangrui Song // CHECK-NEXT: entry: 207*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 208*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 209*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <2 x i32> <i32 3, i32 3> 210*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 211*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <2 x float> [[A]], [[MUL]] 212*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[ADD]] 213*207e5cccSFangrui Song // 214*207e5cccSFangrui Song float32x2_t test_vmla_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t v) { 215*207e5cccSFangrui Song return vmla_laneq_f32(a, b, v, 3); 216*207e5cccSFangrui Song } 217*207e5cccSFangrui Song 218*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlaq_laneq_f32 219*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 220*207e5cccSFangrui Song // CHECK-NEXT: entry: 221*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 222*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 223*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <4 x i32> <i32 3, i32 3, i32 3, i32 3> 224*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 225*207e5cccSFangrui Song // CHECK-NEXT: [[ADD:%.*]] = fadd <4 x float> [[A]], [[MUL]] 226*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[ADD]] 227*207e5cccSFangrui Song // 228*207e5cccSFangrui Song float32x4_t test_vmlaq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t v) { 229*207e5cccSFangrui Song return vmlaq_laneq_f32(a, b, v, 3); 230*207e5cccSFangrui Song } 231*207e5cccSFangrui Song 232*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmls_lane_f32 233*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 234*207e5cccSFangrui Song // CHECK-NEXT: entry: 235*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 236*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 237*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <2 x i32> <i32 1, i32 1> 238*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 239*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <2 x float> [[A]], [[MUL]] 240*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[SUB]] 241*207e5cccSFangrui Song // 242*207e5cccSFangrui Song float32x2_t test_vmls_lane_f32(float32x2_t a, float32x2_t b, float32x2_t v) { 243*207e5cccSFangrui Song return vmls_lane_f32(a, b, v, 1); 244*207e5cccSFangrui Song } 245*207e5cccSFangrui Song 246*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlsq_lane_f32 247*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <2 x float> noundef [[V:%.*]]) #[[ATTR0]] { 248*207e5cccSFangrui Song // CHECK-NEXT: entry: 249*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[V]] to <8 x i8> 250*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> 251*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> [[TMP1]], <4 x i32> <i32 1, i32 1, i32 1, i32 1> 252*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 253*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <4 x float> [[A]], [[MUL]] 254*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[SUB]] 255*207e5cccSFangrui Song // 256*207e5cccSFangrui Song float32x4_t test_vmlsq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t v) { 257*207e5cccSFangrui Song return vmlsq_lane_f32(a, b, v, 1); 258*207e5cccSFangrui Song } 259*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmls_laneq_f32 260*207e5cccSFangrui Song // CHECK-SAME: (<2 x float> noundef [[A:%.*]], <2 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 261*207e5cccSFangrui Song // CHECK-NEXT: entry: 262*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 263*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 264*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <2 x i32> <i32 3, i32 3> 265*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <2 x float> [[B]], [[LANE]] 266*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <2 x float> [[A]], [[MUL]] 267*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x float> [[SUB]] 268*207e5cccSFangrui Song // 269*207e5cccSFangrui Song float32x2_t test_vmls_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t v) { 270*207e5cccSFangrui Song return vmls_laneq_f32(a, b, v, 3); 271*207e5cccSFangrui Song } 272*207e5cccSFangrui Song 273*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmlsq_laneq_f32 274*207e5cccSFangrui Song // CHECK-SAME: (<4 x float> noundef [[A:%.*]], <4 x float> noundef [[B:%.*]], <4 x float> noundef [[V:%.*]]) #[[ATTR0]] { 275*207e5cccSFangrui Song // CHECK-NEXT: entry: 276*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[V]] to <16 x i8> 277*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> 278*207e5cccSFangrui Song // CHECK-NEXT: [[LANE:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP1]], <4 x i32> <i32 3, i32 3, i32 3, i32 3> 279*207e5cccSFangrui Song // CHECK-NEXT: [[MUL:%.*]] = fmul <4 x float> [[B]], [[LANE]] 280*207e5cccSFangrui Song // CHECK-NEXT: [[SUB:%.*]] = fsub <4 x float> [[A]], [[MUL]] 281*207e5cccSFangrui Song // CHECK-NEXT: ret <4 x float> [[SUB]] 282*207e5cccSFangrui Song // 283*207e5cccSFangrui Song float32x4_t test_vmlsq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t v) { 284*207e5cccSFangrui Song return vmlsq_laneq_f32(a, b, v, 3); 285*207e5cccSFangrui Song } 286*207e5cccSFangrui Song 287*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vfmaq_n_f64 288*207e5cccSFangrui Song // CHECK-SAME: (<2 x double> noundef [[A:%.*]], <2 x double> noundef [[B:%.*]], double noundef [[C:%.*]]) #[[ATTR0]] { 289*207e5cccSFangrui Song // CHECK-NEXT: entry: 290*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x double> poison, double [[C]], i32 0 291*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double [[C]], i32 1 292*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[A]] to <16 x i8> 293*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[B]] to <16 x i8> 294*207e5cccSFangrui Song // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <16 x i8> 295*207e5cccSFangrui Song // CHECK-NEXT: [[TMP3:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[B]], <2 x double> [[VECINIT1_I]], <2 x double> [[A]]) 296*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x double> [[TMP3]] 297*207e5cccSFangrui Song // 298*207e5cccSFangrui Song float64x2_t test_vfmaq_n_f64(float64x2_t a, float64x2_t b, float64_t c) { 299*207e5cccSFangrui Song return vfmaq_n_f64(a, b, c); 300*207e5cccSFangrui Song } 301*207e5cccSFangrui Song 302*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vfmsq_n_f64 303*207e5cccSFangrui Song // CHECK-SAME: (<2 x double> noundef [[A:%.*]], <2 x double> noundef [[B:%.*]], double noundef [[C:%.*]]) #[[ATTR0]] { 304*207e5cccSFangrui Song // CHECK-NEXT: entry: 305*207e5cccSFangrui Song // CHECK-NEXT: [[FNEG_I:%.*]] = fneg <2 x double> [[B]] 306*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x double> poison, double [[C]], i32 0 307*207e5cccSFangrui Song // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double [[C]], i32 1 308*207e5cccSFangrui Song // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[A]] to <16 x i8> 309*207e5cccSFangrui Song // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[FNEG_I]] to <16 x i8> 310*207e5cccSFangrui Song // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <16 x i8> 311*207e5cccSFangrui Song // CHECK-NEXT: [[TMP3:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[FNEG_I]], <2 x double> [[VECINIT1_I]], <2 x double> [[A]]) 312*207e5cccSFangrui Song // CHECK-NEXT: ret <2 x double> [[TMP3]] 313*207e5cccSFangrui Song // 314*207e5cccSFangrui Song float64x2_t test_vfmsq_n_f64(float64x2_t a, float64x2_t b, float64_t c) { 315*207e5cccSFangrui Song return vfmsq_n_f64(a, b, c); 316*207e5cccSFangrui Song } 317*207e5cccSFangrui Song 318