120 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s --mattr=+sve -o - | FileCheck %s3 4target triple = "aarch64"5 6; Expected to not transform7define <vscale x 4 x half> @complex_add_v4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {8; CHECK-LABEL: complex_add_v4f16:9; CHECK: // %bb.0: // %entry10; CHECK-NEXT: uzp1 z2.s, z0.s, z0.s11; CHECK-NEXT: uzp2 z0.s, z0.s, z0.s12; CHECK-NEXT: ptrue p0.d13; CHECK-NEXT: uzp2 z3.s, z1.s, z0.s14; CHECK-NEXT: uzp1 z1.s, z1.s, z0.s15; CHECK-NEXT: uunpklo z2.d, z2.s16; CHECK-NEXT: uunpklo z0.d, z0.s17; CHECK-NEXT: uunpklo z3.d, z3.s18; CHECK-NEXT: uunpklo z1.d, z1.s19; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, z1.h20; CHECK-NEXT: fadd z2.h, p0/m, z2.h, z3.h21; CHECK-NEXT: zip2 z1.d, z0.d, z2.d22; CHECK-NEXT: zip1 z0.d, z0.d, z2.d23; CHECK-NEXT: uzp1 z0.s, z0.s, z1.s24; CHECK-NEXT: ret25entry:26 %a.deinterleaved = tail call { <vscale x 2 x half>, <vscale x 2 x half> } @llvm.vector.deinterleave2.nxv4f16(<vscale x 4 x half> %a)27 %a.real = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %a.deinterleaved, 028 %a.imag = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %a.deinterleaved, 129 %b.deinterleaved = tail call { <vscale x 2 x half>, <vscale x 2 x half> } @llvm.vector.deinterleave2.nxv4f16(<vscale x 4 x half> %b)30 %b.real = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %b.deinterleaved, 031 %b.imag = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %b.deinterleaved, 132 %0 = fsub fast <vscale x 2 x half> %b.real, %a.imag33 %1 = fadd fast <vscale x 2 x half> %b.imag, %a.real34 %interleaved.vec = tail call <vscale x 4 x half> @llvm.vector.interleave2.nxv4f16(<vscale x 2 x half> %0, <vscale x 2 x half> %1)35 ret <vscale x 4 x half> %interleaved.vec36}37 38; Expected to transform39define <vscale x 8 x half> @complex_add_v8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %b) {40; CHECK-LABEL: complex_add_v8f16:41; CHECK: // %bb.0: // %entry42; CHECK-NEXT: ptrue p0.h43; CHECK-NEXT: fcadd z1.h, p0/m, z1.h, z0.h, #9044; CHECK-NEXT: mov z0.d, z1.d45; CHECK-NEXT: ret46entry:47 %a.deinterleaved = tail call { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %a)48 %a.real = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %a.deinterleaved, 049 %a.imag = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %a.deinterleaved, 150 %b.deinterleaved = tail call { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %b)51 %b.real = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %b.deinterleaved, 052 %b.imag = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %b.deinterleaved, 153 %0 = fsub fast <vscale x 4 x half> %b.real, %a.imag54 %1 = fadd fast <vscale x 4 x half> %b.imag, %a.real55 %interleaved.vec = tail call <vscale x 8 x half> @llvm.vector.interleave2.nxv8f16(<vscale x 4 x half> %0, <vscale x 4 x half> %1)56 ret <vscale x 8 x half> %interleaved.vec57}58 59; Expected to transform60define <vscale x 16 x half> @complex_add_v16f16(<vscale x 16 x half> %a, <vscale x 16 x half> %b) {61; CHECK-LABEL: complex_add_v16f16:62; CHECK: // %bb.0: // %entry63; CHECK-NEXT: ptrue p0.h64; CHECK-NEXT: fcadd z2.h, p0/m, z2.h, z0.h, #9065; CHECK-NEXT: fcadd z3.h, p0/m, z3.h, z1.h, #9066; CHECK-NEXT: mov z0.d, z2.d67; CHECK-NEXT: mov z1.d, z3.d68; CHECK-NEXT: ret69entry:70 %a.deinterleaved = tail call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.vector.deinterleave2.nxv16f16(<vscale x 16 x half> %a)71 %a.real = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %a.deinterleaved, 072 %a.imag = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %a.deinterleaved, 173 %b.deinterleaved = tail call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.vector.deinterleave2.nxv16f16(<vscale x 16 x half> %b)74 %b.real = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %b.deinterleaved, 075 %b.imag = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %b.deinterleaved, 176 %0 = fsub fast <vscale x 8 x half> %b.real, %a.imag77 %1 = fadd fast <vscale x 8 x half> %b.imag, %a.real78 %interleaved.vec = tail call <vscale x 16 x half> @llvm.vector.interleave2.nxv16f16(<vscale x 8 x half> %0, <vscale x 8 x half> %1)79 ret <vscale x 16 x half> %interleaved.vec80}81 82; Expected to transform83define <vscale x 32 x half> @complex_add_v32f16(<vscale x 32 x half> %a, <vscale x 32 x half> %b) {84; CHECK-LABEL: complex_add_v32f16:85; CHECK: // %bb.0: // %entry86; CHECK-NEXT: ptrue p0.h87; CHECK-NEXT: fcadd z4.h, p0/m, z4.h, z0.h, #9088; CHECK-NEXT: fcadd z5.h, p0/m, z5.h, z1.h, #9089; CHECK-NEXT: fcadd z6.h, p0/m, z6.h, z2.h, #9090; CHECK-NEXT: fcadd z7.h, p0/m, z7.h, z3.h, #9091; CHECK-NEXT: mov z0.d, z4.d92; CHECK-NEXT: mov z1.d, z5.d93; CHECK-NEXT: mov z2.d, z6.d94; CHECK-NEXT: mov z3.d, z7.d95; CHECK-NEXT: ret96entry:97 %a.deinterleaved = tail call { <vscale x 16 x half>, <vscale x 16 x half> } @llvm.vector.deinterleave2.nxv32f16(<vscale x 32 x half> %a)98 %a.real = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %a.deinterleaved, 099 %a.imag = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %a.deinterleaved, 1100 %b.deinterleaved = tail call { <vscale x 16 x half>, <vscale x 16 x half> } @llvm.vector.deinterleave2.nxv32f16(<vscale x 32 x half> %b)101 %b.real = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %b.deinterleaved, 0102 %b.imag = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %b.deinterleaved, 1103 %0 = fsub fast <vscale x 16 x half> %b.real, %a.imag104 %1 = fadd fast <vscale x 16 x half> %b.imag, %a.real105 %interleaved.vec = tail call <vscale x 32 x half> @llvm.vector.interleave2.nxv32f16(<vscale x 16 x half> %0, <vscale x 16 x half> %1)106 ret <vscale x 32 x half> %interleaved.vec107}108 109declare { <vscale x 2 x half>, <vscale x 2 x half> } @llvm.vector.deinterleave2.nxv4f16(<vscale x 4 x half>)110declare <vscale x 4 x half> @llvm.vector.interleave2.nxv4f16(<vscale x 2 x half>, <vscale x 2 x half>)111 112declare { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.vector.deinterleave2.nxv8f16(<vscale x 8 x half>)113declare <vscale x 8 x half> @llvm.vector.interleave2.nxv8f16(<vscale x 4 x half>, <vscale x 4 x half>)114 115declare { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.vector.deinterleave2.nxv16f16(<vscale x 16 x half>)116declare <vscale x 16 x half> @llvm.vector.interleave2.nxv16f16(<vscale x 8 x half>, <vscale x 8 x half>)117 118declare { <vscale x 16 x half>, <vscale x 16 x half> } @llvm.vector.deinterleave2.nxv32f16(<vscale x 32 x half>)119declare <vscale x 32 x half> @llvm.vector.interleave2.nxv32f16(<vscale x 16 x half>, <vscale x 16 x half>)120