Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2234425/?format=api
{ "id": 2234425, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234425/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260507160959.449170-8-richard.henderson@linaro.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260507160959.449170-8-richard.henderson@linaro.org>", "list_archive_url": null, "date": "2026-05-07T16:09:55", "name": "[v3,07/11] target/arm: Use FloatParts64 in bfdotadd_ebf", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "97c0916cb49fbe369da50745c1c6cf240b4cb276", "submitter": { "id": 72104, "url": "http://patchwork.ozlabs.org/api/1.2/people/72104/?format=api", "name": "Richard Henderson", "email": "richard.henderson@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260507160959.449170-8-richard.henderson@linaro.org/mbox/", "series": [ { "id": 503213, "url": "http://patchwork.ozlabs.org/api/1.2/series/503213/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=503213", "date": "2026-05-07T16:09:49", "name": "fpu: Export some internals for targets", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/503213/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2234425/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2234425/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=XPHKj26G;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBHMG5lY7z1yM5\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 02:12:10 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wL1JN-0002jO-QX; Thu, 07 May 2026 12:10:53 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1wL1Ii-0001nC-BI\n for qemu-devel@nongnu.org; Thu, 07 May 2026 12:10:16 -0400", "from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1wL1Ig-00088Z-A8\n for qemu-devel@nongnu.org; Thu, 07 May 2026 12:10:12 -0400", "by mail-ot1-x332.google.com with SMTP id\n 46e09a7af769-7d4be94eeacso1098922a34.2\n for <qemu-devel@nongnu.org>; Thu, 07 May 2026 09:10:09 -0700 (PDT)", "from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c])\n by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7e302462fb1sm16415a34.11.2026.05.07.09.10.08\n for <qemu-devel@nongnu.org>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 07 May 2026 09:10:08 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1778170209; x=1778775009; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n :reply-to; bh=Pu3TZxm2iTRUBoR9MHlryIG9+4ZyXp6ZsL5bLZgQwto=;\n b=XPHKj26G0JkTzVy94fTDonGduw+79dNMa2hehHLaoCpaXHEZmjctIok8AsHmXdogrb\n +O8IWplsw/a836ua72vp8EUy7z/+meBy2st3RoPnX6AFBZPAIBEKyviKafw9e6RvJspe\n L6JPS2fRX70Z/UVH1bRRiPLYEpvTHe5IW+XV39W6JQlpluMufCYZHTMGgYpRMhIJ/8eB\n 2Oum0AfWxmVv50eQ4P2Vp6JdJxYCDzHHwqs8w6eE+kchI0IWk0juKfJ9C40g11kx1vAw\n rClY1/QmMe9EC+WwEY0mGKkik/TU+p4Mz3nSzPyuJr1Hg8Ujpx9gzWTzVQgFbTJVCGDP\n Rosg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778170209; x=1778775009;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=Pu3TZxm2iTRUBoR9MHlryIG9+4ZyXp6ZsL5bLZgQwto=;\n b=php8frzNAgpawhuX5G1TJngUf7VpLcRIxC689qVgj/XklMkDYfLhErdgmAuVMgDHn7\n C9YCPV9xgrdSyXPJ0t5k0qGzgG/JFdqQnMQRz58p2H3LDe58A+0mKurkOsK1ri74q5Gx\n ZVg074rq2IKPhlFUP+8C3o3SdcLZM+IDEb0AxblEHyCb+LbexYQ1nit0XVLnH4dw4YdI\n FsrNxmOuS5O1qt6PE1FmwUxu0GArN2nsEqQCX2UEsOaW0cSTbmZThwdREung26g+Tfhg\n tvNFcWRF1UZijl+QBoo9uTTRrV2RucKuf44uXJYCn5WbV1pDg6aV8/nT0rOLKnChJHnJ\n suoA==", "X-Gm-Message-State": "AOJu0YxMc/IpZnoGd62LldOhIn1FuddUlviqOGRMdhpBFwM59qafqE0+\n /jhe9HLj9YA+S7qR0NCqrbX+N3kCQqEfrwuxWbC1HfJDBu76GCshExkc4x1QwS+x8G6VwaQpUUS\n IJOWv", "X-Gm-Gg": "AeBDiesOPR2s4hC5qDPuuRoa21gndrN9Lm3m0ER2MvHklgyAhl2DRt+rOBlBvHJH/r4\n YMCrFl74Op4qsvQw/Uzz3ZiVDlivIPOSttcnEvmhHhX0gNTuqMmMrBcecJ+20L5ilWA67Y5GrX1\n VM1qf1fj/tTJdRfVA0s84Fn6yAWZ0NZyYgATLQowDNGKU13YJx56kkNJpIIxXAaNzy7vfoJCoyS\n Qld8Im97gPgTP6k1jSIQDIbbmYHGZU7UentWLp471HR6C5l+z/yznKRJ/xZjsQZPGblCkt+93sc\n d4Q7SqUq0bBszwDbxhNKwv4eEs4R0EOsaO72JvBsCkdfAt3pS5k/EnVYNpo4eNSzXP57bcEbP2o\n 6duNTHegFzAI8JFZePRc72lsEk68GJ1eOWbbM9mnAkTxik/VoPerTp49M7bF7uuPccwV6RYhJpD\n lNajnFh3PunqOPqJZ+S41+AQYKMFoBAyUedgrlC96fVFpvhw==", "X-Received": "by 2002:a05:6830:b95:b0:7de:d056:19d with SMTP id\n 46e09a7af769-7e1dea1fffemr5393173a34.0.1778170209039;\n Thu, 07 May 2026 09:10:09 -0700 (PDT)", "From": "Richard Henderson <richard.henderson@linaro.org>", "To": "qemu-devel@nongnu.org", "Subject": "[PATCH v3 07/11] target/arm: Use FloatParts64 in bfdotadd_ebf", "Date": "Thu, 7 May 2026 11:09:55 -0500", "Message-ID": "<20260507160959.449170-8-richard.henderson@linaro.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260507160959.449170-1-richard.henderson@linaro.org>", "References": "<20260507160959.449170-1-richard.henderson@linaro.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2607:f8b0:4864:20::332;\n envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x332.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Use softfloat-parts.h so that we can more naturally\nperform the required operations witha single rounding step.\nThis happens to also simplify the NaN detection step.\n\nSigned-off-by: Richard Henderson <richard.henderson@linaro.org>\n---\n target/arm/tcg/vec_helper.c | 77 +++++++++++++++++++------------------\n 1 file changed, 40 insertions(+), 37 deletions(-)", "diff": "diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c\nindex 91e98d28ae..85bcaac3d1 100644\n--- a/target/arm/tcg/vec_helper.c\n+++ b/target/arm/tcg/vec_helper.c\n@@ -22,6 +22,7 @@\n #include \"helper.h\"\n #include \"tcg/tcg-gvec-desc.h\"\n #include \"fpu/softfloat.h\"\n+#include \"fpu/softfloat-parts.h\"\n #include \"qemu/int128.h\"\n #include \"crypto/clmul.h\"\n #include \"vec_internal.h\"\n@@ -2895,61 +2896,63 @@ float32 bfdotadd(float32 sum, uint32_t e1, uint32_t e2, float_status *fpst)\n float32 bfdotadd_ebf(float32 sum, uint32_t e1, uint32_t e2,\n float_status *fpst, float_status *fpst_odd)\n {\n+ /* Unpack two BFloat16 into two Float32, trivially. */\n float32 s1r = e1 << 16;\n float32 s1c = e1 & 0xffff0000u;\n float32 s2r = e2 << 16;\n float32 s2c = e2 & 0xffff0000u;\n float32 t32;\n \n+ /*\n+ * Compare f16_dotadd() in sme_helper.c, but here we have\n+ * bfloat16 inputs. In particular that means that we do not\n+ * want the FPCR.FZ16 flush semantics, so we use the normal\n+ * float_status for the input handling here.\n+ */\n+ FloatParts64 p1r = float32_unpack_canonical(s1r, fpst);\n+ FloatParts64 p1c = float32_unpack_canonical(s1c, fpst);\n+ FloatParts64 p2r = float32_unpack_canonical(s2r, fpst);\n+ FloatParts64 p2c = float32_unpack_canonical(s2c, fpst);\n+\n+ int all_mask = (float_cmask(p1r.cls) | float_cmask(p1c.cls) |\n+ float_cmask(p1r.cls) | float_cmask(p1c.cls));\n+\n /* C.f. FPProcessNaNs4 */\n- if (float32_is_any_nan(s1r) || float32_is_any_nan(s1c) ||\n- float32_is_any_nan(s2r) || float32_is_any_nan(s2c)) {\n- if (float32_is_signaling_nan(s1r, fpst)) {\n- t32 = s1r;\n- } else if (float32_is_signaling_nan(s1c, fpst)) {\n- t32 = s1c;\n- } else if (float32_is_signaling_nan(s2r, fpst)) {\n- t32 = s2r;\n- } else if (float32_is_signaling_nan(s2c, fpst)) {\n- t32 = s2c;\n- } else if (float32_is_any_nan(s1r)) {\n- t32 = s1r;\n- } else if (float32_is_any_nan(s1c)) {\n- t32 = s1c;\n- } else if (float32_is_any_nan(s2r)) {\n- t32 = s2r;\n+ if (unlikely(all_mask & float_cmask_anynan)) {\n+ if (unlikely(all_mask & float_cmask_snan)) {\n+ if (p1r.cls == float_class_snan) {\n+ t32 = s1r;\n+ } else if (p1c.cls == float_class_snan) {\n+ t32 = s1c;\n+ } else if (p2r.cls == float_class_snan) {\n+ t32 = s2r;\n+ } else {\n+ t32 = s2c;\n+ }\n } else {\n- t32 = s2c;\n+ if (p1r.cls == float_class_qnan) {\n+ t32 = s1r;\n+ } else if (p1c.cls == float_class_qnan) {\n+ t32 = s1c;\n+ } else if (p2r.cls == float_class_qnan) {\n+ t32 = s2r;\n+ } else {\n+ t32 = s2c;\n+ }\n }\n /*\n * FPConvertNaN(FPProcessNaN(t32)) will be done as part\n * of the final addition below.\n */\n } else {\n- /*\n- * Compare f16_dotadd() in sme_helper.c, but here we have\n- * bfloat16 inputs. In particular that means that we do not\n- * want the FPCR.FZ16 flush semantics, so we use the normal\n- * float_status for the input handling here.\n- */\n- float64 e1r = float32_to_float64(s1r, fpst);\n- float64 e1c = float32_to_float64(s1c, fpst);\n- float64 e2r = float32_to_float64(s2r, fpst);\n- float64 e2c = float32_to_float64(s2c, fpst);\n- float64 t64;\n-\n /*\n * The ARM pseudocode function FPDot performs both multiplies\n- * and the add with a single rounding operation. Emulate this\n- * by performing the first multiply in round-to-odd, then doing\n- * the second multiply as fused multiply-add, and rounding to\n- * float32 all in one step.\n+ * and the add with a single rounding operation.\n */\n- t64 = float64_mul(e1r, e2r, fpst_odd);\n- t64 = float64r32_muladd(e1c, e2c, t64, 0, fpst);\n+ FloatParts64 tmp = parts64_mul(&p1r, &p2r, fpst);\n+ tmp = parts64_muladd(&p1c, &p2c, &tmp, 0, fpst);\n \n- /* This conversion is exact, because we've already rounded. */\n- t32 = float64_to_float32(t64, fpst);\n+ t32 = float32_round_pack_canonical(&tmp, fpst);\n }\n \n /* The final accumulation step is not fused. */\n", "prefixes": [ "v3", "07/11" ] }