fpetrogalli marked an inline comment as done. fpetrogalli added inline comments.
================ Comment at: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td:426-427 + let Predicates = [HasSVE, HasBF16] in { + def : Pat<(nxv8bf16 (AArch64dup (bf16 FPR16:$src))), + (DUP_ZZI_H (INSERT_SUBREG (IMPLICIT_DEF), FPR16:$src, hsub), 0)>; + } ---------------- fpetrogalli wrote: > c-rhodes wrote: > > I think we're missing a test for this pattern in > > `llvm/test/CodeGen/AArch64/sve-vector-splat.ll`? Same applies to dup 0 > > patterns below. > I have added these patters to allow adding the regression tests in this > patch, so they are somehow guarded by the tests. I tried to add the test > cases anyway in sve-vector-splat.ll, but the following one crashes the > compiler, so the whole "splatting a bfloat constant" deserve a separate patch. > > ``` > define <vscale x 8 x bfloat> @splat_nxv8bf16_imm() #0 { > ; CHECK-LABEL: splat_nxv8bf16_imm: > ; CHECK: mov z0.h, #1.0 > ; CHECK-NEXT: ret > %1 = insertelement <vscale x 8 x bfloat> undef, bfloat 1.0, i32 0 > %2 = shufflevector <vscale x 8 x bfloat> %1, <vscale x 8 x bfloat> undef, > <vscale x 8 x i32> zeroinitializer > ret <vscale x 8 x bfloat> %2 > } > ``` > > I will create a new revision and make it a parent of this one. (facepalm) There is no "dup" instruction for bfloat immediates... that's why this is not working. I guess a separate patch is not needed, this one is enough... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82345/new/ https://reviews.llvm.org/D82345 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits