From nobody Thu Apr 11 21:17:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VFsws1R4Tz5G87P; Thu, 11 Apr 2024 21:17:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VFsws0txQz3wdK; Thu, 11 Apr 2024 21:17:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712870269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ui3W140buH+wrE254mAzwprH7bi+LOKNPPh+1DF/xlE=; b=TN2iTnr6DsTY2nqc7n56ihYEIpTE0pBZRS2eU/LmNbD6ZcGOqf4vk2QeSc3i1eRHEXejEX /LoqNUfu1TVDeAathXHstBpY/DV4PIyxozQO9ZpElcZDIgOoG3vAG0BplAr1Jr6HTs2vFn pELzqx2juXuFOmN+ctMviep/VllS391qCGGtVcgi9ZHi1m1zleQy579UXmt70DpRePLf1H BHs7nj8TDmKmE+Hyu3OugxYNUwAdy8c/AYC6RuuYAxRknaHu36zxV5cha9FIgNCEIgeebw s2F8nbDNOsrUS9SZijybskk01gQI5GUn6cHFGSEqXuFzXLEiU041lD7gbanNjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712870269; a=rsa-sha256; cv=none; b=q5yvHHguRtoAIEq5IYmwVHrTfn4LrznE/G7j0KTHcJFaRhB8JGXrPjmCe0vWNqzo/EZ9Il XkT1MyAZuXMEbvJfQNX/gSpRPdw0lVSm9USobN91aU9AigiRQHz2z6NE/j2IerXi1YAo8U aCcNXc2YUa8kvVIrVaGISQujymA9+kAZb8SURDronIc3rVbWxaI0oQX0CiHbUOMYfmHnVw lCRkhpQ/IpXeZOMxLcshIT7bkTaPaVjAe/lz8FGaAr0p1wCABjUBwB9Wjh42SIpMdrJ588 RZWtcLL/97LN4ZeHr65I8z1/lPdJ9egAWPdaMIJikhhA2PjQ/c1sqR1pfol62Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712870269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ui3W140buH+wrE254mAzwprH7bi+LOKNPPh+1DF/xlE=; b=dcs+Q46J4Ofi+6Jqcn8T7hsvkFWlBySpxwU2yNV+88PKkAkNnm9tbIZbCOOFZ5STMB52Db VnwR9TYR4GwEMhZroSdASDZDb0qKY2PPHIVACD8MMx2y36gp61et83UntyNCsSw9/SP4q4 8wDd6+IF8gZ/uVLjq8DucvB6fhXBaMhblEbedFQ81COLRLzbUNxnqQZguTNhyf7DSwcZi0 OQqe+rkAX89hbjcXRAde9C2RlJLtitGTzLVOL17oHrPcgLuxggIs7i762nGb3iscu/BdfT Snrw2ZUhinc8Z2+fGV99YaWZOPchQW++mV2nhNb8IPlybj/6133hOtLp8bneug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VFsws0NsszLxC; Thu, 11 Apr 2024 21:17:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43BLHmbg044782; Thu, 11 Apr 2024 21:17:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43BLHmhP044780; Thu, 11 Apr 2024 21:17:48 GMT (envelope-from git) Date: Thu, 11 Apr 2024 21:17:48 GMT Message-Id: <202404112117.43BLHmhP044780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 78d3648e73d1 - main - Merge commit 55c466da2f2f from llvm-project (by Benjamin Kramer): List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: dev-commits-src-main+owner@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78d3648e73d11c5a4dbcc0392907f0723bf1df1c Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=78d3648e73d11c5a4dbcc0392907f0723bf1df1c commit 78d3648e73d11c5a4dbcc0392907f0723bf1df1c Author: Dimitry Andric AuthorDate: 2024-04-11 21:12:42 +0000 Commit: Dimitry Andric CommitDate: 2024-04-11 21:16:36 +0000 Merge commit 55c466da2f2f from llvm-project (by Benjamin Kramer): [X86][AVX512BF16] Add a few missing insert/extract patterns These are really the same as the f16 (and i16) instructions, but we need them for any type that can occur. Merge commit 2e4e04c59043 from llvm-project (by Phoebe Wang): [X86][BF16] Do not lower to VCVTNEPS2BF16 without AVX512VL (#86395) Fixes: #86305 These should fix "fatal error: error in backend: Cannot select: t71: v32bf16 = insert_subvector t67, t64, Constant:i32<16>" when building the misc/ncnn port. PR: 278305 Reported by: yuri MFC after: 1 month --- contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp | 7 +++++-- contrib/llvm-project/llvm/lib/Target/X86/X86InstrAVX512.td | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp index 9e64726fb6ff..96bbd981ff24 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -21420,7 +21420,9 @@ SDValue X86TargetLowering::LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const { } if (VT.getScalarType() == MVT::bf16) { - if (SVT.getScalarType() == MVT::f32 && isTypeLegal(VT)) + if (SVT.getScalarType() == MVT::f32 && + ((Subtarget.hasBF16() && Subtarget.hasVLX()) || + Subtarget.hasAVXNECONVERT())) return Op; return SDValue(); } @@ -21527,7 +21529,8 @@ SDValue X86TargetLowering::LowerFP_TO_BF16(SDValue Op, SDLoc DL(Op); MVT SVT = Op.getOperand(0).getSimpleValueType(); - if (SVT == MVT::f32 && (Subtarget.hasBF16() || Subtarget.hasAVXNECONVERT())) { + if (SVT == MVT::f32 && ((Subtarget.hasBF16() && Subtarget.hasVLX()) || + Subtarget.hasAVXNECONVERT())) { SDValue Res; Res = DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, MVT::v4f32, Op.getOperand(0)); Res = DAG.getNode(X86ISD::CVTNEPS2BF16, DL, MVT::v8bf16, Res); diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86InstrAVX512.td b/contrib/llvm-project/llvm/lib/Target/X86/X86InstrAVX512.td index bb5e22c71427..fdca58141f0f 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86InstrAVX512.td +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86InstrAVX512.td @@ -494,6 +494,8 @@ defm : vinsert_for_size_lowering<"VINSERTI32x4Z256", v16i8x_info, v32i8x_info, vinsert128_insert, INSERT_get_vinsert128_imm, [HasVLX]>; defm : vinsert_for_size_lowering<"VINSERTF32x4Z256", v8f16x_info, v16f16x_info, vinsert128_insert, INSERT_get_vinsert128_imm, [HasVLX]>; +defm : vinsert_for_size_lowering<"VINSERTF32x4Z256", v8bf16x_info, v16bf16x_info, + vinsert128_insert, INSERT_get_vinsert128_imm, [HasVLX]>; // Codegen pattern with the alternative types insert VEC128 into VEC512 defm : vinsert_for_size_lowering<"VINSERTI32x4Z", v8i16x_info, v32i16_info, vinsert128_insert, INSERT_get_vinsert128_imm, [HasAVX512]>; @@ -501,6 +503,8 @@ defm : vinsert_for_size_lowering<"VINSERTI32x4Z", v16i8x_info, v64i8_info, vinsert128_insert, INSERT_get_vinsert128_imm, [HasAVX512]>; defm : vinsert_for_size_lowering<"VINSERTF32x4Z", v8f16x_info, v32f16_info, vinsert128_insert, INSERT_get_vinsert128_imm, [HasAVX512]>; +defm : vinsert_for_size_lowering<"VINSERTF32x4Z", v8bf16x_info, v32bf16_info, + vinsert128_insert, INSERT_get_vinsert128_imm, [HasAVX512]>; // Codegen pattern with the alternative types insert VEC256 into VEC512 defm : vinsert_for_size_lowering<"VINSERTI64x4Z", v16i16x_info, v32i16_info, vinsert256_insert, INSERT_get_vinsert256_imm, [HasAVX512]>; @@ -508,6 +512,8 @@ defm : vinsert_for_size_lowering<"VINSERTI64x4Z", v32i8x_info, v64i8_info, vinsert256_insert, INSERT_get_vinsert256_imm, [HasAVX512]>; defm : vinsert_for_size_lowering<"VINSERTF64x4Z", v16f16x_info, v32f16_info, vinsert256_insert, INSERT_get_vinsert256_imm, [HasAVX512]>; +defm : vinsert_for_size_lowering<"VINSERTF64x4Z", v16bf16x_info, v32bf16_info, + vinsert256_insert, INSERT_get_vinsert256_imm, [HasAVX512]>; multiclass vinsert_for_mask_cast; defm : vextract_for_size_lowering<"VEXTRACTF32x4Z256", v16f16x_info, v8f16x_info, vextract128_extract, EXTRACT_get_vextract128_imm, [HasVLX]>; +defm : vextract_for_size_lowering<"VEXTRACTF32x4Z256", v16bf16x_info, v8bf16x_info, + vextract128_extract, EXTRACT_get_vextract128_imm, [HasVLX]>; // Codegen pattern with the alternative types extract VEC128 from VEC512 defm : vextract_for_size_lowering<"VEXTRACTI32x4Z", v32i16_info, v8i16x_info, @@ -803,6 +811,8 @@ defm : vextract_for_size_lowering<"VEXTRACTI32x4Z", v64i8_info, v16i8x_info, vextract128_extract, EXTRACT_get_vextract128_imm, [HasAVX512]>; defm : vextract_for_size_lowering<"VEXTRACTF32x4Z", v32f16_info, v8f16x_info, vextract128_extract, EXTRACT_get_vextract128_imm, [HasAVX512]>; +defm : vextract_for_size_lowering<"VEXTRACTF32x4Z", v32bf16_info, v8bf16x_info, + vextract128_extract, EXTRACT_get_vextract128_imm, [HasAVX512]>; // Codegen pattern with the alternative types extract VEC256 from VEC512 defm : vextract_for_size_lowering<"VEXTRACTI64x4Z", v32i16_info, v16i16x_info, vextract256_extract, EXTRACT_get_vextract256_imm, [HasAVX512]>; @@ -810,6 +820,8 @@ defm : vextract_for_size_lowering<"VEXTRACTI64x4Z", v64i8_info, v32i8x_info, vextract256_extract, EXTRACT_get_vextract256_imm, [HasAVX512]>; defm : vextract_for_size_lowering<"VEXTRACTF64x4Z", v32f16_info, v16f16x_info, vextract256_extract, EXTRACT_get_vextract256_imm, [HasAVX512]>; +defm : vextract_for_size_lowering<"VEXTRACTF64x4Z", v32bf16_info, v16bf16x_info, + vextract256_extract, EXTRACT_get_vextract256_imm, [HasAVX512]>; // A 128-bit extract from bits [255:128] of a 512-bit vector should use a