From patchwork Fri Feb 2 05:50:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 769159 Delivered-To: patch@linaro.org Received: by 2002:adf:9bca:0:b0:33a:e5bd:fedd with SMTP id e10csp754672wrc; Thu, 1 Feb 2024 21:56:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IF71JMKmCguWGuUWDfJjbNk0C4WZyD2EhzIxPKs6OCQtuoojFdmEHFs3TVw4Buo5zFkDOVe X-Received: by 2002:a05:6214:2b06:b0:68c:6bc0:3e9 with SMTP id jx6-20020a0562142b0600b0068c6bc003e9mr2407698qvb.26.1706853378564; Thu, 01 Feb 2024 21:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706853378; cv=none; d=google.com; s=arc-20160816; b=hE5isiw6dlm2i8DoOwcbn706Hv/6uHZCLyGX/mTpyfI0s3J8HXY9pe100tcIuY0BLu 3jbybhsHCnUrOTWBpLT9DGc2Ek6bEimXvS9jIKndCTwwLGsUTw9d+TcgW449J+tDVWWC rxBNcGAcMSjl42y5I8SjP0cw1gLkwIl0A+gJ9dNkOkj6hoovzqTvcs9owr+P7nVnb2hX AY0PBmsSMEwoHmxeJQrJ20gloHgLCZTKA3lvrbpkkA+mirt+gk5vgmzhMMVv7fzUaSdk r8WDZVC1nvr2oLIF03ALdPxdSg+AFCqLejRPw24rcp0bztmk+yLV9mO4erv5UBh01GZT eU5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=xswm8Y4EVntAPydwJ8PJUaf0qkJ0h3e6mOU1vrp0dGE=; fh=r14G4heOj6i+oXNdJesdbfDmtXbk7z9L5dEdt1HS1u0=; b=O3IfbpkRTQSqwTIHCEvOjtQRLzDZipBhQZbOZTGxzg+RvdoqMhSvTpebikSLyf+1xS q+1aKrKZKLtr3NdoiAQFQsWuJdGeiBU7enCVtpIMnuP1FWxmSsdEMVrUDff4yVTpBPiQ JGsghmnI0URTkj+RVSPcRq9w6opntGRtR8dkh1aTlgi/eDK36TfrybGsx2iFYfsy8ddw gaSi74LYtYBTkKjskgkLtHGEnI11J6RDdOrVApMVj1GM+ifdmvotBHyJsreAYE8VUHOI GBLz1aOWo1TGxgnayE2pL3/yJmIVqyyvbdsvyN+008pad6jnwSnGGeurPGmfAF16e8U1 dzdg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="w5AMC/ZO"; 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 X-Forwarded-Encrypted: i=0; AJvYcCXbF8kYm9TclknuiQRmCyjumflLRQY7MtplqQ0JCB+dTAGIPNo159xmjZOYgGgyn/CfDzGETDCupaymSjA2FOb2 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j5-20020a0ceb05000000b0067f60f66a13si1220172qvp.581.2024.02.01.21.56.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2024 21:56:18 -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="w5AMC/ZO"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rVmWb-00073U-HR; Fri, 02 Feb 2024 00:55:41 -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 1rVmWa-00071Z-Hn for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:55:40 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rVmWY-00039V-UX for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:55:40 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d9607f2b3aso3073395ad.0 for ; Thu, 01 Feb 2024 21:55:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706853337; x=1707458137; 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=xswm8Y4EVntAPydwJ8PJUaf0qkJ0h3e6mOU1vrp0dGE=; b=w5AMC/ZOg5b62eUEol6KHNgHQNHD1NyRUNVwhecLG+AtKsqkmBGjgrZcbmhiOZ534G +TdhdERVbNoM4Su/rOdw8CqJGraU8BEymHZmEOQRS+5z5UjZNhXDdC98CTbDBeQr9TVm Oh+nbRV3FMqxiEVrfQB1cTptquldnlsYKTnJ0VMlWbjOXykY9dhJsllClC8fe3Ro5laT R+7OaMZqngcflm6hsYEi8U4Cw5AzS5I+VB21HqB0wc7Al7OZfme8DcERQuJcp1SviqN+ 1AaldRQ9d7/6Mk2jf6vlhgOvQGurPr9nwv7WnjqXTx+0mu8GJCg17XxOWQ6bBnTSzs7k PmpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706853337; x=1707458137; 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=xswm8Y4EVntAPydwJ8PJUaf0qkJ0h3e6mOU1vrp0dGE=; b=CBPR3oDUHjYGsUgwTV8tRqKTy+X9R3I+ADgviWsGKyn4YJ/hZhosPSCHMbZlCynQ2G l7/TMnhgGWrbW7F0q7g0pJjQYHefkMgITamn04wiUpGBcXLQTDqEKokKaiNwHpENrH0d 2ECvlj7NqkKtDiyXgoNQaqHGkfJYRAzny1dnefE5y5Ljl2hxQgWh+LWWJ6LuBp4yWD8Y 7cK+Ir6aiI5dIJK0AhF39MAnpNVr756DpMrdmQK3j824+hoB7RZBPMqbvJzZyMf7uvYb hc+UthjlQMkknzTkQpC08qQp7rHsz38OuBVj5zeLgNUxocmazThCv8r2mS/EQricnUSk uh+w== X-Gm-Message-State: AOJu0Yw5Alh6pv1WzMgGZRmWLdtVQl+Y1N1athYaaL65KlFx8OqJ9UCZ GjknJVXJFeJqsrv0owGgnEBS2FfbCCFgzt4wfPSl/DgghV3T+RWmb3+lm0BUdBt1737Qd2IxROp eCSI= X-Received: by 2002:a17:903:32c5:b0:1d7:19ec:2eaf with SMTP id i5-20020a17090332c500b001d719ec2eafmr1943574plr.6.1706853337693; Thu, 01 Feb 2024 21:55:37 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id je5-20020a170903264500b001d8a80cbb15sm752059plb.238.2024.02.01.21.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 21:55:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 52/57] target/sparc: Clear cexc and ftt in do_check_ieee_exceptions Date: Fri, 2 Feb 2024 15:50:31 +1000 Message-Id: <20240202055036.684176-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240202055036.684176-1-richard.henderson@linaro.org> References: <20240202055036.684176-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Don't do the clearing explicitly before each FPop, rather do it as part of the rest of exception handling. Signed-off-by: Richard Henderson Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Message-Id: <20231103173841.33651-18-richard.henderson@linaro.org> --- target/sparc/fop_helper.c | 2 ++ target/sparc/translate.c | 16 ---------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c index 22b412adb5..64f20e78f1 100644 --- a/target/sparc/fop_helper.c +++ b/target/sparc/fop_helper.c @@ -50,6 +50,8 @@ static target_ulong do_check_ieee_exceptions(CPUSPARCState *env, uintptr_t ra) target_ulong status = get_float_exception_flags(&env->fp_status); target_ulong fsr = env->fsr; + fsr &= FSR_FTT_CEXC_NMASK; + if (unlikely(status)) { /* Keep exception flags clear for next time. */ set_float_exception_flags(0, &env->fp_status); diff --git a/target/sparc/translate.c b/target/sparc/translate.c index da4f167fa6..67bac6f65f 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4524,7 +4524,6 @@ static bool do_env_ff(DisasContext *dc, arg_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); tmp = gen_load_fpr_F(dc, a->rs); func(tmp, tcg_env, tmp); gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); @@ -4546,7 +4545,6 @@ static bool do_env_fd(DisasContext *dc, arg_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); dst = tcg_temp_new_i32(); src = gen_load_fpr_D(dc, a->rs); func(dst, tcg_env, src); @@ -4590,7 +4588,6 @@ static bool do_env_dd(DisasContext *dc, arg_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); dst = gen_dest_fpr_D(dc, a->rd); src = gen_load_fpr_D(dc, a->rs); func(dst, tcg_env, src); @@ -4613,7 +4610,6 @@ static bool do_env_df(DisasContext *dc, arg_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); dst = gen_dest_fpr_D(dc, a->rd); src = gen_load_fpr_F(dc, a->rs); func(dst, tcg_env, src); @@ -4661,8 +4657,6 @@ static bool do_env_qq(DisasContext *dc, arg_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); - t = gen_load_fpr_Q(dc, a->rs); func(t, tcg_env, t); gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); @@ -4685,7 +4679,6 @@ static bool do_env_fq(DisasContext *dc, arg_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); src = gen_load_fpr_Q(dc, a->rs); dst = tcg_temp_new_i32(); func(dst, tcg_env, src); @@ -4710,7 +4703,6 @@ static bool do_env_dq(DisasContext *dc, arg_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); src = gen_load_fpr_Q(dc, a->rs); dst = gen_dest_fpr_D(dc, a->rd); func(dst, tcg_env, src); @@ -4808,7 +4800,6 @@ static bool do_env_fff(DisasContext *dc, arg_r_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); src1 = gen_load_fpr_F(dc, a->rs1); src2 = gen_load_fpr_F(dc, a->rs2); func(src1, tcg_env, src1, src2); @@ -4903,7 +4894,6 @@ static bool do_env_ddd(DisasContext *dc, arg_r_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); dst = gen_dest_fpr_D(dc, a->rd); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); @@ -4930,7 +4920,6 @@ static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a) return raise_unimpfpop(dc); } - gen_op_clear_ieee_excp_and_FTT(); dst = gen_dest_fpr_D(dc, a->rd); src1 = gen_load_fpr_F(dc, a->rs1); src2 = gen_load_fpr_F(dc, a->rs2); @@ -4972,7 +4961,6 @@ static bool do_env_qqq(DisasContext *dc, arg_r_r_r *a, return true; } - gen_op_clear_ieee_excp_and_FTT(); src1 = gen_load_fpr_Q(dc, a->rs1); src2 = gen_load_fpr_Q(dc, a->rs2); func(src1, tcg_env, src1, src2); @@ -4998,7 +4986,6 @@ static bool trans_FdMULq(DisasContext *dc, arg_r_r_r *a) return true; } - gen_op_clear_ieee_excp_and_FTT(); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); dst = tcg_temp_new_i128(); @@ -5087,7 +5074,6 @@ static bool do_fcmps(DisasContext *dc, arg_FCMPs *a, bool e) return true; } - gen_op_clear_ieee_excp_and_FTT(); src1 = gen_load_fpr_F(dc, a->rs1); src2 = gen_load_fpr_F(dc, a->rs2); if (e) { @@ -5112,7 +5098,6 @@ static bool do_fcmpd(DisasContext *dc, arg_FCMPd *a, bool e) return true; } - gen_op_clear_ieee_excp_and_FTT(); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); if (e) { @@ -5140,7 +5125,6 @@ static bool do_fcmpq(DisasContext *dc, arg_FCMPq *a, bool e) return true; } - gen_op_clear_ieee_excp_and_FTT(); src1 = gen_load_fpr_Q(dc, a->rs1); src2 = gen_load_fpr_Q(dc, a->rs2); if (e) {