From patchwork Wed Dec 11 16:19:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 849197 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp416329wry; Wed, 11 Dec 2024 08:26:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHBM8p4TWDjRr/HQTa+PWhgaMc101S3yuDXJY96As0B6JYnpoYJ3ZdwEL1wyRxIafl89HbHQ==@linaro.org X-Google-Smtp-Source: AGHT+IERLgzkgCZlcaXBW34jz2L6btkCIQeHRf+T/AI49PKUilser6k2fgqGqxFPyXGNGR2DfaYP X-Received: by 2002:a05:6214:2427:b0:6d8:9a85:5b3d with SMTP id 6a1803df08f44-6d9348c9a3bmr57488696d6.7.1733934360254; Wed, 11 Dec 2024 08:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733934360; cv=none; d=google.com; s=arc-20240605; b=YUP9a0IJ9X5MNUAjdHMHlKHjzT19TTtaW1XsI731R8IaedN66InYW91vcgov3usHrp 69g/58iwVqC6AdwKR0O2sdPNu7aYyQPXp2ulAQcxZU9JCpbN970nvSdvO5ISTM/nP4MP i5WgzMZ4bZ0BFaQMw48sWtTjP25VJSoMgR3xHCvNl5Dn5CTa7gJz6x4cyBXxHazoBkHY qgbV8Opph9b1fYl9r/GBfPDPWiQYYomnc6svtQ2iST7mHLJcYPr33BdowcNKif1wQin5 2BougRq6Sxc4SYO7xmvlr6lczEJLMRserhbO36VQjKcggA4EMgZr56UHn3Z6etth2mlp ks9Q== 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:to:from :dkim-signature; bh=0hVwJ7PhWgaa1nanKp9sPo09AWgYuiJDE+Q3tkgukF8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=aRlkWrMbPl7Q4qUZnaucRyuT7oBuAfjoBKvc+/ajmcGxoIprL6mrtoNI6LyOqRk0Ob o1qS73n6nJMuHfPnSnJ3g23cTrf9+pooaqNH145NKaxgLjSatxlrbm+48CdxvEx1y9v3 YGkzecKrRf08E0NKSy0ztPtEjLS0gZ8m24ma/yLb8XNBSA6nPb3WNnuwOXLRejcnM/uu AQiJNbC1ESckg2No1v38ZCwZPgyJYqtwk1Z44DYGDJNOGNjWqYpxKrVAqByuVNEcZ0lt 1WgKtd+rvQV5lrslWmg4bLibimlFzUsfHF1YB8mUKKG1hys8NnBNyyi2Kh4mPCffH4lI h3Og==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jTM8UaFk; 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-6d8ebf39a3asi142315666d6.340.2024.12.11.08.26.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2024 08:26:00 -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=jTM8UaFk; 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 1tLPSL-0000YZ-Et; Wed, 11 Dec 2024 11:20:57 -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 1tLPSK-0000Tm-0t for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:20:56 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLPSI-0007mR-9t for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:20:55 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43622267b2eso1762885e9.0 for ; Wed, 11 Dec 2024 08:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733934053; x=1734538853; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0hVwJ7PhWgaa1nanKp9sPo09AWgYuiJDE+Q3tkgukF8=; b=jTM8UaFk+YYbnx302Iyyb8Ca9z0sKEc2LNLLf11EMk716N8eJYua8FQmnomQT0pA+6 Z5BKgz9ER3U+S9AlXJW65g+2NSls0F5D61B29n88xjJ/W2ZOJsWIdiv88joZg60daUNE bIHcvTFJ2wnQgzrqzKCymUZW6a/uhK2P3Dk9eaDmrQqdjwCtPHKG1ZTFfgvpHdUjvfYQ V11WzPoQ2TBYVB3w8VaBA224vlF4syMZgOXwmHG2gzQrfIuUgwquGbqL1GXtKDoYi46s HpNzC3iYlqYRt+bmhCbm423EcRpREJHYgDJsy9ZI1etjZdwttATq+cDOBVQAlW2JBoYV gY/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733934053; x=1734538853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0hVwJ7PhWgaa1nanKp9sPo09AWgYuiJDE+Q3tkgukF8=; b=X0CSRJpINUYzp0vCHXajLTYzPbO0Jqen+juGU/KcfsVoZLDvvegSQUJLcj00dqsjoh LQ/xFeZhekBvQ1CfdscTt85QrO+tk8c+6AylIpQt2wE+zZ1wKLS4wTpghcauWIY+OPVa R1+5L4ShhN6EHpWe8xvmUBH4PnET/eY2Kv4eNU9j8q+YuzNVnyzOlaBV0UCTuhD0WwiX FsZEzLtSoSMUEIRUFHCFq4T8P+n/0uBnPZgSKXjVQuxKZY911uyP6/7M+5WRY3se48a5 sEbsKp90PYH3EU9FsCD5Hl97EAg9C4eNu98AWPM0sGVPApj+mqZR7sf2v3LpIzbeQ+h3 Ds3w== X-Gm-Message-State: AOJu0YxZMNawmbSiyGFmBaOr4Dl2T3abyhXcaNIOO3T53pAGDp2+ZKwb esy+4FSRlOhqcB9COuTiyzAAU3bNvNo7hqpawQCG5m9Gb/xIR+eckVlmtff2rZpr0ELyoSmcKKU 7 X-Gm-Gg: ASbGncue4WlUabmuvyBu9b5o9+StZCW1Lz7WmPV73HeiU5iE5oS24/u/R2gtctJuktx XRe579GEWPFk6QcYZrDu2Lu9vDZ5fIoIiNYknmkWSPVLm97UsW0nojum9Lyl+x7QGhvwdVL3ipa 26OR54qqWpfZXja+9SHaLT2GPH0jdIlW4vFW7QBr65Qq7eGugQYw+rizMXG++M7J91Nn8e/Tw25 4KsxVoToDAneQLdry6uyZjUqB03+ybWsaTqbUnipq1M9STx9rk1dP9yjkAv X-Received: by 2002:a05:600c:5101:b0:434:ffb2:f9df with SMTP id 5b1f17b1804b1-4361c3a6550mr30727475e9.17.1733934052743; Wed, 11 Dec 2024 08:20:52 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f4dfdcdfsm121460595e9.39.2024.12.11.08.20.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 08:20:51 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 39/72] target/arm: Copy entire float_status in is_ebf Date: Wed, 11 Dec 2024 16:19:31 +0000 Message-Id: <20241211162004.2795499-40-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241211162004.2795499-1-peter.maydell@linaro.org> References: <20241211162004.2795499-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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 From: Richard Henderson 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é Reviewed-by: Peter Maydell Message-id: 20241203203949.483774-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- 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 e825d501a22..ad6f26545ac 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; }