277 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc < %s | FileCheck %s3target triple = "arm64-none-linux-gnu"4 5define <4 x half> @test_vsqrt_f16(<4 x half> %a) #0 {6; CHECK-LABEL: test_vsqrt_f16:7; CHECK: // %bb.0: // %entry8; CHECK-NEXT: fsqrt v0.4h, v0.4h9; CHECK-NEXT: ret10entry:11 %vsqrt.i = call <4 x half> @llvm.experimental.constrained.sqrt.v4f16(<4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #112 ret <4 x half> %vsqrt.i13}14 15define <8 x half> @test_vsqrtq_f16(<8 x half> %a) #0 {16; CHECK-LABEL: test_vsqrtq_f16:17; CHECK: // %bb.0: // %entry18; CHECK-NEXT: fsqrt v0.8h, v0.8h19; CHECK-NEXT: ret20entry:21 %vsqrt.i = call <8 x half> @llvm.experimental.constrained.sqrt.v8f16(<8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #122 ret <8 x half> %vsqrt.i23}24 25define <4 x half> @test_vfma_f16(<4 x half> %a, <4 x half> %b, <4 x half> %c) #0 {26; CHECK-LABEL: test_vfma_f16:27; CHECK: // %bb.0: // %entry28; CHECK-NEXT: fmla v0.4h, v2.4h, v1.4h29; CHECK-NEXT: ret30entry:31 %0 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %b, <4 x half> %c, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #132 ret <4 x half> %033}34 35define <8 x half> @test_vfmaq_f16(<8 x half> %a, <8 x half> %b, <8 x half> %c) #0 {36; CHECK-LABEL: test_vfmaq_f16:37; CHECK: // %bb.0: // %entry38; CHECK-NEXT: fmla v0.8h, v2.8h, v1.8h39; CHECK-NEXT: ret40entry:41 %0 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %b, <8 x half> %c, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #142 ret <8 x half> %043}44 45define <4 x half> @test_vfms_f16(<4 x half> %a, <4 x half> %b, <4 x half> %c) #0 {46; CHECK-LABEL: test_vfms_f16:47; CHECK: // %bb.0: // %entry48; CHECK-NEXT: fmls v0.4h, v2.4h, v1.4h49; CHECK-NEXT: ret50entry:51 %fneg.i = fneg <4 x half> %b52 %0 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %fneg.i, <4 x half> %c, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #153 ret <4 x half> %054}55 56define <8 x half> @test_vfmsq_f16(<8 x half> %a, <8 x half> %b, <8 x half> %c) #0 {57; CHECK-LABEL: test_vfmsq_f16:58; CHECK: // %bb.0: // %entry59; CHECK-NEXT: fmls v0.8h, v2.8h, v1.8h60; CHECK-NEXT: ret61entry:62 %fneg.i = fneg <8 x half> %b63 %0 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %fneg.i, <8 x half> %c, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #164 ret <8 x half> %065}66 67define <4 x half> @test_vfma_lane_f16(<4 x half> %a, <4 x half> %b, <4 x half> %c) #0 {68; CHECK-LABEL: test_vfma_lane_f16:69; CHECK: // %bb.0: // %entry70; CHECK-NEXT: // kill: def $d2 killed $d2 def $q271; CHECK-NEXT: fmla v0.4h, v1.4h, v2.h[3]72; CHECK-NEXT: ret73entry:74 %lane = shufflevector <4 x half> %c, <4 x half> poison, <4 x i32> <i32 3, i32 3, i32 3, i32 3>75 %fmla2 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %b, <4 x half> %lane, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #176 ret <4 x half> %fmla277}78 79define <8 x half> @test_vfmaq_lane_f16(<8 x half> %a, <8 x half> %b, <4 x half> %c) #0 {80; CHECK-LABEL: test_vfmaq_lane_f16:81; CHECK: // %bb.0: // %entry82; CHECK-NEXT: // kill: def $d2 killed $d2 def $q283; CHECK-NEXT: fmla v0.8h, v1.8h, v2.h[3]84; CHECK-NEXT: ret85entry:86 %lane = shufflevector <4 x half> %c, <4 x half> poison, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>87 %fmla2 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %b, <8 x half> %lane, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #188 ret <8 x half> %fmla289}90 91define <4 x half> @test_vfma_laneq_f16(<4 x half> %a, <4 x half> %b, <8 x half> %c) #0 {92; CHECK-LABEL: test_vfma_laneq_f16:93; CHECK: // %bb.0: // %entry94; CHECK-NEXT: fmla v0.4h, v1.4h, v2.h[7]95; CHECK-NEXT: ret96entry:97 %lane = shufflevector <8 x half> %c, <8 x half> poison, <4 x i32> <i32 7, i32 7, i32 7, i32 7>98 %0 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %lane, <4 x half> %b, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #199 ret <4 x half> %0100}101 102define <8 x half> @test_vfmaq_laneq_f16(<8 x half> %a, <8 x half> %b, <8 x half> %c) #0 {103; CHECK-LABEL: test_vfmaq_laneq_f16:104; CHECK: // %bb.0: // %entry105; CHECK-NEXT: fmla v0.8h, v1.8h, v2.h[7]106; CHECK-NEXT: ret107entry:108 %lane = shufflevector <8 x half> %c, <8 x half> poison, <8 x i32> <i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7>109 %0 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %lane, <8 x half> %b, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1110 ret <8 x half> %0111}112 113define <4 x half> @test_vfma_n_f16(<4 x half> %a, <4 x half> %b, half %c) #0 {114; CHECK-LABEL: test_vfma_n_f16:115; CHECK: // %bb.0: // %entry116; CHECK-NEXT: // kill: def $h2 killed $h2 def $q2117; CHECK-NEXT: fmla v0.4h, v1.4h, v2.h[0]118; CHECK-NEXT: ret119entry:120 %vecinit = insertelement <4 x half> poison, half %c, i64 0121 %vecinit3 = shufflevector <4 x half> %vecinit, <4 x half> poison, <4 x i32> zeroinitializer122 %0 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %b, <4 x half> %vecinit3, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1123 ret <4 x half> %0124}125 126define <8 x half> @test_vfmaq_n_f16(<8 x half> %a, <8 x half> %b, half %c) #0 {127; CHECK-LABEL: test_vfmaq_n_f16:128; CHECK: // %bb.0: // %entry129; CHECK-NEXT: // kill: def $h2 killed $h2 def $q2130; CHECK-NEXT: fmla v0.8h, v1.8h, v2.h[0]131; CHECK-NEXT: ret132entry:133 %vecinit = insertelement <8 x half> poison, half %c, i64 0134 %vecinit7 = shufflevector <8 x half> %vecinit, <8 x half> poison, <8 x i32> zeroinitializer135 %0 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %b, <8 x half> %vecinit7, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1136 ret <8 x half> %0137}138 139define half @test_vfmah_lane_f16(half %a, half %b, <4 x half> %c) #0 {140; CHECK-LABEL: test_vfmah_lane_f16:141; CHECK: // %bb.0: // %entry142; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2143; CHECK-NEXT: fmla h0, h1, v2.h[3]144; CHECK-NEXT: ret145entry:146 %extract = extractelement <4 x half> %c, i64 3147 %0 = call half @llvm.experimental.constrained.fma.f16(half %b, half %extract, half %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1148 ret half %0149}150 151define half @test_vfmah_laneq_f16(half %a, half %b, <8 x half> %c) #0 {152; CHECK-LABEL: test_vfmah_laneq_f16:153; CHECK: // %bb.0: // %entry154; CHECK-NEXT: fmla h0, h1, v2.h[7]155; CHECK-NEXT: ret156entry:157 %extract = extractelement <8 x half> %c, i64 7158 %0 = call half @llvm.experimental.constrained.fma.f16(half %b, half %extract, half %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1159 ret half %0160}161 162define <4 x half> @test_vfms_lane_f16(<4 x half> %a, <4 x half> %b, <4 x half> %c) #0 {163; CHECK-LABEL: test_vfms_lane_f16:164; CHECK: // %bb.0: // %entry165; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2166; CHECK-NEXT: fmls v0.4h, v1.4h, v2.h[3]167; CHECK-NEXT: ret168entry:169 %fneg = fneg <4 x half> %b170 %lane = shufflevector <4 x half> %c, <4 x half> poison, <4 x i32> <i32 3, i32 3, i32 3, i32 3>171 %fmla2 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %fneg, <4 x half> %lane, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1172 ret <4 x half> %fmla2173}174 175define <8 x half> @test_vfmsq_lane_f16(<8 x half> %a, <8 x half> %b, <4 x half> %c) #0 {176; CHECK-LABEL: test_vfmsq_lane_f16:177; CHECK: // %bb.0: // %entry178; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2179; CHECK-NEXT: fmls v0.8h, v1.8h, v2.h[3]180; CHECK-NEXT: ret181entry:182 %fneg = fneg <8 x half> %b183 %lane = shufflevector <4 x half> %c, <4 x half> poison, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>184 %fmla2 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %fneg, <8 x half> %lane, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1185 ret <8 x half> %fmla2186}187 188define <4 x half> @test_vfms_laneq_f16(<4 x half> %a, <4 x half> %b, <8 x half> %c) #0 {189; CHECK-LABEL: test_vfms_laneq_f16:190; CHECK: // %bb.0: // %entry191; CHECK-NEXT: fmls v0.4h, v1.4h, v2.h[7]192; CHECK-NEXT: ret193entry:194 %fneg = fneg <4 x half> %b195 %lane = shufflevector <8 x half> %c, <8 x half> poison, <4 x i32> <i32 7, i32 7, i32 7, i32 7>196 %0 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %lane, <4 x half> %fneg, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1197 ret <4 x half> %0198}199 200define <8 x half> @test_vfmsq_laneq_f16(<8 x half> %a, <8 x half> %b, <8 x half> %c) #0 {201; CHECK-LABEL: test_vfmsq_laneq_f16:202; CHECK: // %bb.0: // %entry203; CHECK-NEXT: fmls v0.8h, v1.8h, v2.h[7]204; CHECK-NEXT: ret205entry:206 %fneg = fneg <8 x half> %b207 %lane = shufflevector <8 x half> %c, <8 x half> poison, <8 x i32> <i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7>208 %0 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %lane, <8 x half> %fneg, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1209 ret <8 x half> %0210}211 212define <4 x half> @test_vfms_n_f16(<4 x half> %a, <4 x half> %b, half %c) #0 {213; CHECK-LABEL: test_vfms_n_f16:214; CHECK: // %bb.0: // %entry215; CHECK-NEXT: // kill: def $h2 killed $h2 def $q2216; CHECK-NEXT: fmls v0.4h, v1.4h, v2.h[0]217; CHECK-NEXT: ret218entry:219 %fneg = fneg <4 x half> %b220 %vecinit = insertelement <4 x half> poison, half %c, i64 0221 %vecinit3 = shufflevector <4 x half> %vecinit, <4 x half> poison, <4 x i32> zeroinitializer222 %0 = call <4 x half> @llvm.experimental.constrained.fma.v4f16(<4 x half> %fneg, <4 x half> %vecinit3, <4 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1223 ret <4 x half> %0224}225 226define <8 x half> @test_vfmsq_n_f16(<8 x half> %a, <8 x half> %b, half %c) #0 {227; CHECK-LABEL: test_vfmsq_n_f16:228; CHECK: // %bb.0: // %entry229; CHECK-NEXT: // kill: def $h2 killed $h2 def $q2230; CHECK-NEXT: fmls v0.8h, v1.8h, v2.h[0]231; CHECK-NEXT: ret232entry:233 %fneg = fneg <8 x half> %b234 %vecinit = insertelement <8 x half> poison, half %c, i64 0235 %vecinit7 = shufflevector <8 x half> %vecinit, <8 x half> poison, <8 x i32> zeroinitializer236 %0 = call <8 x half> @llvm.experimental.constrained.fma.v8f16(<8 x half> %fneg, <8 x half> %vecinit7, <8 x half> %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1237 ret <8 x half> %0238}239 240define half @test_vfmsh_lane_f16(half %a, half %b, <4 x half> %c) #0 {241; CHECK-LABEL: test_vfmsh_lane_f16:242; CHECK: // %bb.0: // %entry243; CHECK-NEXT: fcvt s1, h1244; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2245; CHECK-NEXT: fneg s1, s1246; CHECK-NEXT: fcvt h1, s1247; CHECK-NEXT: fmla h0, h1, v2.h[3]248; CHECK-NEXT: ret249entry:250 %conv = call float @llvm.experimental.constrained.fpext.f32.f16(half %b, metadata !"fpexcept.strict") #1251 %fneg = fneg float %conv252 %0 = call half @llvm.experimental.constrained.fptrunc.f16.f32(float %fneg, metadata !"round.tonearest", metadata !"fpexcept.strict") #1253 %extract = extractelement <4 x half> %c, i64 3254 %1 = call half @llvm.experimental.constrained.fma.f16(half %0, half %extract, half %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1255 ret half %1256}257 258define half @test_vfmsh_laneq_f16(half %a, half %b, <8 x half> %c) #0 {259; CHECK-LABEL: test_vfmsh_laneq_f16:260; CHECK: // %bb.0: // %entry261; CHECK-NEXT: fcvt s1, h1262; CHECK-NEXT: fneg s1, s1263; CHECK-NEXT: fcvt h1, s1264; CHECK-NEXT: fmla h0, h1, v2.h[7]265; CHECK-NEXT: ret266entry:267 %conv = call float @llvm.experimental.constrained.fpext.f32.f16(half %b, metadata !"fpexcept.strict") #1268 %fneg = fneg float %conv269 %0 = call half @llvm.experimental.constrained.fptrunc.f16.f32(float %fneg, metadata !"round.tonearest", metadata !"fpexcept.strict") #1270 %extract = extractelement <8 x half> %c, i64 7271 %1 = call half @llvm.experimental.constrained.fma.f16(half %0, half %extract, half %a, metadata !"round.tonearest", metadata !"fpexcept.strict") #1272 ret half %1273}274 275attributes #0 = { noinline nounwind strictfp "target-features"="+crc,+fp-armv8,+fullfp16,+lse,+neon,+ras,+rdm,+v8.1a,+v8.2a,+v8a" }276attributes #1 = { strictfp }277