From patchwork Tue Dec 3 20:39:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 846975 Delivered-To: patch@linaro.org Received: by 2002:a5d:44cd:0:b0:385:e875:8a9e with SMTP id z13csp714970wrr; Tue, 3 Dec 2024 12:40:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWFJk1QKFjKdkiaOcUT14QkfBd6w7wiVqPsivPVmjpysIdQ+XTz3kb9YvPcz6Fl4P2KvlgDdg==@linaro.org X-Google-Smtp-Source: AGHT+IFhBLqFDeRu4sg4ObAsB6C/w0g9Ua0zW+PXmcQ+Ncx9CwSpKYEtND0UuGx3gtC5CLBWi1Z0 X-Received: by 2002:a05:6214:5186:b0:6d8:8416:9c54 with SMTP id 6a1803df08f44-6d8b7366b8dmr65936006d6.16.1733258454780; Tue, 03 Dec 2024 12:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733258454; cv=none; d=google.com; s=arc-20240605; b=LEHDZeC+8u7B6Mno1aRGogYZBTCudwMiYEki1h7KGitcBAW451MEx48PToFpjhTgS/ hOyYEP/A5Y0Gp+hUFCK1hmLny2TT4ZQCTuhGWlEe8aaHBsYZUxcL1LpaT7RE2XiSmkJ/ xWmlU3jcZimrGqoA3ve/YZRuhhSohnzXPsNo05TeIpw0+NmfFZEAEcoGrGUzqcWRvNF2 2aTnT1gDbvB6HAzKIaeLTtWVQZfCVfQ+atxaNnOlfJtTguiws76EdTuXbsjz8l+2TOSy Pvd591IAxH2WCxT5s0awvsjc/TT0EW3E8GYodvAQ3m9WYPvcTK4IQDko6KMUYNUh++oN ERLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YMdz/R/XzxtV9sRyJPrRUrTNoKD74mGu1MDMytu4Vg0=; fh=UQCixiNfr28ZOrfhmxiGPA65dFhly8CmRsnoYC6xI9k=; b=HruesLlmydah36o5yycRAoiMSNdzmi1A93pexpY4/OTsesz5AgyzZjxA1OyANJ8mLH PxYy5lPp1LTmveYjsx63VqI3ky+hHlndyBcBjBbVD836y874ipDcDG/Ov5m/k5XYZ+BU aqDLRPvjEw2o7/ZYAWA44uHXzAOshGznJ+uuFSqzFdh1fJmJpvTI6id5IiXUIWGRn+9I dEmMyv38A6VEkrjU9BRZ6bHvKNi0NnQgGx9bFgcOBZWjaEK+LJ9udexPxh49GxxzVSCv yz2uybT4ArqgOyaNBLaia82JLxFcfLf1pD550IWDr6yA86aieFgJeDVM9XaX3D0LiPMv /kyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TTiIIk6N; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d8890a67fcsi111275736d6.379.2024.12.03.12.40.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Dec 2024 12:40:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TTiIIk6N; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIZgi-0001QM-6t; Tue, 03 Dec 2024 15:40:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIZga-0001KX-1c for qemu-devel@nongnu.org; Tue, 03 Dec 2024 15:39:56 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIZgX-0003AR-GI for qemu-devel@nongnu.org; Tue, 03 Dec 2024 15:39:54 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3ead60cedb7so1477411b6e.1 for ; Tue, 03 Dec 2024 12:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733258392; x=1733863192; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YMdz/R/XzxtV9sRyJPrRUrTNoKD74mGu1MDMytu4Vg0=; b=TTiIIk6NaGfk3LhEM/KLPoJQXiWM5kDXTRN650gvoqBggpK8Qk+oUu1hyIz9lE2E9C xK2G+aJLKjKoLhBrziUZ/51eR5pUuNlA2JsQPp1HcnpWHFCRXUKCRySXr3C7GsWICXuM 81Nx5JIkD4uFhyBP4hFCqhAhU9opK88Q72dr/onvcZWgTPHqGt48YY1vz9AIw8jRH0Gm E2OHdy80yCeTJJp+TFnIivsd6WUL1vuhj51uXuIWSNtJn5E3K10pwbInro7vaCddolER zfTVLkAi+ULPWPSAHv5cMGsUeV0+h32tKIdid5Y5I2TPAQssmrDKWDNHW9IcQSuaJklf yTIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733258392; x=1733863192; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YMdz/R/XzxtV9sRyJPrRUrTNoKD74mGu1MDMytu4Vg0=; b=bkhQ0WZsON8uB3XCcdY7NQWpPMj7GLkZAXhc4HNCJESQWzAcdrol4Eglezywx13QWJ +aeC/knCBKnvZBFlQYLgXAlQBBxmeLHpAh8qbIooOMamSDOtZ5EbomEuDB1pjFm5ZaMO ZdC6LOER8uvSxMm8hr3KUpaM+Me2Mt1dkctqt4e/uECBX4qu2RjnBs53m4ic6eX+PtpP Kf/QLHZ0XcFfh817l/CunsD8+ZvB6VH66HIcbOXAdIBIfGL30s5u1MIaTZ/Pr/eifa+W tBDRT7ORMs66cgbXAgY9qUaxm6NRZlVmo0wehxYPjCanzZiPj0HqCXCth716syVZZ0pK v7BA== X-Gm-Message-State: AOJu0YyiGe36MYNIsQgWEZWYk/yxUDDl42HM46RohNCE9wGWbjbK5K4G ZiLm1s+t8ctcQ+0ZDe5g2D8ka6tFTA+Nz47hjYX24opOXURwHmxDUmHMeseKgtZJIiUvhD097G1 z8Ns= X-Gm-Gg: ASbGncvawp/8hlufWCVKZzRyOVyMEq/C+aNpL1uboTqVuVoDUaM83cwoJ1sutgv9iE7 ZhZO56GZOSiA1V5B/KG44ALFmRHFQkBStl7BND/v5H6D/BdlPlz5eN9ZAvXmBUI5qOKNeOHLXEL ThGTubd4pF/2XQ3PbKUpRdLg4CIjEmnmqfS51xSMJ01GUFAf66qigk1rthowonAPkUsNj/Bboi5 sS/YJ1B4FiqmrakiwG9dXXCC58Lef1/l3ybDz7unP4raYb3X5Fs1eNbwo71mf3syHU7L2h7zJfq 4OQ24T4+snMFiy8/Ly9Z/YPL8BPkaCPWHyAk X-Received: by 2002:a05:6870:ed8d:b0:287:4904:7125 with SMTP id 586e51a60fabf-29e885f8734mr4425833fac.14.1733258392167; Tue, 03 Dec 2024 12:39:52 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29e3ae09f25sm2684018fac.49.2024.12.03.12.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 12:39:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH 01/11] target/arm: Copy entire float_status in is_ebf Date: Tue, 3 Dec 2024 14:39:38 -0600 Message-ID: <20241203203949.483774-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241203203949.483774-1-richard.henderson@linaro.org> References: <20241203203949.483774-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Now that float_status has a bunch of fp parameters, it is easier to copy an existing structure than create one from scratch. Begin by copying the structure that corresponds to the FPSR and make only the adjustments required for BFloat16 semantics. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/tcg/vec_helper.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index e825d501a2..ad6f26545a 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2813,25 +2813,19 @@ bool is_ebf(CPUARMState *env, float_status *statusp, float_status *oddstatusp) * no effect on AArch32 instructions. */ bool ebf = is_a64(env) && env->vfp.fpcr & FPCR_EBF; - *statusp = (float_status){ - .tininess_before_rounding = float_tininess_before_rounding, - .float_rounding_mode = float_round_to_odd_inf, - .flush_to_zero = true, - .flush_inputs_to_zero = true, - .default_nan_mode = true, - }; + + *statusp = env->vfp.fp_status; + set_default_nan_mode(true, statusp); if (ebf) { - float_status *fpst = &env->vfp.fp_status; - set_flush_to_zero(get_flush_to_zero(fpst), statusp); - set_flush_inputs_to_zero(get_flush_inputs_to_zero(fpst), statusp); - set_float_rounding_mode(get_float_rounding_mode(fpst), statusp); - /* EBF=1 needs to do a step with round-to-odd semantics */ *oddstatusp = *statusp; set_float_rounding_mode(float_round_to_odd, oddstatusp); + } else { + set_flush_to_zero(true, statusp); + set_flush_inputs_to_zero(true, statusp); + set_float_rounding_mode(float_round_to_odd_inf, statusp); } - return ebf; }