507 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16 -o - | FileCheck %s3 4target triple = "aarch64"5 6; Expected to transform7define <4 x float> @mul_mul(<4 x float> %a, <4 x float> %b, <4 x float> %c) {8; CHECK-LABEL: mul_mul:9; CHECK: // %bb.0: // %entry10; CHECK-NEXT: movi v4.2d, #000000000000000011; CHECK-NEXT: movi v3.2d, #000000000000000012; CHECK-NEXT: fcmla v4.4s, v1.4s, v0.4s, #013; CHECK-NEXT: fcmla v4.4s, v1.4s, v0.4s, #9014; CHECK-NEXT: fcmla v3.4s, v2.4s, v4.4s, #015; CHECK-NEXT: fcmla v3.4s, v2.4s, v4.4s, #9016; CHECK-NEXT: mov v0.16b, v3.16b17; CHECK-NEXT: ret18entry:19 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>20 %strided.vec151 = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>21 %strided.vec153 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>22 %strided.vec154 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>23 %0 = fmul fast <2 x float> %strided.vec154, %strided.vec15124 %1 = fmul fast <2 x float> %strided.vec153, %strided.vec25 %2 = fmul fast <2 x float> %strided.vec154, %strided.vec26 %3 = fmul fast <2 x float> %strided.vec153, %strided.vec15127 %4 = fadd fast <2 x float> %3, %228 %5 = fsub fast <2 x float> %1, %029 %strided.vec156 = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>30 %strided.vec157 = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>31 %6 = fmul fast <2 x float> %4, %strided.vec15632 %7 = fmul fast <2 x float> %5, %strided.vec15733 %8 = fadd fast <2 x float> %6, %734 %9 = fmul fast <2 x float> %strided.vec156, %535 %10 = fmul fast <2 x float> %4, %strided.vec15736 %11 = fsub fast <2 x float> %9, %1037 %interleaved.vec = shufflevector <2 x float> %11, <2 x float> %8, <4 x i32> <i32 0, i32 2, i32 1, i32 3>38 ret <4 x float> %interleaved.vec39}40 41; Expected to not transform42define <4 x float> @add_mul(<4 x float> %a, <4 x float> %b, <4 x float> %c) {43; CHECK-LABEL: add_mul:44; CHECK: // %bb.0: // %entry45; CHECK-NEXT: fsub v0.4s, v1.4s, v0.4s46; CHECK-NEXT: fsub v1.4s, v1.4s, v2.4s47; CHECK-NEXT: ext v3.16b, v2.16b, v2.16b, #848; CHECK-NEXT: ext v4.16b, v0.16b, v0.16b, #849; CHECK-NEXT: ext v5.16b, v1.16b, v1.16b, #850; CHECK-NEXT: zip2 v0.2s, v0.2s, v4.2s51; CHECK-NEXT: zip2 v4.2s, v2.2s, v3.2s52; CHECK-NEXT: zip1 v1.2s, v1.2s, v5.2s53; CHECK-NEXT: zip1 v2.2s, v2.2s, v3.2s54; CHECK-NEXT: fmul v5.2s, v4.2s, v0.2s55; CHECK-NEXT: fmul v3.2s, v1.2s, v4.2s56; CHECK-NEXT: fneg v4.2s, v5.2s57; CHECK-NEXT: fmla v3.2s, v0.2s, v2.2s58; CHECK-NEXT: fmla v4.2s, v1.2s, v2.2s59; CHECK-NEXT: zip1 v0.4s, v4.4s, v3.4s60; CHECK-NEXT: ret61entry:62 %0 = fsub fast <4 x float> %b, %c63 %1 = shufflevector <4 x float> %0, <4 x float> poison, <2 x i32> <i32 0, i32 2>64 %strided.vec58 = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>65 %strided.vec59 = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>66 %2 = fmul fast <2 x float> %1, %strided.vec5967 %3 = fsub fast <4 x float> %b, %a68 %4 = shufflevector <4 x float> %3, <4 x float> poison, <2 x i32> <i32 1, i32 3>69 %5 = fmul fast <2 x float> %strided.vec58, %470 %6 = fadd fast <2 x float> %5, %271 %7 = fmul fast <2 x float> %strided.vec58, %172 %8 = fmul fast <2 x float> %strided.vec59, %473 %9 = fsub fast <2 x float> %7, %874 %interleaved.vec = shufflevector <2 x float> %9, <2 x float> %6, <4 x i32> <i32 0, i32 2, i32 1, i32 3>75 ret <4 x float> %interleaved.vec76}77 78; Expected to not transform79define <4 x float> @mul_mul270_mul(<4 x float> %a, <4 x float> %b, <4 x float> %c) {80; CHECK-LABEL: mul_mul270_mul:81; CHECK: // %bb.0: // %entry82; CHECK-NEXT: ext v3.16b, v2.16b, v2.16b, #883; CHECK-NEXT: ext v4.16b, v1.16b, v1.16b, #884; CHECK-NEXT: zip1 v5.2s, v2.2s, v3.2s85; CHECK-NEXT: zip1 v6.2s, v1.2s, v4.2s86; CHECK-NEXT: zip2 v2.2s, v2.2s, v3.2s87; CHECK-NEXT: zip2 v1.2s, v1.2s, v4.2s88; CHECK-NEXT: ext v3.16b, v0.16b, v0.16b, #889; CHECK-NEXT: fmul v7.2s, v6.2s, v5.2s90; CHECK-NEXT: fneg v4.2s, v7.2s91; CHECK-NEXT: zip2 v7.2s, v0.2s, v3.2s92; CHECK-NEXT: zip1 v0.2s, v0.2s, v3.2s93; CHECK-NEXT: fmla v4.2s, v2.2s, v1.2s94; CHECK-NEXT: fmul v1.2s, v1.2s, v5.2s95; CHECK-NEXT: fmul v3.2s, v4.2s, v7.2s96; CHECK-NEXT: fmla v1.2s, v2.2s, v6.2s97; CHECK-NEXT: fmul v2.2s, v4.2s, v0.2s98; CHECK-NEXT: fneg v3.2s, v3.2s99; CHECK-NEXT: fmla v2.2s, v7.2s, v1.2s100; CHECK-NEXT: fmla v3.2s, v0.2s, v1.2s101; CHECK-NEXT: zip1 v0.4s, v3.4s, v2.4s102; CHECK-NEXT: ret103entry:104 %strided.vec = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>105 %strided.vec81 = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>106 %strided.vec83 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>107 %strided.vec84 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>108 %0 = fmul fast <2 x float> %strided.vec84, %strided.vec109 %1 = fmul fast <2 x float> %strided.vec83, %strided.vec81110 %2 = fadd fast <2 x float> %1, %0111 %strided.vec86 = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>112 %strided.vec87 = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>113 %3 = fmul fast <2 x float> %2, %strided.vec87114 %4 = fmul fast <2 x float> %strided.vec84, %strided.vec81115 %5 = fmul fast <2 x float> %strided.vec83, %strided.vec116 %6 = fsub fast <2 x float> %4, %5117 %7 = fmul fast <2 x float> %6, %strided.vec86118 %8 = fadd fast <2 x float> %3, %7119 %9 = fmul fast <2 x float> %2, %strided.vec86120 %10 = fmul fast <2 x float> %6, %strided.vec87121 %11 = fsub fast <2 x float> %9, %10122 %interleaved.vec = shufflevector <2 x float> %11, <2 x float> %8, <4 x i32> <i32 0, i32 2, i32 1, i32 3>123 ret <4 x float> %interleaved.vec124}125 126; (a * b) * a127; Expected to transform128define <4 x float> @mul_triangle(<4 x float> %a, <4 x float> %b) {129; CHECK-LABEL: mul_triangle:130; CHECK: // %bb.0: // %entry131; CHECK-NEXT: movi v3.2d, #0000000000000000132; CHECK-NEXT: movi v2.2d, #0000000000000000133; CHECK-NEXT: fcmla v3.4s, v0.4s, v1.4s, #0134; CHECK-NEXT: fcmla v3.4s, v0.4s, v1.4s, #90135; CHECK-NEXT: fcmla v2.4s, v3.4s, v0.4s, #0136; CHECK-NEXT: fcmla v2.4s, v3.4s, v0.4s, #90137; CHECK-NEXT: mov v0.16b, v2.16b138; CHECK-NEXT: ret139entry:140 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>141 %strided.vec35 = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>142 %strided.vec37 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>143 %strided.vec38 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>144 %0 = fmul fast <2 x float> %strided.vec37, %strided.vec145 %1 = fmul fast <2 x float> %strided.vec38, %strided.vec35146 %2 = fsub fast <2 x float> %0, %1147 %3 = fmul fast <2 x float> %2, %strided.vec35148 %4 = fmul fast <2 x float> %strided.vec38, %strided.vec149 %5 = fmul fast <2 x float> %strided.vec35, %strided.vec37150 %6 = fadd fast <2 x float> %4, %5151 %7 = fmul fast <2 x float> %6, %strided.vec152 %8 = fadd fast <2 x float> %3, %7153 %9 = fmul fast <2 x float> %2, %strided.vec154 %10 = fmul fast <2 x float> %6, %strided.vec35155 %11 = fsub fast <2 x float> %9, %10156 %interleaved.vec = shufflevector <2 x float> %11, <2 x float> %8, <4 x i32> <i32 0, i32 2, i32 1, i32 3>157 ret <4 x float> %interleaved.vec158}159 160 161; d * (b * a) * (c * a)162; Expected to transform163define <4 x float> @mul_diamond(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d) {164; CHECK-LABEL: mul_diamond:165; CHECK: // %bb.0: // %entry166; CHECK-NEXT: movi v4.2d, #0000000000000000167; CHECK-NEXT: movi v5.2d, #0000000000000000168; CHECK-NEXT: movi v6.2d, #0000000000000000169; CHECK-NEXT: fcmla v4.4s, v0.4s, v1.4s, #0170; CHECK-NEXT: fcmla v6.4s, v0.4s, v2.4s, #0171; CHECK-NEXT: fcmla v4.4s, v0.4s, v1.4s, #90172; CHECK-NEXT: movi v1.2d, #0000000000000000173; CHECK-NEXT: fcmla v6.4s, v0.4s, v2.4s, #90174; CHECK-NEXT: fcmla v5.4s, v3.4s, v4.4s, #0175; CHECK-NEXT: fcmla v5.4s, v3.4s, v4.4s, #90176; CHECK-NEXT: fcmla v1.4s, v5.4s, v6.4s, #0177; CHECK-NEXT: fcmla v1.4s, v5.4s, v6.4s, #90178; CHECK-NEXT: mov v0.16b, v1.16b179; CHECK-NEXT: ret180entry:181 %a.real = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>182 %a.imag = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>183 %b.real = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>184 %b.imag = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>185 %c.real = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>186 %c.imag = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>187 %d.real = shufflevector <4 x float> %d, <4 x float> poison, <2 x i32> <i32 0, i32 2>188 %d.imag = shufflevector <4 x float> %d, <4 x float> poison, <2 x i32> <i32 1, i32 3>189 %0 = fmul fast <2 x float> %a.imag, %b.real190 %1 = fmul fast <2 x float> %a.real, %b.imag191 %2 = fadd fast <2 x float> %1, %0192 %3 = fmul fast <2 x float> %a.real, %b.real193 %4 = fmul fast <2 x float> %b.imag, %a.imag194 %5 = fsub fast <2 x float> %3, %4195 %6 = fmul fast <2 x float> %d.real, %5196 %7 = fmul fast <2 x float> %2, %d.imag197 %8 = fmul fast <2 x float> %d.real, %2198 %9 = fmul fast <2 x float> %5, %d.imag199 %10 = fsub fast <2 x float> %6, %7200 %11 = fadd fast <2 x float> %8, %9201 %12 = fmul fast <2 x float> %c.real, %a.imag202 %13 = fmul fast <2 x float> %c.imag, %a.real203 %14 = fadd fast <2 x float> %13, %12204 %15 = fmul fast <2 x float> %14, %10205 %16 = fmul fast <2 x float> %c.real, %a.real206 %17 = fmul fast <2 x float> %c.imag, %a.imag207 %18 = fsub fast <2 x float> %16, %17208 %19 = fmul fast <2 x float> %18, %11209 %20 = fadd fast <2 x float> %15, %19210 %21 = fmul fast <2 x float> %18, %10211 %22 = fmul fast <2 x float> %14, %11212 %23 = fsub fast <2 x float> %21, %22213 %interleaved.vec = shufflevector <2 x float> %23, <2 x float> %20, <4 x i32> <i32 0, i32 2, i32 1, i32 3>214 ret <4 x float> %interleaved.vec215}216 217; Expected to transform218define <4 x float> @mul_add90_mul(<4 x float> %a, <4 x float> %b, <4 x float> %c) {219; CHECK-LABEL: mul_add90_mul:220; CHECK: // %bb.0: // %entry221; CHECK-NEXT: movi v3.2d, #0000000000000000222; CHECK-NEXT: movi v4.2d, #0000000000000000223; CHECK-NEXT: fcmla v4.4s, v0.4s, v2.4s, #0224; CHECK-NEXT: fcmla v3.4s, v0.4s, v1.4s, #0225; CHECK-NEXT: fcmla v4.4s, v0.4s, v2.4s, #90226; CHECK-NEXT: fcmla v3.4s, v0.4s, v1.4s, #90227; CHECK-NEXT: fcadd v0.4s, v4.4s, v3.4s, #90228; CHECK-NEXT: ret229entry:230 %ar = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>231 %ai = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>232 %br = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>233 %bi = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>234 %cr = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>235 %ci = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>236 237 %i6 = fmul fast <2 x float> %br, %ar238 %i7 = fmul fast <2 x float> %bi, %ai239 %xr = fsub fast <2 x float> %i6, %i7240 %i9 = fmul fast <2 x float> %bi, %ar241 %i10 = fmul fast <2 x float> %br, %ai242 %xi = fadd fast <2 x float> %i9, %i10243 244 %j6 = fmul fast <2 x float> %cr, %ar245 %j7 = fmul fast <2 x float> %ci, %ai246 %yr = fsub fast <2 x float> %j6, %j7247 %j9 = fmul fast <2 x float> %ci, %ar248 %j10 = fmul fast <2 x float> %cr, %ai249 %yi = fadd fast <2 x float> %j9, %j10250 251 %zr = fsub fast <2 x float> %yr, %xi252 %zi = fadd fast <2 x float> %yi, %xr253 %interleaved.vec = shufflevector <2 x float> %zr, <2 x float> %zi, <4 x i32> <i32 0, i32 2, i32 1, i32 3>254 ret <4 x float> %interleaved.vec255}256 257; Expected to not transform258define <4 x float> @mul_triangle_addmul(<4 x float> %a, <4 x float> %b, <4 x float> %c) {259; CHECK-LABEL: mul_triangle_addmul:260; CHECK: // %bb.0: // %entry261; CHECK-NEXT: ext v3.16b, v0.16b, v0.16b, #8262; CHECK-NEXT: ext v4.16b, v1.16b, v1.16b, #8263; CHECK-NEXT: zip1 v5.2s, v0.2s, v3.2s264; CHECK-NEXT: zip1 v6.2s, v1.2s, v4.2s265; CHECK-NEXT: zip2 v1.2s, v1.2s, v4.2s266; CHECK-NEXT: ext v4.16b, v2.16b, v2.16b, #8267; CHECK-NEXT: zip2 v0.2s, v0.2s, v3.2s268; CHECK-NEXT: fmul v7.2s, v6.2s, v5.2s269; CHECK-NEXT: fmul v5.2s, v1.2s, v5.2s270; CHECK-NEXT: zip1 v3.2s, v2.2s, v4.2s271; CHECK-NEXT: zip2 v2.2s, v2.2s, v4.2s272; CHECK-NEXT: fmov d4, d7273; CHECK-NEXT: fmov d16, d5274; CHECK-NEXT: fmls v7.2s, v0.2s, v2.2s275; CHECK-NEXT: fmla v5.2s, v0.2s, v3.2s276; CHECK-NEXT: fmls v4.2s, v0.2s, v1.2s277; CHECK-NEXT: fmla v16.2s, v0.2s, v6.2s278; CHECK-NEXT: fsub v0.2s, v7.2s, v16.2s279; CHECK-NEXT: fadd v1.2s, v5.2s, v4.2s280; CHECK-NEXT: zip1 v0.4s, v0.4s, v1.4s281; CHECK-NEXT: ret282entry:283 %ar = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>284 %ai = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>285 %br = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>286 %bi = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>287 %cr = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>288 %ci = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>289 290 %i6 = fmul fast <2 x float> %br, %ar291 %i7 = fmul fast <2 x float> %bi, %ai292 %xr = fsub fast <2 x float> %i6, %i7293 %i9 = fmul fast <2 x float> %bi, %ar294 %i10 = fmul fast <2 x float> %br, %ai295 %xi = fadd fast <2 x float> %i9, %i10296 297 ;%j6 = fmul fast <2 x float> %cr, %ar298 %j7 = fmul fast <2 x float> %ci, %ai299 %yr = fsub fast <2 x float> %i6, %j7300 ;%j9 = fmul fast <2 x float> %ci, %ar301 %j10 = fmul fast <2 x float> %cr, %ai302 %yi = fadd fast <2 x float> %i9, %j10303 304 %zr = fsub fast <2 x float> %yr, %xi305 %zi = fadd fast <2 x float> %yi, %xr306 %interleaved.vec = shufflevector <2 x float> %zr, <2 x float> %zi, <4 x i32> <i32 0, i32 2, i32 1, i32 3>307 ret <4 x float> %interleaved.vec308}309 310; Expected to not transform311define <4 x float> @mul_triangle_multiuses(<4 x float> %a, <4 x float> %b, ptr %p) {312; CHECK-LABEL: mul_triangle_multiuses:313; CHECK: // %bb.0: // %entry314; CHECK-NEXT: ext v2.16b, v0.16b, v0.16b, #8315; CHECK-NEXT: ext v3.16b, v1.16b, v1.16b, #8316; CHECK-NEXT: zip2 v4.2s, v0.2s, v2.2s317; CHECK-NEXT: zip1 v5.2s, v1.2s, v3.2s318; CHECK-NEXT: zip1 v0.2s, v0.2s, v2.2s319; CHECK-NEXT: zip2 v1.2s, v1.2s, v3.2s320; CHECK-NEXT: fmul v2.2s, v4.2s, v5.2s321; CHECK-NEXT: fmul v3.2s, v1.2s, v4.2s322; CHECK-NEXT: fmla v2.2s, v0.2s, v1.2s323; CHECK-NEXT: fneg v1.2s, v3.2s324; CHECK-NEXT: fmul v3.2s, v2.2s, v4.2s325; CHECK-NEXT: fmla v1.2s, v0.2s, v5.2s326; CHECK-NEXT: fmul v5.2s, v2.2s, v0.2s327; CHECK-NEXT: fneg v3.2s, v3.2s328; CHECK-NEXT: fmla v5.2s, v4.2s, v1.2s329; CHECK-NEXT: fmla v3.2s, v0.2s, v1.2s330; CHECK-NEXT: mov v1.d[1], v2.d[0]331; CHECK-NEXT: zip1 v0.4s, v3.4s, v5.4s332; CHECK-NEXT: str q1, [x0]333; CHECK-NEXT: ret334entry:335 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>336 %strided.vec35 = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>337 %strided.vec37 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>338 %strided.vec38 = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>339 %0 = fmul fast <2 x float> %strided.vec37, %strided.vec340 %1 = fmul fast <2 x float> %strided.vec38, %strided.vec35341 %2 = fsub fast <2 x float> %0, %1342 %3 = fmul fast <2 x float> %2, %strided.vec35343 %4 = fmul fast <2 x float> %strided.vec38, %strided.vec344 %5 = fmul fast <2 x float> %strided.vec35, %strided.vec37345 %6 = fadd fast <2 x float> %4, %5346 %otheruse = shufflevector <2 x float> %2, <2 x float> %6, <4 x i32> <i32 0, i32 1, i32 2, i32 3>347 store <4 x float> %otheruse, ptr %p348 %7 = fmul fast <2 x float> %6, %strided.vec349 %8 = fadd fast <2 x float> %3, %7350 %9 = fmul fast <2 x float> %2, %strided.vec351 %10 = fmul fast <2 x float> %6, %strided.vec35352 %11 = fsub fast <2 x float> %9, %10353 %interleaved.vec = shufflevector <2 x float> %11, <2 x float> %8, <4 x i32> <i32 0, i32 2, i32 1, i32 3>354 ret <4 x float> %interleaved.vec355}356 357; Expected to transform358define <4 x float> @mul_addequal(<4 x float> %a, <4 x float> %b, <4 x float> %c) {359; CHECK-LABEL: mul_addequal:360; CHECK: // %bb.0: // %entry361; CHECK-NEXT: fcmla v2.4s, v1.4s, v0.4s, #0362; CHECK-NEXT: fcmla v2.4s, v1.4s, v0.4s, #90363; CHECK-NEXT: mov v0.16b, v2.16b364; CHECK-NEXT: ret365entry:366 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>367 %a.imag = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>368 %b.real = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>369 %b.imag = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>370 %0 = fmul fast <2 x float> %b.imag, %strided.vec371 %1 = fmul fast <2 x float> %b.real, %a.imag372 %2 = fadd fast <2 x float> %1, %0373 %3 = fmul fast <2 x float> %b.real, %strided.vec374 %4 = fmul fast <2 x float> %a.imag, %b.imag375 %5 = fsub fast <2 x float> %3, %4376 %c.real = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>377 %c.imag = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>378 %6 = fadd fast <2 x float> %5, %c.real379 %7 = fadd fast <2 x float> %2, %c.imag380 %interleaved.vec = shufflevector <2 x float> %6, <2 x float> %7, <4 x i32> <i32 0, i32 2, i32 1, i32 3>381 ret <4 x float> %interleaved.vec382}383 384; Expected to transform385define <4 x float> @mul_subequal(<4 x float> %a, <4 x float> %b, <4 x float> %c) {386; CHECK-LABEL: mul_subequal:387; CHECK: // %bb.0: // %entry388; CHECK-NEXT: movi v3.2d, #0000000000000000389; CHECK-NEXT: fcmla v3.4s, v1.4s, v0.4s, #0390; CHECK-NEXT: fcmla v3.4s, v1.4s, v0.4s, #90391; CHECK-NEXT: fsub v0.4s, v3.4s, v2.4s392; CHECK-NEXT: ret393entry:394 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>395 %a.imag = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>396 %b.real = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>397 %b.imag = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>398 %0 = fmul fast <2 x float> %b.imag, %strided.vec399 %1 = fmul fast <2 x float> %b.real, %a.imag400 %2 = fadd fast <2 x float> %1, %0401 %3 = fmul fast <2 x float> %b.real, %strided.vec402 %4 = fmul fast <2 x float> %a.imag, %b.imag403 %5 = fsub fast <2 x float> %3, %4404 %c.real = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>405 %c.imag = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>406 %6 = fsub fast <2 x float> %5, %c.real407 %7 = fsub fast <2 x float> %2, %c.imag408 %interleaved.vec = shufflevector <2 x float> %6, <2 x float> %7, <4 x i32> <i32 0, i32 2, i32 1, i32 3>409 ret <4 x float> %interleaved.vec410}411 412 413; Expected to transform414define <4 x float> @mul_mulequal(<4 x float> %a, <4 x float> %b, <4 x float> %c) {415; CHECK-LABEL: mul_mulequal:416; CHECK: // %bb.0: // %entry417; CHECK-NEXT: movi v3.2d, #0000000000000000418; CHECK-NEXT: fcmla v3.4s, v1.4s, v0.4s, #0419; CHECK-NEXT: fcmla v3.4s, v1.4s, v0.4s, #90420; CHECK-NEXT: fmul v0.4s, v3.4s, v2.4s421; CHECK-NEXT: ret422entry:423 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>424 %a.imag = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>425 %b.real = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>426 %b.imag = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>427 %0 = fmul fast <2 x float> %b.imag, %strided.vec428 %1 = fmul fast <2 x float> %b.real, %a.imag429 %2 = fadd fast <2 x float> %1, %0430 %3 = fmul fast <2 x float> %b.real, %strided.vec431 %4 = fmul fast <2 x float> %a.imag, %b.imag432 %5 = fsub fast <2 x float> %3, %4433 %c.real = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>434 %c.imag = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>435 %6 = fmul fast <2 x float> %5, %c.real436 %7 = fmul fast <2 x float> %2, %c.imag437 %interleaved.vec = shufflevector <2 x float> %6, <2 x float> %7, <4 x i32> <i32 0, i32 2, i32 1, i32 3>438 ret <4 x float> %interleaved.vec439}440 441; Expected to not transform442define <4 x float> @mul_divequal(<4 x float> %a, <4 x float> %b, <4 x float> %c) {443; CHECK-LABEL: mul_divequal:444; CHECK: // %bb.0: // %entry445; CHECK-NEXT: ext v3.16b, v0.16b, v0.16b, #8446; CHECK-NEXT: ext v4.16b, v1.16b, v1.16b, #8447; CHECK-NEXT: zip2 v5.2s, v0.2s, v3.2s448; CHECK-NEXT: zip2 v6.2s, v1.2s, v4.2s449; CHECK-NEXT: zip1 v0.2s, v0.2s, v3.2s450; CHECK-NEXT: zip1 v1.2s, v1.2s, v4.2s451; CHECK-NEXT: ext v3.16b, v2.16b, v2.16b, #8452; CHECK-NEXT: fmul v7.2s, v5.2s, v6.2s453; CHECK-NEXT: fneg v4.2s, v7.2s454; CHECK-NEXT: zip1 v7.2s, v2.2s, v3.2s455; CHECK-NEXT: zip2 v2.2s, v2.2s, v3.2s456; CHECK-NEXT: fmla v4.2s, v0.2s, v1.2s457; CHECK-NEXT: fmul v0.2s, v6.2s, v0.2s458; CHECK-NEXT: fmla v0.2s, v5.2s, v1.2s459; CHECK-NEXT: fdiv v4.2s, v4.2s, v7.2s460; CHECK-NEXT: fdiv v0.2s, v0.2s, v2.2s461; CHECK-NEXT: zip1 v0.4s, v4.4s, v0.4s462; CHECK-NEXT: ret463entry:464 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>465 %a.imag = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>466 %b.real = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>467 %b.imag = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>468 %0 = fmul fast <2 x float> %b.imag, %strided.vec469 %1 = fmul fast <2 x float> %b.real, %a.imag470 %2 = fadd fast <2 x float> %1, %0471 %3 = fmul fast <2 x float> %b.real, %strided.vec472 %4 = fmul fast <2 x float> %a.imag, %b.imag473 %5 = fsub fast <2 x float> %3, %4474 %c.real = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 0, i32 2>475 %c.imag = shufflevector <4 x float> %c, <4 x float> poison, <2 x i32> <i32 1, i32 3>476 %6 = fdiv fast <2 x float> %5, %c.real477 %7 = fdiv fast <2 x float> %2, %c.imag478 %interleaved.vec = shufflevector <2 x float> %6, <2 x float> %7, <4 x i32> <i32 0, i32 2, i32 1, i32 3>479 ret <4 x float> %interleaved.vec480}481 482; Expected to transform483define <4 x float> @mul_negequal(<4 x float> %a, <4 x float> %b) {484; CHECK-LABEL: mul_negequal:485; CHECK: // %bb.0: // %entry486; CHECK-NEXT: movi v2.2d, #0000000000000000487; CHECK-NEXT: fcmla v2.4s, v1.4s, v0.4s, #180488; CHECK-NEXT: fcmla v2.4s, v1.4s, v0.4s, #270489; CHECK-NEXT: mov v0.16b, v2.16b490; CHECK-NEXT: ret491entry:492 %strided.vec = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 0, i32 2>493 %a.imag = shufflevector <4 x float> %a, <4 x float> poison, <2 x i32> <i32 1, i32 3>494 %b.real = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 0, i32 2>495 %b.imag = shufflevector <4 x float> %b, <4 x float> poison, <2 x i32> <i32 1, i32 3>496 %0 = fmul fast <2 x float> %b.imag, %strided.vec497 %1 = fmul fast <2 x float> %b.real, %a.imag498 %2 = fadd fast <2 x float> %1, %0499 %3 = fmul fast <2 x float> %b.real, %strided.vec500 %4 = fmul fast <2 x float> %a.imag, %b.imag501 %5 = fsub fast <2 x float> %3, %4502 %6 = fneg fast <2 x float> %5503 %7 = fneg fast <2 x float> %2504 %interleaved.vec = shufflevector <2 x float> %6, <2 x float> %7, <4 x i32> <i32 0, i32 2, i32 1, i32 3>505 ret <4 x float> %interleaved.vec506}507