From nobody Thu May 9 01:23:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569040595; cv=none; d=zoho.com; s=zohoarc; b=khi7ElwSNwtuUzcKf4ufgSZQzrqBsuulCu55+eGPRnbTWvB0BNC2+VseNr6L6/Wfl406gVzQqR/3r6ULXtQYl3G6gluZHUjewAw1atPMEx6gDVQKhAh1Fi9d/q5rSePhx8QPPY2ATHZEgFS1BBRE/zgkcF3NogMSPd49D6rERGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569040595; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=b9hvT4KM2rHH/vsMDbpWRcPXcj5oYyVhJm17BHsajzk=; b=hm7OmbbesgIrpE43vjOQbnOqdH1yhs/vPnoT8KAfv3eurMwZXc08FpYOZcVeZxw52Y5tlQMtQybY+CsqHLLMQzJeC3++NoHFYnkiycT6GMwSrgGOWo6qGSuD0fekEaBvEuZD79MNXTUW8jCHtqdgPaMcN9/lQuZAvX4mtNVy3/s= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569040595357966.3781540461969; Fri, 20 Sep 2019 21:36:35 -0700 (PDT) Received: from localhost ([::1]:38520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX8F-0005ML-86 for importer@patchew.org; Sat, 21 Sep 2019 00:36:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40463) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX54-0003JE-Pt for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBX4x-0006OQ-Ja for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:07 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:36626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBX4w-0006N3-MJ for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:03 -0400 Received: by mail-pl1-x644.google.com with SMTP id f19so4150458plr.3 for ; Fri, 20 Sep 2019 21:33:02 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 193sm4179986pfc.59.2019.09.20.21.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 21:33:00 -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; bh=b9hvT4KM2rHH/vsMDbpWRcPXcj5oYyVhJm17BHsajzk=; b=oLFJL9GXQvvNWFVixLW67J3Rg01HY92uuAArV94f51S6MObOMeWnJXllwd+xEsL2vO PnKCY5AMAqA++FVwJr+bHYu9nxEjIJX0i61zNr15WN2ep3jWB5BCLbZBcs1AAfiTdmrl b2N5vD8FF3OdLQ/XwdRev7fVcE9K0Xn2S7CHwgr046a2fOApext+cZLV0ql9TOC9Rnsd +XdnzVWNR9N/dnUORZr3ajHTRQOopmBDGrSnnrZLPGKmmE5XugDXCfoQ+pH81iKEgBFC saWGkZ6gihQUFbv2P2S2Hpn/0HJWTd1qiXklcbnzVYa1DZnch42vrsewApUC9jLiXiTh xfqg== 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; bh=b9hvT4KM2rHH/vsMDbpWRcPXcj5oYyVhJm17BHsajzk=; b=brzTrqsA9PqRNmv2D92FqrKiwq1oLUa5jRN8bc2XFizoWzSe0RiRP62c3D/JSLq8ek 9B5wq2FT1iEBgAfTDma9MLh1x1kB5zHW/jZ4zfFlEHxjaRQQeJuL58235ILmZG6Op10h d2/CzFiPimU3BQUQBjWPqu8TjDxo9hatTj5RGN656N8/8mZM9v8N9djNqpKYP1r7kz3R SOOSocOakTKfmKk9Y4c6/Ixi1aYj/iziiqApHfs609Nw4VmjxgOHFGCPRvKaMqXRanyh fd4/DtTq9UoIuih/pprHsYQg0U82Km98ORY5uNeylZCfyaN5T7ZjhllPaK1/mgaHHLBk tBgA== X-Gm-Message-State: APjAAAXHty8sai8IpH5hNzKnz1RoMhaWDInYx0YFot7FGlzukydrNfB1 wvD2ThRA4fLIoVWTU0E6RMwzL0Quv/U= X-Google-Smtp-Source: APXvYqy8EA5lg8VpuHAUxPxOmt3seyCUUJQVkdRbM9iPfKboY8m6PrVVizqlBjw6fF/CveEaC71G+A== X-Received: by 2002:a17:902:8d98:: with SMTP id v24mr18471880plo.265.1569040380988; Fri, 20 Sep 2019 21:33:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/7] target/alpha: Use array for FPCR_DYN conversion Date: Fri, 20 Sep 2019 21:32:50 -0700 Message-Id: <20190921043256.4575-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190921043256.4575-1-richard.henderson@linaro.org> References: <20190921043256.4575-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is a bit more straight-forward than using a switch statement. No functional change. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/helper.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 19cda0a2db..6c1703682e 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -36,6 +36,13 @@ uint64_t cpu_alpha_load_fpcr(CPUAlphaState *env) =20 void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t val) { + static const uint8_t rm_map[] =3D { + [FPCR_DYN_NORMAL >> FPCR_DYN_SHIFT] =3D float_round_nearest_even, + [FPCR_DYN_CHOPPED >> FPCR_DYN_SHIFT] =3D float_round_to_zero, + [FPCR_DYN_MINUS >> FPCR_DYN_SHIFT] =3D float_round_down, + [FPCR_DYN_PLUS >> FPCR_DYN_SHIFT] =3D float_round_up, + }; + uint32_t fpcr =3D val >> 32; uint32_t t =3D 0; =20 @@ -48,22 +55,7 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t v= al) env->fpcr =3D fpcr; env->fpcr_exc_enable =3D ~t & FPCR_STATUS_MASK; =20 - switch (fpcr & FPCR_DYN_MASK) { - case FPCR_DYN_NORMAL: - default: - t =3D float_round_nearest_even; - break; - case FPCR_DYN_CHOPPED: - t =3D float_round_to_zero; - break; - case FPCR_DYN_MINUS: - t =3D float_round_down; - break; - case FPCR_DYN_PLUS: - t =3D float_round_up; - break; - } - env->fpcr_dyn_round =3D t; + env->fpcr_dyn_round =3D rm_map[(fpcr & FPCR_DYN_MASK) >> FPCR_DYN_SHIF= T]; =20 env->fpcr_flush_to_zero =3D (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ); env->fp_status.flush_inputs_to_zero =3D (fpcr & FPCR_DNZ) !=3D 0; --=20 2.17.1 From nobody Thu May 9 01:23:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569040797; cv=none; d=zoho.com; s=zohoarc; b=nN5F3qP2JmCgGCfJTzMWvXVmje+B+c1hdgouLqaUeOF9XHLyixsIM4ehpjBHIf8xqmTjw2ZroOTO+CeRq6d3nWZV+I+VpgucsueOepjADLtk4jzx7y8QpBC/Zbqo27eXl2ogj9aS5FRYHEvu5NRhX/eYRDrgdL/t1bkZsuKVayQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569040797; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=N9p66J3CyRGSggPL0jEHpJ6N3kmg+tOoU7mSBRlNkcw=; b=erAVrPWWDcIVt2Ng+U+wYVbIhYaFWTqX/KctWM24Thzhv3C9FRntcnR+Se9peAWV+WFgmScon/ZouunmoX3c/kIC6l6TsIs4RGrgPnv3FBG6zK7d0lBp6tXYv6aSF53PXqlWlmiSY+x8M7gxK5xWd468o6R72qjmXoMuuoXtp1Q= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569040796963658.0347463119929; Fri, 20 Sep 2019 21:39:56 -0700 (PDT) Received: from localhost ([::1]:38848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBXBb-0000n2-AO for importer@patchew.org; Sat, 21 Sep 2019 00:39:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40496) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX56-0003JV-Gv for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBX4z-0006Ph-8w for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:09 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:36572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBX4y-0006P0-BZ for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:04 -0400 Received: by mail-pg1-x544.google.com with SMTP id h17so2438035pgb.3 for ; Fri, 20 Sep 2019 21:33:04 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 193sm4179986pfc.59.2019.09.20.21.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 21:33:01 -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; bh=N9p66J3CyRGSggPL0jEHpJ6N3kmg+tOoU7mSBRlNkcw=; b=xpIFQJxm3uzfSkSTraENbc8HtBffhVBVKmU/3hlMOLXFXvjpL6AzMM+qNg189A2EeY fdtVTTt8TLNtwvaSJ1/AI5r6bObjANZEVNdC4TgptegNcjnmu8Zm57eTJF168rxlxWmf AST4BhMwUUJPcU8SHg3k3AcSkBYU1jjTEwepy/ylmICHZSvvqUQq00qaYHR7jGafC2YP muTWddnz9Vf3T/nZCln6ChE26s5D7tFvPhGN+ItauFVjI9gDT6IjAnNyMkSNjHUCsOCw tsfrWWTCtyv0BayoYkNMhuPU3OJxzRYv2GwW4s1F+akwwBI0JAqKJDidRC4cuCXHFW3s Al6g== 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; bh=N9p66J3CyRGSggPL0jEHpJ6N3kmg+tOoU7mSBRlNkcw=; b=YkRdA272t9JxToo0Kc4voe9qdGS9NfS2f4sA1pug/bs2Wgun7FUWBWtzZ4HC4QnE1D 3rnRQy+UQtflicfZm8Vd1mf6x4MbUsaK0VsaCldHN5lYcuDL7nWQDWz8kcL5MJS6obJy +5gO7p+zosvgARfeJGv2/FlAEFkJF0lqjmWDrQlij/CyytCUnSAnQ2ti/PFlQS3RWBIj ktY/kHBRrEuzPrdJAVbJViU5k3KkBqYxzVdSGlP2HgvsbAibfg7jBe8YP+AkyryZgNfz N55Odb9FPBy0Ejmq84GzS6bFPnncQmTh+I0IPJgSo1Nh+dtTjk/y0X/kF6tPOwNqoDkH 1yrA== X-Gm-Message-State: APjAAAXaDu1uN655VzDUow0TUJJmNqkPk7MqYZQBKP2UT5H5HmfvhOXa DQ+Ywy6ah5+Kwa4FtdpBVjzNtmY9Wi4= X-Google-Smtp-Source: APXvYqwoIuifzuWe4EXFhMnbHHcXlKzhxgNP6V7uP4XPWAVjj1I3V/WzuBcrf5RyT22nWr5Gzx6+fQ== X-Received: by 2002:a63:1521:: with SMTP id v33mr18854563pgl.9.1569040382707; Fri, 20 Sep 2019 21:33:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/7] target/alpha: Fix SWCR_MAP_UMZ Date: Fri, 20 Sep 2019 21:32:51 -0700 Message-Id: <20190921043256.4575-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190921043256.4575-1-richard.henderson@linaro.org> References: <20190921043256.4575-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We were setting the wrong bit. The fp_status.flush_to_zero setting is overwritten by either the constant 1 or the value of fpcr_flush_to_zero depending on bits within an fp insn. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e --- target/alpha/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 6c1703682e..10602fb339 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -71,7 +71,7 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t va= l) env->fp_status.flush_inputs_to_zero =3D 1; } if (env->swcr & SWCR_MAP_UMZ) { - env->fp_status.flush_to_zero =3D 1; + env->fpcr_flush_to_zero =3D 1; } env->fpcr_exc_enable &=3D ~(alpha_ieee_swcr_to_fpcr(env->swcr) >> 32); #endif --=20 2.17.1 From nobody Thu May 9 01:23:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569040607; cv=none; d=zoho.com; s=zohoarc; b=mGYHEfMeLHLd1ZNQpkKtK+CjMo3+jS0jsvPXUNvsq5//YhMOzKZ8dPZ7OBURqQdu89+OB45agYM4k5BgNF3piBnSoX3QzC0S/O6yiphziQFuiWnR7eSI1GE16VlpMcHYGMjNyDQ6uK68DQW/Q09SE88w6Fa7rbpi3e7a0E7gGjs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569040607; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=N6+9fuZx1kzSXVJeSDepo9XmkdWGsxo7WFnloubWcfk=; b=baNyA3GSlu7Yy8CsF9Dvu/cPssPFm18yUul5Z1Mo5c7tkZwwxKOfzbB+hMFzhAbuCPqLDWGJ+pu9jXW8Vssp+4LQUqKlcfJ5mK6pKak9ZmHSL8oJXw+g7zp7Ga26yhD858aop1dp4fAOJeheCdKzWK0DGShNnjZBqH+kX6I/+Kc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569040607853172.14134030753496; Fri, 20 Sep 2019 21:36:47 -0700 (PDT) Received: from localhost ([::1]:38644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX8W-0005oX-0M for importer@patchew.org; Sat, 21 Sep 2019 00:36:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40654) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX5K-0003RG-55 for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBX5F-0006YC-9I for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:25 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:40856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBX5E-0006PW-Je for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:20 -0400 Received: by mail-pg1-x543.google.com with SMTP id w10so4977403pgj.7 for ; Fri, 20 Sep 2019 21:33:05 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 193sm4179986pfc.59.2019.09.20.21.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 21:33:03 -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; bh=N6+9fuZx1kzSXVJeSDepo9XmkdWGsxo7WFnloubWcfk=; b=z0hMLBXVgkFabCj2zb7KnZQh8Ji4In3fIndCAOvLm2DJdOjdeNN3x3fbxYngDYttXd CqVx/U2H1QgguP5l39H7hOpWZOybYOhSmxzCUtEAu2fcyLe+k8iwsoz34Je3A3qW1Ilh 6aqH9bW/flNiyCjayuw8+IuhmmFqy3IrmIlG9KQmokLIk3FCOxqd6WZIgFXrK8w4NnvJ WM4FKHq3cXuEyUb0JCg4Nna3U/CS2wB++AekEGH/OaXSJkm5BXFsqg+BbogQWCz5TIZA nEOrCWP7fQ5Em49CMIGDtHzj4sH8FrM/p6sFEZze1t8tQrLn9X2p+q9Ej1SoFfFwEQFu 67uw== 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; bh=N6+9fuZx1kzSXVJeSDepo9XmkdWGsxo7WFnloubWcfk=; b=qQ0OYF3ucTozBYQSjonlO7YsGuDJ8d5wEIP7n+sVL7AYei9a8ZTLB/aRHp6Bf+svX0 /pq0RzQFU7RP6KuYktMw84ZaH7a6X+8g6lzeS6GUmfnvByBltgKsuEzWCWSzPVdhNtsL tN7jiAbJ/j3VwSY4SIuq6s59zjVqCVxEzPhmj4tGOjrO/uo0kC4CDGJShBHsOpD8BYZZ O7x4yIMIxeUoaNiKqVaBZf6TtuWcYdNVtTyNJ2kiYrrbXVF21m25f3357KQbMY3Ccg9Z /n6v2mKVEDSg10rJCRYVmeafyBLU9oLx9OGR1Ry+gxyoX8zjBMJMvNMjVVsfuWGXg1Mx pU6w== X-Gm-Message-State: APjAAAU8xFJb3ZgtW3k6EPTERPeSk+P2dk2Htu4I4RVcUzXo4yBRORTn 8sY0QXs3IPlcGEaPKRwnf4HE8b1QsSA= X-Google-Smtp-Source: APXvYqwXhhGAAdUAQIAMTGhbatpRd3Lf9ItZRNQBJ/0xaE3W/4Jb5mDqrnN65osKhstN/G1ICGG8dg== X-Received: by 2002:a62:3c1:: with SMTP id 184mr21929919pfd.209.1569040384062; Fri, 20 Sep 2019 21:33:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/7] target/alpha: Fix SWCR_TRAP_ENABLE_MASK Date: Fri, 20 Sep 2019 21:32:52 -0700 Message-Id: <20190921043256.4575-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190921043256.4575-1-richard.henderson@linaro.org> References: <20190921043256.4575-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The CONFIG_USER_ONLY adjustment blindly mashed the swcr exception enable bits into the fpcr exception disable bits. However, fpcr_exc_enable has already converted the exception disable bits into the exception status bits in order to make it easier to mask status bits at runtime. Instead, merge the swcr enable bits with the fpcr before we convert to status bits. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e --- target/alpha/helper.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 10602fb339..e21c488aa3 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -46,19 +46,8 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t v= al) uint32_t fpcr =3D val >> 32; uint32_t t =3D 0; =20 - t |=3D CONVERT_BIT(fpcr, FPCR_INED, FPCR_INE); - t |=3D CONVERT_BIT(fpcr, FPCR_UNFD, FPCR_UNF); - t |=3D CONVERT_BIT(fpcr, FPCR_OVFD, FPCR_OVF); - t |=3D CONVERT_BIT(fpcr, FPCR_DZED, FPCR_DZE); - t |=3D CONVERT_BIT(fpcr, FPCR_INVD, FPCR_INV); - + /* Record the raw value before adjusting for linux-user. */ env->fpcr =3D fpcr; - env->fpcr_exc_enable =3D ~t & FPCR_STATUS_MASK; - - env->fpcr_dyn_round =3D rm_map[(fpcr & FPCR_DYN_MASK) >> FPCR_DYN_SHIF= T]; - - env->fpcr_flush_to_zero =3D (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ); - env->fp_status.flush_inputs_to_zero =3D (fpcr & FPCR_DNZ) !=3D 0; =20 #ifdef CONFIG_USER_ONLY /* @@ -67,13 +56,29 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t = val) * which point the kernel's handler would emulate and apply * the software exception mask. */ + uint32_t soft_fpcr =3D alpha_ieee_swcr_to_fpcr(env->swcr) >> 32; + fpcr |=3D soft_fpcr & FPCR_STATUS_MASK; +#endif + + t |=3D CONVERT_BIT(fpcr, FPCR_INED, FPCR_INE); + t |=3D CONVERT_BIT(fpcr, FPCR_UNFD, FPCR_UNF); + t |=3D CONVERT_BIT(fpcr, FPCR_OVFD, FPCR_OVF); + t |=3D CONVERT_BIT(fpcr, FPCR_DZED, FPCR_DZE); + t |=3D CONVERT_BIT(fpcr, FPCR_INVD, FPCR_INV); + + env->fpcr_exc_enable =3D ~t & FPCR_STATUS_MASK; + + env->fpcr_dyn_round =3D rm_map[(fpcr & FPCR_DYN_MASK) >> FPCR_DYN_SHIF= T]; + + env->fpcr_flush_to_zero =3D (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ); + env->fp_status.flush_inputs_to_zero =3D (fpcr & FPCR_DNZ) !=3D 0; +#ifdef CONFIG_USER_ONLY if (env->swcr & SWCR_MAP_DMZ) { env->fp_status.flush_inputs_to_zero =3D 1; } if (env->swcr & SWCR_MAP_UMZ) { env->fpcr_flush_to_zero =3D 1; } - env->fpcr_exc_enable &=3D ~(alpha_ieee_swcr_to_fpcr(env->swcr) >> 32); #endif } =20 --=20 2.17.1 From nobody Thu May 9 01:23:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569040796; cv=none; d=zoho.com; s=zohoarc; b=MYGMuXUnB8DLxj+1xv7fFYPNn/TRvVPbLvKt7uIXhg7FAVWZ19toMWE3v7/XAH3QGIYQSdGl47a3Ji4Ezc9xqLpeuFWYF7lW/KeWg0QHnkAP4Xmc9sN3mMrdcsQJzBfoZPsNILIKsK1RfYwTD89zp+Ht9FsCI/vEgu4KioUUniQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569040796; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=8832rs/gjYJtK2KCkPzbjErZga7EWVI26gkEzFEjWFQ=; b=ZI2xMHXmDKbM6jmse6hB82UT9/KeR7Ti+9cUCtr5uwd2/g3mTI54VQv47jutHBxczAL+ynGBizlZuoUbBAERlv5uqG8CPS6kOQv+llCWYV1w0fAmUwka37ew3/4cL5gzpKgtjDOSNEdzzMxubE6iTSelpTK7wEcNyItF7KiF8ag= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569040796443665.3790748095413; Fri, 20 Sep 2019 21:39:56 -0700 (PDT) Received: from localhost ([::1]:38844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBXBX-0000iN-SN for importer@patchew.org; Sat, 21 Sep 2019 00:39:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40660) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX5K-0003RY-BL for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBX5F-0006Y3-8Q for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:25 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:47014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBX5E-0006QK-HN for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:20 -0400 Received: by mail-pf1-x444.google.com with SMTP id q5so5852658pfg.13 for ; Fri, 20 Sep 2019 21:33:07 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 193sm4179986pfc.59.2019.09.20.21.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 21:33:05 -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; bh=8832rs/gjYJtK2KCkPzbjErZga7EWVI26gkEzFEjWFQ=; b=PO0GiQse2Tt2buMzBBQF17lZ2BDMqCf8+qVTGxSzCAQzsfwfnbeZvlxMEzupWX6wLH 5j1MdnUOo5gN83hnqC8x1HzuoI5Z4GUpQTb/4RLZ/devOLCueelWgLKzGlt8RRiuMLWw sI0fbHFdgZVUIB3KdZSys4UamvIKkcqXiQ5GwCNeC6b+3T9t7IIjFC9hcVn2j3PauHs8 lKCBtyemq+6SX1W0ao6sx5uzHbzkJ8lgf4XTGbugaW/Z/x2AGoK+4iaPbEj1mz0/mQlZ R25hB3gjt3iSDkBzd37NQjjP1/mBdX6goqqU73oYR/DWVAjLYcEK+DmiBmsaPqowPMsi zV8g== 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; bh=8832rs/gjYJtK2KCkPzbjErZga7EWVI26gkEzFEjWFQ=; b=tVuv9+jTzqDyo7UxB13nPk+Z6JRpdphZt/agZSwyAGaJF8E2OidnOIc+eeHFbtzeqZ eEVpX7pBqC1arzTG0cIDe4a6gxaxcXUklloFC7XSSwEUD62jivProMB5KywWnm1WKswq dzT4rRpFOnrin6Pdel43XPnZwV2ZYJ+9WErP1ckho2WG9YZB1lxjtDsgXHVdoDCd7p0q 1bgrTH/PeswywmjygkYirTOls5KPZyMKWIm6elR2ibqsp95O5O6SPAV7meY3TaF7wmjg c89e27StsPTSxWQzt8V0vzzV9bwumbZceZAGx8VH/P2Zo0ccG18btEC57jCLazghfn5L BHBg== X-Gm-Message-State: APjAAAWE7Crtgu/bP7EbYGy32dOz034GZlytCUmHcu4SiO5JJLNQv1cK URI9LxTgOTBOO51lsr9sFY0ZJUterVU= X-Google-Smtp-Source: APXvYqyEAoWRisG1pyxAcwIk1bHr4UWk6rkI6/6B8WMjvhmPvJgtkgyZmQWwxnOp+hxbx1s+D+phJA== X-Received: by 2002:a63:1f1f:: with SMTP id f31mr18413877pgf.353.1569040385641; Fri, 20 Sep 2019 21:33:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/7] target/alpha: Handle SWCR_MAP_DMZ earlier Date: Fri, 20 Sep 2019 21:32:53 -0700 Message-Id: <20190921043256.4575-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190921043256.4575-1-richard.henderson@linaro.org> References: <20190921043256.4575-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since we're converting the swcr to fpcr format for exceptions, it's trivial to add FPCR_DNZ to the set of fpcr bits overriden. No functional change. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e --- target/alpha/helper.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index e21c488aa3..2f959c65ef 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -57,7 +57,7 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t va= l) * the software exception mask. */ uint32_t soft_fpcr =3D alpha_ieee_swcr_to_fpcr(env->swcr) >> 32; - fpcr |=3D soft_fpcr & FPCR_STATUS_MASK; + fpcr |=3D soft_fpcr & (FPCR_STATUS_MASK | FPCR_DNZ); #endif =20 t |=3D CONVERT_BIT(fpcr, FPCR_INED, FPCR_INE); @@ -73,9 +73,6 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t va= l) env->fpcr_flush_to_zero =3D (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ); env->fp_status.flush_inputs_to_zero =3D (fpcr & FPCR_DNZ) !=3D 0; #ifdef CONFIG_USER_ONLY - if (env->swcr & SWCR_MAP_DMZ) { - env->fp_status.flush_inputs_to_zero =3D 1; - } if (env->swcr & SWCR_MAP_UMZ) { env->fpcr_flush_to_zero =3D 1; } --=20 2.17.1 From nobody Thu May 9 01:23:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569040602; cv=none; d=zoho.com; s=zohoarc; b=E48ICWPEy2WJD71PvKp9akXW8IyUBNFdY55dVcDnFKsJsZw47Ku0Uf41ws5j5cdPgRQTSIr0Wm6E8BWcvbWBveCveLN7jFpQOA2XpuoAPGjNkqR3he4QgYVTiodrRhRqt77ePOjL2Lf0s2ODHFvFiXRCN195JBE/fT3c+7k5dTw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569040602; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=e9wUlJNq9/BSGM/fpYcG0qtVD5/JBFR6vCeczUn1tOI=; b=FGq/fkRP5tjYT5zck0yMzKXGLAvXsXvQ2j32FxK8rQcH7cABYa6j7vKbmTFbF1TZWIG3oGW2No3awzQWmDCUOVBg347hmov9g2K/WqnZMGxVWPwwaUXVpdcb3SpXqCwIFzdJDVyjBilmPwxLcBjzJqt6i8XU7R1gLrHMzhzPQLs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569040602852367.3940664448121; Fri, 20 Sep 2019 21:36:42 -0700 (PDT) Received: from localhost ([::1]:38636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX8S-0005eQ-VK for importer@patchew.org; Sat, 21 Sep 2019 00:36:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40656) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX5K-0003RK-5o for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBX5F-0006YO-G4 for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:25 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:37196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBX5E-0006Qg-Lv for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:21 -0400 Received: by mail-pg1-x543.google.com with SMTP id c17so4987282pgg.4 for ; Fri, 20 Sep 2019 21:33:08 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 193sm4179986pfc.59.2019.09.20.21.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 21:33:06 -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; bh=e9wUlJNq9/BSGM/fpYcG0qtVD5/JBFR6vCeczUn1tOI=; b=ID4a1Ib96z8s01zTwAh4sEYfjen+2ce6KRW+9NxASiLytDC25rFt+YdjDhL07suSVy WrTyHSfvdeTtsq4LoYeou9pQ4ONyD4LZdYtw+eY8jQl9U4Io3/BODxyN+IC6/nk61LaB iUPoKBpXd5SiZfyCB4q+UvSzOZH1lIXiIdJZQEiM/C/4cBvp74K0Ptm2nkFiyhfYueXs ZVgoDM3dQ5ZECl/SiabkXgJzI9vvHUMdvaD5yVPGHN/1wckxGjENCpp1Z84se8GQUU/G 3T4utZBajWSDYCE3yaVQ0zOG90KtHLrXpAmJNcAoSJTE57r3yDTmSli/hOUJ/maQ/luI Y6Ig== 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; bh=e9wUlJNq9/BSGM/fpYcG0qtVD5/JBFR6vCeczUn1tOI=; b=BS77s4Uy5FtRHtRkIdKoRCZITikQr2Nb4Z0QH5/SNxh8tHMnUEaPtT4NqRyh/xAjQV 9a+Soo7Rt3ATmztN8sj6+u7HStqQdWXpMnDZGkBUYgIm0xdB8Y97TjxOtI51UHWkVAV6 ejgQ7Yih1b1iLH+frrN5OjsRipi8XYGV8pkdprZhAQ+OaSrQUXRyS3RWshKM91czEI3a xLE/dmQ7hJ1Dl42kdjqoWHr1q9Cf5zaC00fHeDG2I7D4A44kXuHG0PRO4MQj5LeImgdS l25LcYF4R8cDE2s/ZSkMnXoFCqZieHR1uRByvEDdIVm4q006cjy/mUsD4OhEygojq8H8 m5LQ== X-Gm-Message-State: APjAAAUZlJC4TMwFn+sRRS32r0FuvYnf7Cq9boMOepI8/VrYWOSdL6E1 0yQI6UFjggt39uekqnA3fjXM2YM8uVI= X-Google-Smtp-Source: APXvYqxN9FCeZS1BBSv7Ns9mEt4Of5I1Yh+LmG1aOFlog5wqkIt7WprM8e6aNYqW/D5zTYDVff2WKQ== X-Received: by 2002:a63:e512:: with SMTP id r18mr11722947pgh.117.1569040386897; Fri, 20 Sep 2019 21:33:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/7] target/alpha: Write to fpcr_flush_to_zero once Date: Fri, 20 Sep 2019 21:32:54 -0700 Message-Id: <20190921043256.4575-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190921043256.4575-1-richard.henderson@linaro.org> References: <20190921043256.4575-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Tidy the computation of the value; no functional change. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/helper.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 2f959c65ef..1b3479738b 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -69,14 +69,13 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t = val) env->fpcr_exc_enable =3D ~t & FPCR_STATUS_MASK; =20 env->fpcr_dyn_round =3D rm_map[(fpcr & FPCR_DYN_MASK) >> FPCR_DYN_SHIF= T]; - - env->fpcr_flush_to_zero =3D (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ); env->fp_status.flush_inputs_to_zero =3D (fpcr & FPCR_DNZ) !=3D 0; + + t =3D (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ); #ifdef CONFIG_USER_ONLY - if (env->swcr & SWCR_MAP_UMZ) { - env->fpcr_flush_to_zero =3D 1; - } + t |=3D (env->swcr & SWCR_MAP_UMZ) !=3D 0; #endif + env->fpcr_flush_to_zero =3D t; } =20 uint64_t helper_load_fpcr(CPUAlphaState *env) --=20 2.17.1 From nobody Thu May 9 01:23:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569040954; cv=none; d=zoho.com; s=zohoarc; b=iJCmetf7dGEDRhHbM3OWzicsBQukWLD+wzpkvMYBYl7ivDw0xlswIbR6QvyffJtGu2JDuDs48hkgF1aeaw0byQF55kb58ztBqDEO+tg40C98Roo4NXDAWgje71lMfjiC4GuXI68bUEVQ1Ox9hAWGaZpla7GQ7PZ6rz7r5EzZNUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569040954; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ZAz7iFPOWkaueNLTk5914u9zAUBjebd4K9tG0kc56ik=; b=SCuBk1zzgdnHEwhnIffFDkhh/MZCh+p2G1+qXSrmu/qdUxx2uCuidO2EBbSKzaudHRw2Weo/0iwYSFu7K+U6d67lJMGBrofgV+YnNMYxrgSucQb/wJKYHcsZ9dRMplrn1PK+KcrF4VUfOoa+HeA9yyJ8pzFWjezM/tYA3Jz4cuM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156904095414832.296992788227726; Fri, 20 Sep 2019 21:42:34 -0700 (PDT) Received: from localhost ([::1]:38912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBXE6-0003Bb-Nf for importer@patchew.org; Sat, 21 Sep 2019 00:42:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40653) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX5K-0003R9-0h for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBX5F-0006Xt-42 for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:25 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:41511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBX5E-0006R7-HU for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:20 -0400 Received: by mail-pl1-x644.google.com with SMTP id t10so4136681plr.8 for ; Fri, 20 Sep 2019 21:33:09 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 193sm4179986pfc.59.2019.09.20.21.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 21:33:07 -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; bh=ZAz7iFPOWkaueNLTk5914u9zAUBjebd4K9tG0kc56ik=; b=W6TlkkmRUo8U+sKO+9O8huqeCjEkeVuFYHPwo1VRE8I61vhfsMZyE81CNh5nXf7SuO QSGuWaIm/HZsHpLkX21TygExtQi0MwQo0zTyfw+pfmdq7VsgpIAFXE1PhP/CcqHFt4dG yLVRleLCnNdjQecZPR9jSm/T5yinzn2QqpxH62gGckopHa1pvNxyD47xol+buMzBNtfI PcvPXOMVHd3UjUFx8UvqoMjigQyJoDhpFjtcZs4vi/rAyHTJE7vTml58eVPzbSzuhKc9 ssOOTL2ZY3GAKK57+cE2ruwd0fI5RotF+phYxpljhXhtXZzpXrh08UQNGAE1seP3HQLy 306w== 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; bh=ZAz7iFPOWkaueNLTk5914u9zAUBjebd4K9tG0kc56ik=; b=XHmrMak2wq8cM3/dlm8NMM/2bm3azqLz65ztcjZuth8NV55jzJYIJM9uRDAdQePn46 GpqriLMbg3NYvYxFPUUJaUcdkGWX/DVdqr5uPJvN15UBihTSdwqBHjKd7ceU0ICpTK7B 9AV0+bUxagVYOChHt3hqRV+EiIl9ekffOmuB809rdTR8+6f8n45WJvCjzQ6rM+PFgE5B s9HMA3XJIuYYzxukTD4io5O2g8oY9Se9sdkrUA3yKHG3XRam5GLjMVb29/Tg2MUohv6L 32XZa0b7dRO00XbHz0GN/LI9EZltwS6i2rosxN88QVscljWoonylydFoPEzwlbtO3wqO xu4Q== X-Gm-Message-State: APjAAAXfrdEBTnJzC27hez1b2rWOBCvhX06+4eUvRWLd343OT87P2brQ Bi3+f2M3xd6wzRguaIUa5KgrZUOuRNs= X-Google-Smtp-Source: APXvYqyhXN29OIOLcB/QAYkPoberrx+FTOZNo8vt0tIzRbQunVzmOhO6HjmrrE52MgfsRLTtmgfT6w== X-Received: by 2002:a17:902:ac98:: with SMTP id h24mr21012369plr.64.1569040388609; Fri, 20 Sep 2019 21:33:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 6/7] target/alpha: Mask IOV exception with INV for user-only Date: Fri, 20 Sep 2019 21:32:55 -0700 Message-Id: <20190921043256.4575-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190921043256.4575-1-richard.henderson@linaro.org> References: <20190921043256.4575-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The kernel masks the integer overflow exception with the software invalid exception mask. Include IOV in the set of exception bits masked by fpcr_exc_enable. Fixes the new float_convs test. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e --- target/alpha/helper.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 1b3479738b..55d7274d94 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -58,6 +58,13 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t v= al) */ uint32_t soft_fpcr =3D alpha_ieee_swcr_to_fpcr(env->swcr) >> 32; fpcr |=3D soft_fpcr & (FPCR_STATUS_MASK | FPCR_DNZ); + + /* + * The IOV exception is disabled by the kernel with SWCR_TRAP_ENABLE_I= NV, + * which got mapped by alpha_ieee_swcr_to_fpcr to FPCR_INVD. + * Add FPCR_IOV to fpcr_exc_enable so that it is handled identically. + */ + t |=3D CONVERT_BIT(soft_fpcr, FPCR_INVD, FPCR_IOV); #endif =20 t |=3D CONVERT_BIT(fpcr, FPCR_INED, FPCR_INE); --=20 2.17.1 From nobody Thu May 9 01:23:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569040804; cv=none; d=zoho.com; s=zohoarc; b=D0fBRBKvdwCfPIcaLEeFWtz9ECLW7Rj9j5uSIEw+Ymi6It/KO4sksPFqe/LWb6KPTWtwH2MXYlK49GoEPFh3bwFjq/Pvv+vJnz8yEW3Q62IE6diQYBx8yy9IhFSMIkqJJPgFl6WYYwLmoJPLedWPFwA8SlNW/NJdl/KpKoGoxeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569040804; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=j5P0Q5UZ/JVwqVpHHBVM78hUGXGLlaTuJMYDTaeD+qA=; b=P5UfLD/23TVpHmVYvluH60nGhmOr/xlg/ER/JXU+rVJ+KmmRS6PxRRQWYyGMc9LO++WfLy25CC2nRxTJBIx0hU9WwDCs4NG2hE2N08sjYT9F5SQGEoRkff5qoTnHUovKGD9L/c2Ir+MKzoxI/0UTlmqQkJSKq3VxxMeZ0xLIvuE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569040804876275.64758233437203; Fri, 20 Sep 2019 21:40:04 -0700 (PDT) Received: from localhost ([::1]:38852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBXBi-0000xc-6a for importer@patchew.org; Sat, 21 Sep 2019 00:40:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40647) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBX5J-0003QK-BL for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBX5F-0006Yp-U8 for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:25 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:46843) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBX5F-0006RU-3f for qemu-devel@nongnu.org; Sat, 21 Sep 2019 00:33:21 -0400 Received: by mail-pl1-x642.google.com with SMTP id q24so4117830plr.13 for ; Fri, 20 Sep 2019 21:33:11 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 193sm4179986pfc.59.2019.09.20.21.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 21:33:08 -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; bh=j5P0Q5UZ/JVwqVpHHBVM78hUGXGLlaTuJMYDTaeD+qA=; b=BMJ54MLxkX1dTZRUonVXJWKeestfVpBv5/kMqOEKO6alJkvUfBi4rLy5dJwdB2eIzh r3xZYISy2d0PwZHooSga2tEUh4uzjOGA76zjqF9EsJS18zp0vnwU1sRyCN/b9OX2sZ9P ifTUjfuTTNjoHexZxcQ0r5L72DfW2tJpzUA18mM2VmE61zohNFrDA3hQNmwkRbfSNt8Y wn0KKuwU/cVgpYYqL2gRXMCgRQ3DtaCnHq0z7CQu7fhvUCj45OyJVklVNd9+ncBqia9L tnFY/QWDFCtbWwgEABHh6ovSf3wSQ1ON+G80cp6iqvt4Vxsaj9jSQN7qCIsU5R4uz63J 8Mmw== 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; bh=j5P0Q5UZ/JVwqVpHHBVM78hUGXGLlaTuJMYDTaeD+qA=; b=Mvxk5NQdMiC02kXC5a7peBdp8ptKZoAIsfCnTjsCubN0laFKRY5zNhpwmI4KNSSvqC HaGFIe6Q63ANmuvo0+/8tEQ69KVPYZQOakePeEaDqZXS17rYf+gY8lXRnVpA7P89xcyU 3HumoLgNbxnqcf8CC0/KUDMRp3srlGpvJkoF1v0Yr2U3IyRaaKtK9Oax0X0DY3A1++BZ 4TduE4lVNABRmuhUgAgoptYbibjxe1f542epGfEyPwPsYBoegbvgouAl81BxDsiLS5Qw NvviuDE5UAWGHuI+1AKxpf0hDL3mr80ODk28Dv3QOCU8dI0BxZ4Q2dHCvtvMBAwDs3eY r3BA== X-Gm-Message-State: APjAAAWs9zPN5Tqm46sgfGvuvwIO5uKkOJyampwVTh/md6je5ZR/KOsp 8KB1Rz2nSZXb2nCg3D8y0W9tzDAjrpY= X-Google-Smtp-Source: APXvYqzgtYrUhzQTpuT03c420mhfffIZKji6KTfbD4EMeaOwbFn85Ipc0tFnItlRkpWt84Ru/ZRteg== X-Received: by 2002:a17:902:ff02:: with SMTP id f2mr20289697plj.126.1569040389790; Fri, 20 Sep 2019 21:33:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/7] target/alpha: Tidy helper_fp_exc_raise_s Date: Fri, 20 Sep 2019 21:32:56 -0700 Message-Id: <20190921043256.4575-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190921043256.4575-1-richard.henderson@linaro.org> References: <20190921043256.4575-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove a redundant masking of ignore. Once that's gone it is obvious that the system-mode inner test is redundant with the outer test. Move the fpcr_exc_enable masking up and tidy. No functional change. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/fpu_helper.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/target/alpha/fpu_helper.c b/target/alpha/fpu_helper.c index 62a066d902..df8b58963b 100644 --- a/target/alpha/fpu_helper.c +++ b/target/alpha/fpu_helper.c @@ -90,25 +90,18 @@ void helper_fp_exc_raise_s(CPUAlphaState *env, uint32_t= ignore, uint32_t regno) uint32_t exc =3D env->error_code & ~ignore; if (exc) { env->fpcr |=3D exc; - exc &=3D ~ignore; -#ifdef CONFIG_USER_ONLY - /* - * In user mode, the kernel's software handler only - * delivers a signal if the exception is enabled. - */ - if (!(exc & env->fpcr_exc_enable)) { - return; - } -#else + exc &=3D env->fpcr_exc_enable; /* * In system mode, the software handler gets invoked * for any non-ignored exception. + * In user mode, the kernel's software handler only + * delivers a signal if the exception is enabled. */ +#ifdef CONFIG_USER_ONLY if (!exc) { return; } #endif - exc &=3D env->fpcr_exc_enable; fp_exc_raise1(env, GETPC(), exc, regno, EXC_M_SWC); } } --=20 2.17.1