From patchwork Fri Oct 13 21:28:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733284 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1678945wrv; Fri, 13 Oct 2023 14:33:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+FmtYcTeZY/BoHrE6NA0rEUcXeD/58kp0vw7lHcceOqtR13TdTo4aFV4Hj5CXRN/rlzax X-Received: by 2002:a81:5b82:0:b0:594:e97b:f6fa with SMTP id p124-20020a815b82000000b00594e97bf6famr33279402ywb.30.1697232815139; Fri, 13 Oct 2023 14:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697232815; cv=none; d=google.com; s=arc-20160816; b=ID0ycjyG/hmFgJg920tqCnlZAOIP1ryxuENNV+gOt4gv6HvI3Uq6thyemHXb3s5sGD 2Jft/25od9Pa4esLKNk94RcV/opIS+aikI9kQvHrlWF9XcBET2VDMqn/7anF8hdFxJ4M 0PSKK1W/LurudmoaH+skXkWeVT2bphktmGKqBmoFxAHyWOz+Hy2sbXJygLr1Iiw4JS7P 2uEz05kepCX8b0jNUdbC9jyRNGJvRHpQWTRhApqPSA20e8LSDhjoMAMuUIo8t8PYZ5b1 ih+2yE7Amq/p8f/InsO/LLsxVU/QHJauxpjZEDw2v6dBZZ4YIRMTT7CAL6gnEdFSHXV6 9Wdg== 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=pbxnAZ0W5cYgIkkfggAEjUvdbJ7p+9d4s86p1nZfkxE=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=Qw19gFccagCmW79uFjr7PYDI1/uNQd3X3AeXeZLQ6e9W1tXIG20QoBXxYOdVQCVD6c jJrYjZXmCzTg2IkGffz0jg/Yny5B22zCjDsfkQ/AdsuRNPZnwOYPWbPN8Qnc886pzfPm VwuFjc+2YHN/oG4sMyRtFATjR2d2hDXnBiAThTDB4Cepel0GFT3/Y+CC5UHPWeWjh6xh wgrgmVj3R1iJdiAQUxc9498pxZxKn9fninwdGrRUKoEojL7pc3/IKyLt/XasENPVJnoP XbMfIZdheCY3H2gyE/sBsykTzv4zFamd9QQCOtuTo+NpVAzHiYNHTPheePHs/+6EbC7S lKrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="f/we05Rb"; 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 pi17-20020a0562144a9100b0066d1bae232esi1939162qvb.203.2023.10.13.14.33.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:33:35 -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="f/we05Rb"; 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 1qrPme-0003BV-9k; Fri, 13 Oct 2023 17:33:27 -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 1qrPmE-0002Ca-8w for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:58 -0400 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPmC-0001Z3-7Z for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:57 -0400 Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-79fe87cd74eso97907839f.3 for ; Fri, 13 Oct 2023 14:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232775; x=1697837575; 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=pbxnAZ0W5cYgIkkfggAEjUvdbJ7p+9d4s86p1nZfkxE=; b=f/we05RbEfsR1r3eO8omP0gXEShTnhDMkh/0A0l97hiRuk/ceGInJV83YqcGqy3j7G qEof09ObBQ/5nAe678co4eswRLTa/diIh4P0X79np2xwTaScTSkHE9WAXI7L5Rd6EhoA tJT1XkuVmgOaq+MSkzvaD4bYFHV/nzrKvtYwCxLSntgsBm6LUcWDXTOQTpDJMdf/9Zzv RzEVh0p6MuzOBo6TUFx+kkh6rOOIWFPYEq+SbQLgEM+iBq/Bv+ncd135mcrkNuUOUJW8 LGOQaf+NmSg8K4OM8USMCSbCOh7YdZzcRr6ne/M9BTYXy/lZ/8m9GtIwvZ+CEnQ8MiwP hMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232775; x=1697837575; 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=pbxnAZ0W5cYgIkkfggAEjUvdbJ7p+9d4s86p1nZfkxE=; b=CxXZ0frn/abSDVRVK38XeOh1to+mTDypQYYYEo+0KB00Uysxyk2APBGGwQnr39ITdG ZNZIhS8wYipXqYwJsF0a4HU+Zo3kREtQR0dKTHpovSl9fp03FhDNsbmmkOQtLWb2yxjm H+AnvCwh6Y9Tewa2Uev4rPpV84iYiln+440wferv2rapsT1jLIYiCCv8nP34+oK1XmHC igZp2ETD/g11fxbtF8VZaD1aIln2fiG+Ttz6nN2Zz2/dWtjVLzjkyQLHgGccR0HKBB2w fHtxcOjo5kiMz3pxiRTld4fIzvpdTpJ2jcRKtfLo5b0xYOTq8TpZCNsloR22uvbR3TqB GJmA== X-Gm-Message-State: AOJu0Yz97e71Ex1lpWXpDBrJwaf/BWe5yJ+G/0UGXdukWP4T9RcwuaXy Kgmq/UievZ9GHSL55yalDsgmfc0XScN1MZsG3SE= X-Received: by 2002:a6b:7a42:0:b0:792:884b:209b with SMTP id k2-20020a6b7a42000000b00792884b209bmr36074585iop.9.1697232775026; Fri, 13 Oct 2023 14:32:55 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 73/85] target/sparc: Move gen_fop_FD insns to decodetree Date: Fri, 13 Oct 2023 14:28:34 -0700 Message-Id: <20231013212846.165724-74-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013212846.165724-1-richard.henderson@linaro.org> References: <20231013212846.165724-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::d2b; envelope-from=richard.henderson@linaro.org; helo=mail-io1-xd2b.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 Move FdTOs, FdTOi, FxTOs. Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 3 +++ target/sparc/translate.c | 51 +++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 4063695cd9..6378dc5d07 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -257,9 +257,12 @@ FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @r_r_r FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @r_r_r FdMULq 10 ..... 110100 ..... 0 0110 1110 ..... @r_r_r FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 +FxTOs 10 ..... 110100 00000 0 1000 0100 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 +FdTOs 10 ..... 110100 00000 0 1100 0110 ..... @r_r2 FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 +FdTOi 10 ..... 110100 00000 0 1101 0010 ..... @r_r2 { [ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index b0efcb4551..c1a82b4c9a 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -57,6 +57,7 @@ #define gen_helper_fabsd ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fdtox ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fxtod ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_fxtos ({ qemu_build_not_reached(); NULL; }) #define gen_helper_done(E) qemu_build_not_reached() #define gen_helper_retry(E) qemu_build_not_reached() #define gen_helper_udivx(D, E, A, B) qemu_build_not_reached() @@ -1570,21 +1571,6 @@ static void gen_ne_fop_DF(DisasContext *dc, int rd, int rs, gen_store_fpr_D(dc, rd, dst); } -static void gen_fop_FD(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i32, TCGv_ptr, TCGv_i64)) -{ - TCGv_i32 dst; - TCGv_i64 src; - - src = gen_load_fpr_D(dc, rs); - dst = gen_dest_fpr_F(dc); - - gen(dst, tcg_env, src); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_F(dc, rd, dst); -} - static void gen_fop_FQ(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_i32, TCGv_ptr)) { @@ -4700,6 +4686,29 @@ TRANS(FSQRTs, ALL, do_env_ff, a, gen_helper_fsqrts) TRANS(FiTOs, ALL, do_env_ff, a, gen_helper_fitos) TRANS(FsTOi, ALL, do_env_ff, a, gen_helper_fstoi) +static bool do_env_fd(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i32, TCGv_env, TCGv_i64)) +{ + TCGv_i32 dst; + TCGv_i64 src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + dst = gen_dest_fpr_F(dc); + src = gen_load_fpr_D(dc, a->rs); + func(dst, tcg_env, src); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_F(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FdTOs, ALL, do_env_fd, a, gen_helper_fdtos) +TRANS(FdTOi, ALL, do_env_fd, a, gen_helper_fdtoi) +TRANS(FxTOs, 64, do_env_fd, a, gen_helper_fxtos) + static bool do_dd(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_i64, TCGv_i64)) { @@ -5040,10 +5049,10 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x4f: /* fdivq */ case 0x69: /* fsmuld */ case 0x6e: /* fdmulq */ - g_assert_not_reached(); /* in decodetree */ case 0xc6: /* fdtos */ - gen_fop_FD(dc, rd, rs2, gen_helper_fdtos); - break; + case 0xd2: /* fdtoi */ + case 0x84: /* V9 fxtos */ + g_assert_not_reached(); /* in decodetree */ case 0xc7: /* fqtos */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_FQ(dc, rd, rs2, gen_helper_fqtos); @@ -5070,9 +5079,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fdtoq); break; - case 0xd2: /* fdtoi */ - gen_fop_FD(dc, rd, rs2, gen_helper_fdtoi); - break; case 0xd3: /* fqtoi */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_FQ(dc, rd, rs2, gen_helper_fqtoi); @@ -5097,9 +5103,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_DQ(dc, rd, rs2, gen_helper_fqtox); break; - case 0x84: /* V9 fxtos */ - gen_fop_FD(dc, rd, rs2, gen_helper_fxtos); - break; case 0x8c: /* V9 fxtoq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fxtoq);