From patchwork Sun Oct 22 06:00:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736987 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1006162wrl; Sat, 21 Oct 2023 23:14:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCOk/hq4v4I0o1n9QcTYGK5LgIWpgIWVY/6xPfcFV6yv+pvzq0ecMvqaYsmnrISQfCZsOt X-Received: by 2002:a05:6214:5004:b0:66d:9d4d:683 with SMTP id jo4-20020a056214500400b0066d9d4d0683mr6296268qvb.57.1697955244727; Sat, 21 Oct 2023 23:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697955244; cv=none; d=google.com; s=arc-20160816; b=p4SKJqdjRqDDOa2mjSOzgXKUMDgLr0RrSWTW2V2s69a1De1IRlyr8BPhVwvFJIX9hs 0U1WdUs3KEofgUR0Izjx/kMg2gMGkak/tv+8/9g7TSwHVKuhAP/D6mv3zWn4+HmNmrYw BMYvGpPXdJC+RUgIzfIQ1DSRfk9OI9kfNRzn9q+TRchFcVJmrrnvEbmeglKK6CsyNsjH v+ya3/TEj/vgjLQQprE5j0GWNwwEuxUJQ2KYWK3RPcsR2opaaBaZaCF0DEDwK2Itt1UY 4AUC7GnUmTBNUxgyz6vS1vrB3N77HR/ACxyX0lvTDLEtM3wniGN3BrAAzKDov7osfTH4 2BhA== 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=YZ9hakJU/7XWFxuxhG16/RDYerrbRSu2CkoxO0pU4Vo=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=i6GxsVPk0ALOwPQ0oV3J5YagF+XPJB3AtWZEVefRQokCYwbtR5P7z0Ak1NNBoJVwvT r8PTP1C0J8JHkU7bf7sJlznM8KXph0G+ilA76p8BwdwKab0a2+EvyzOUHkrWCMlhrJKS dQyvKKN8/fGtQ5TVsKUKrSzpu+XHU5Bq1e9ZjZqwbweyljIYES4kUkhryekrY1dEcP2l spBP4wHrUZqSOgu7afMYV7Ylb9Asm0wbOAXDMKGJNUbqGFcDH+8OOLvXaUx2Tjokc3wj r/JJJwbdGMrIPMVUPqsmODsNhckuBrZhQVEjjPV3lC3lNnMHgOsef6CS0eHOHFDuk2yW Cd2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LPGwujlc; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m7-20020a05620a290700b00779d17610absi443713qkp.608.2023.10.21.23.14.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2023 23:14:04 -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=pass header.i=@linaro.org header.s=google header.b=LPGwujlc; 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 1quRdR-0006On-OP; Sun, 22 Oct 2023 02:08:25 -0400 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 1quRdP-0006Gk-J4 for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:08:23 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quRdF-00035q-IU for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:08:23 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b201a93c9cso1611589b3a.0 for ; Sat, 21 Oct 2023 23:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697954891; x=1698559691; 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=YZ9hakJU/7XWFxuxhG16/RDYerrbRSu2CkoxO0pU4Vo=; b=LPGwujlc3cJxLYEPAV8h4D4rYH1UgJm2/rlmAb6e/CNXuI0txEQO+Z9AVjTQgUa/I+ 9VU8yRhBWm/In/JbaXGyKQ/AwVU2uy5y3p0UMmtDDjdP4/G59ElIYz0GNMUHsUmBUjuo vNF/dfHzeh0+mz0ZBYvvGF/HYkNn9BYc9l1fUXTpHZOhCjM9gabbgVmAYkCPXBQYNtr7 PVmD9ZxcM9mkP56SH3ulwnavsP6K/N39rb7zjb/pUYOBrt7q4SZrMSB/hM4HPwARR3kk F9U0h2w63AqVxK/9ZyniYSoI1AMC7HMCiQ2fZbXMOLludXMPs/DVvOT/xMVY1HitgqSJ wPMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697954891; x=1698559691; 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=YZ9hakJU/7XWFxuxhG16/RDYerrbRSu2CkoxO0pU4Vo=; b=BJK+AseSKDa5Vl64GBUrzq4/coD1zs0upl9VnEj6QI9nNH78oFnMff2CUajbwbo6hG oTswppAUet+J8zVa2r84SFDw5PiiafQ6Sf4jGDLY0uiM8yuccoc6os/RiY58zOWRsp/t 6Grj5Ly+oRODCBQZU+ZP4rpmbdthKtn9Pk28N8wOep3x3NvBjIvcMEw/hLy3alOVdnqs iFWgXspyA318R07QA0rILXyIR8R95Ue4NaYnGWn18mXFHubVzZqzRmLWB3eQ8Zd8fetp D19ZE4IephYelUWnIgj34B//NDqfTVnT4KDnR3NPAqf51GO2REZuyGBWyky4/rVuzVbA 5CPw== X-Gm-Message-State: AOJu0YxN8iqdCHbhn3yaY3itA1vzH/7XNWxuCP8CfNLgh/l9eitoCbFv NDKD0S1048IU7m06+B9Ty0epqET5R/zzFHWIA+Q= X-Received: by 2002:a05:6a21:a5aa:b0:174:af85:9626 with SMTP id gd42-20020a056a21a5aa00b00174af859626mr4791228pzc.11.1697954891260; Sat, 21 Oct 2023 23:08:11 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id li11-20020a170903294b00b001c444106bcasm3962919plb.46.2023.10.21.23.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 23:08:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v4 82/90] target/sparc: Move FiTOq, FsTOq to decodetree Date: Sat, 21 Oct 2023 23:00:23 -0700 Message-Id: <20231022060031.490251-83-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022060031.490251-1-richard.henderson@linaro.org> References: <20231022060031.490251-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 2 ++ target/sparc/translate.c | 44 +++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 7b65b31f89..c76e603f2d 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -273,6 +273,8 @@ FqTOs 10 ..... 110100 00000 0 1100 0111 ..... @r_r2 FiTOd 10 ..... 110100 00000 0 1100 1000 ..... @r_r2 FsTOd 10 ..... 110100 00000 0 1100 1001 ..... @r_r2 FqTOd 10 ..... 110100 00000 0 1100 1011 ..... @r_r2 +FiTOq 10 ..... 110100 00000 0 1100 1100 ..... @r_r2 +FsTOq 10 ..... 110100 00000 0 1100 1101 ..... @r_r2 FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 FdTOi 10 ..... 110100 00000 0 1101 0010 ..... @r_r2 FqTOi 10 ..... 110100 00000 0 1101 0011 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 6d3b0d6ce1..f2b7fec72a 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1669,19 +1669,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -static void gen_ne_fop_QF(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_ptr, TCGv_i32)) -{ - TCGv_i32 src; - - src = gen_load_fpr_F(dc, rs); - - gen(tcg_env, src); - - gen_op_store_QT0_fpr(QFPREG(rd)); - gen_update_fprs_dirty(dc, QFPREG(rd)); -} - static void gen_ne_fop_QD(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_ptr, TCGv_i64)) { @@ -4964,6 +4951,29 @@ static bool do_env_dq(DisasContext *dc, arg_r_r *a, TRANS(FqTOd, ALL, do_env_dq, a, gen_helper_fqtod) TRANS(FqTOx, 64, do_env_dq, a, gen_helper_fqtox) +static bool do_env_qf(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_env, TCGv_i32)) +{ + TCGv_i32 src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + if (gen_trap_float128(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + src = gen_load_fpr_F(dc, a->rs); + func(tcg_env, src); + gen_op_store_QT0_fpr(QFPREG(a->rd)); + gen_update_fprs_dirty(dc, QFPREG(a->rd)); + return advance_pc(dc); +} + +TRANS(FiTOq, ALL, do_env_qf, a, gen_helper_fitoq) +TRANS(FsTOq, ALL, do_env_qf, a, gen_helper_fstoq) + static bool do_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -5249,15 +5259,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0xd3: /* fqtoi */ case 0xcb: /* fqtod */ case 0x83: /* V9 fqtox */ - g_assert_not_reached(); /* in decodetree */ case 0xcc: /* fitoq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_ne_fop_QF(dc, rd, rs2, gen_helper_fitoq); - break; case 0xcd: /* fstoq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_ne_fop_QF(dc, rd, rs2, gen_helper_fstoq); - break; + g_assert_not_reached(); /* in decodetree */ case 0xce: /* fdtoq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fdtoq);