From patchwork Thu May 27 04:14:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 448821 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp159928jac; Wed, 26 May 2021 21:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjBQleA3U4b17OegikA1Il/fxUyMUfrJ7xtBQXT9c2P/fEoagN/gzOqf/9xroBjmnPBK2m X-Received: by 2002:a92:c102:: with SMTP id p2mr1337809ile.211.1622089078135; Wed, 26 May 2021 21:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622089078; cv=none; d=google.com; s=arc-20160816; b=UsWkxaH/uKcHVKYOoIp74fAESlg3jiuzC7AM1Un71c5QTdmWbrwfytx2ETOkLz/DoT sJ5TYrd2/Elg6Fad57U/iR0pU2OXIngZn6T0i9uiUOOyGRpbgKnY0c37Hk31dZcvD2zD flYyPVLDXBXoCs8xOKzW0klZ75KaCJTnl4V6Q+AUn9S68tLMVSV2yhipYMxVLhRSOAbI Raws7YB4zfMor5xGo8FEZuPvuHxrH0J4IKWtU9/9PlmjfIQu2BsZ7tuugoOaWD4jvtmh 8ejTWCLSL35oFL8RMtWE2dyFlRhr9o4ctmeOiorPYYxlILqLb0hvW8JjheH6T4tGdjDP svJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=GEYVI8LFk6gKuKrRnF8fi7M93S+ekzhJWlI6Apgn4eU=; b=QYdLhw+WTR1FcqlRnGICMslg4YcnV7deSgS9vcLMaJJ+3EAdAgtIbdFZv1ReHag9BD w6vHy++068ZS7k2qk1y7QkMYihp7VnJqbvvIM7ZaoL/7fSWZyZ+yHolSn/OuqzKsJagG TxYAvmlcRZgKloZYyM4ikCZHLAi31j8YdWk5klfASwFh03mUyVweIL9K2uyu53JIaLOq GWA+oGBzs4mLoTBQ6wqUehlj1H9fb4Tl3EdHblnHp+6qddQ+xIDYzqUgw5tY5kO8/7KN 1OoSyc7WZUxfDlHnoQDjVjxVqFOJ0b4pRNwAn72LM7wuxEu4WbsTuirLpdvXG4t+/WEB ouLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=p8LZ1BKV; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k7si1119740iok.65.2021.05.26.21.17.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 May 2021 21:17:58 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=p8LZ1BKV; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm7T3-0007Ql-JE for patch@linaro.org; Thu, 27 May 2021 00:17:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm7PU-0001Zs-Ce for qemu-devel@nongnu.org; Thu, 27 May 2021 00:14:16 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:34417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lm7PP-0007D5-Bb for qemu-devel@nongnu.org; Thu, 27 May 2021 00:14:15 -0400 Received: by mail-pf1-x436.google.com with SMTP id q25so2664685pfn.1 for ; Wed, 26 May 2021 21:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GEYVI8LFk6gKuKrRnF8fi7M93S+ekzhJWlI6Apgn4eU=; b=p8LZ1BKVgZqYKudYMjH7qzvO4nH/DHzpAfA/EgRYpkOzk4JXDkVsDBhE5RQBPJjAIy uL2zyDB4eHXvUTcnUY+zBJfNhDxuPThEtBTN9LnP9mA7rOoCGk7fXMd8A2Lp1mDKTy9G 4V3vToc6rDGXnRx1s0uWgwGRMeFH0gk3xOv0UfDVNLVPBmUrgBgTSHEswXN0SF5ExBY3 Z0oArZ/4sKcz/sadFLDTiUDu0C2ormvmeE1/7IyRH/d8QSLR+WgtqcxOEYV6ExpUvO54 m4cw8OammlqDiQjCa3TpeJNFojZpAfvP65N3fWAY7esfGwGOVlTgzuK/3doIoyS4swF9 DXyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GEYVI8LFk6gKuKrRnF8fi7M93S+ekzhJWlI6Apgn4eU=; b=l2BL3bNi6SC+DU42VqbrvsCYYpV6HHrX9roY3dMKWKayGUsDdKN+3t73Wr18qlFdC9 YirhQhF/V3tfWW595GxNSILC0LPMwQjllisA3X5qWN0PcBBC9pgcdbj5Loe/tLLmn0OP WAzAn0oaKJNXhfIj6BCPt+MCJmvN0W753e2v111QPd56wfdgsNHMFy6hcXXQNOUU8xHv f6a/NHsFGmJl0Rn1l4qJ1jrRftHeCh+ftGpLNa9kBCWbrtzc7UH0KtKN+jioPFdELtaj lGfYGVD4smKhkpJs0+DR6DKIBrVnaDg7MhKQ166OZJLkTfUe3E3cNuuNWqwmT7mdaE24 K2mQ== X-Gm-Message-State: AOAM533GdAsuVq0UX75ZAuuAtduKsy/6wJrE9dOLK+7ip5qxYrT53RHe zYEccaFsCSnhjgA8ZZ38VZK9soY9U10Raw== X-Received: by 2002:a63:4b18:: with SMTP id y24mr1871088pga.438.1622088850164; Wed, 26 May 2021 21:14:10 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id s1sm605959pfc.6.2021.05.26.21.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 21:14:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/11] target/rx: Handle the FPSW.DN bit in helper_set_fpsw Date: Wed, 26 May 2021 21:14:00 -0700 Message-Id: <20210527041405.391567-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210527041405.391567-1-richard.henderson@linaro.org> References: <20210527041405.391567-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, mmorrell@tachyum.com, =?utf-8?q?Philippe_Mathi?= =?utf-8?b?ZXUtRGF1ZMOp?= , Yoshinori Sato Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Both input and output denormals flush to zero when DN is set. Cc: Philippe Mathieu-Daudé Cc: Yoshinori Sato Signed-off-by: Richard Henderson --- target/rx/op_helper.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c index ef904eb5f9..2139def3b2 100644 --- a/target/rx/op_helper.c +++ b/target/rx/op_helper.c @@ -127,13 +127,20 @@ void helper_set_fpsw(CPURXState *env, uint32_t val) float_round_down, }; uint32_t fpsw = env->fpsw; + bool dn; + fpsw |= 0x7fffff03; val &= ~0x80000000; fpsw &= val; FIELD_DP32(fpsw, FPSW, FS, FIELD_EX32(fpsw, FPSW, FLAGS) != 0); env->fpsw = fpsw; - set_float_rounding_mode(roundmode[FIELD_EX32(env->fpsw, FPSW, RM)], + + set_float_rounding_mode(roundmode[FIELD_EX32(fpsw, FPSW, RM)], &env->fp_status); + + dn = FIELD_EX32(env->fpsw, FPSW, DN); + set_flush_to_zero(dn, &env->fp_status); + set_flush_inputs_to_zero(dn, &env->fp_status); } #define FLOATOP(op, func) \