From patchwork Fri Oct 13 21:28:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733315 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1679934wrv; Fri, 13 Oct 2023 14:37:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHngBBnz0n3bHeYd7SM80B/BUxEiu3+szIDuapX3iHTWBSQ/t8msbBr8HLk8sm3Zuqjbuis X-Received: by 2002:ac8:7d10:0:b0:417:9a94:870b with SMTP id g16-20020ac87d10000000b004179a94870bmr31945101qtb.35.1697233019772; Fri, 13 Oct 2023 14:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697233019; cv=none; d=google.com; s=arc-20160816; b=csj7eAkIZWLe7w6CgEdgXIJj+7+LAW1lafI3qNy/+oa44TUODdxoo1nbOQC9GoDZjQ LTKlNDjzt7+iWA+5XEaeCHOuIKLF/ZbHOBZwHa0qTmOMXafqno7qQ2Fixzx7PEAoxpTU VQlPGXaYOQQ1EFuNdKLuJBJ9SFBGiSXgFlMnQHwNqq+nMrSZYH7F7guUON75L6C9hyyl g9RKsLzJC2ZAERUQOJ8/vxv6CA3UDn+wyUpx6XIbkYRp3ZvKHjQLEygQ3KvYGvH6HG+c HNWHhk2u7jsVgDkPZVEv8J5tzJ+K2XFV3tMDoS3eaOfjYKL0dRaAs9nCBv0FATYqkT7/ vuDw== 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=IHzaNUnemb4vfnsXuTxzxiTsIX5bUlSrxUwCk57sNRU=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=zYsDH3QHxgxQQb8YZ+ICOX/XvOr51HU9+dFQFEOh8vohoQAXV9TsBwhe0xevwzBB46 nq9QRmQcCwiFcu/ksQtTrqlx7wATv9InP2wfzXYeYjhIjSXP7UqJAyKh//RXSafUFJM2 OJuS4lkFqhWErdTRPBpRfH6/orf5uvlYcA9+lFvMmXEyKXdLYDseG/fnfKQlzRrxmV1M AU+XwJs617I15QFqco3XQToRh6IiFx49C4k++FneATFBLrKtrY/ULXWJrLUsNSmsvoEe JadTwPT7h5LcyaWgX9eQUMOnMBkHv1nXkwhGAdnUIVGNV0zoGP02hKxeDLxVCZuW4kWK NS6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XHfQ7yy2; 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 s9-20020a05622a178900b00417fed5d04bsi1865783qtk.685.2023.10.13.14.36.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:36:59 -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=XHfQ7yy2; 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 1qrPmT-00032p-QK; Fri, 13 Oct 2023 17:33:15 -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 1qrPmC-0001yh-C3 for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:56 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPmA-0001Yf-JF for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:56 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6b20a48522fso1017011b3a.1 for ; Fri, 13 Oct 2023 14:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232773; x=1697837573; 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=IHzaNUnemb4vfnsXuTxzxiTsIX5bUlSrxUwCk57sNRU=; b=XHfQ7yy2GrLajD08CNtmdit0wV2MtbwlM3YPyzUCxYNlzezXMZ6iPEqxktGy3aW319 PPBzHo6eRoBfL661MgiVWC4BibEFNhRi8bfUTQ9CzlafFvl8QB06fboYeIId/9APH5wS dQhxvSI+Ke0ZOqhwFb1SDYFl0MFuppG14e09yrDuS4+20PLVHgm1rxVvgXyEbu4Bo2Vh spjSlLFS+Q6Va8tKcolRPkiZ+z83SRjmSyaVmUV+Vt3VrhR8NuvHJ05JiFIfiQhF+RJb vN6B+UdzelM8arcxZrIUwrEJsPYERV1FlmTGHAoOT5DHgZpKFpsXf0RIP8a4LjRIgHt/ aBXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232773; x=1697837573; 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=IHzaNUnemb4vfnsXuTxzxiTsIX5bUlSrxUwCk57sNRU=; b=wEtFpoS2ncH24NZQQ9ofJMTZvOjeUkWIakv+WmWGJmA5huIdCf9U/LxgdL0YnL+Fhk sbGAgUKUPCVTnuv2yc4q9BuvyyKKxYtE+zRl0bSq+RhFTTNx4AJJT/Z0dGREKa8smqh5 HHYsDvVk5oen/56r5ifh8/OlB+aLz1MNX+1eiKtF2MXTMzqOV+WURmMckrf7/2b8UzV4 asSRwx6yRn3e1Ujaf0vGO48sk1we/J5lp3E43EUJ4OYxfOitoZ1p5zSREyoAABm6DfJ1 +K/69zysabmwtFnAvLtN2CTNAggLwCxsu3EII3Ah/njKUHiZBiTZFYz7GCsL8RNpPIPV F6Rw== X-Gm-Message-State: AOJu0YzrIMKqCenq7dwBqv7mm+oT/3DGkhlgvMNnsrWWFy9uQF5pKLlb DF4uZVwCzDzbu8V2mY8LibOJLwFm6hPwLqATN4U= X-Received: by 2002:a05:6a00:22c7:b0:68b:f529:a329 with SMTP id f7-20020a056a0022c700b0068bf529a329mr29346068pfj.5.1697232773343; Fri, 13 Oct 2023 14:32:53 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 71/85] target/sparc: Move FSMULD to decodetree Date: Fri, 13 Oct 2023 14:28:32 -0700 Message-Id: <20231013212846.165724-72-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::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.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 | 1 + target/sparc/translate.c | 43 +++++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 036e2b01d4..a52fac9352 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -254,6 +254,7 @@ FMULq 10 ..... 110100 ..... 0 0100 1011 ..... @r_r_r FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @r_r_r FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @r_r_r +FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @r_r_r FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 3446821a50..4b37a171ff 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1539,22 +1539,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -static void gen_fop_DFF(DisasContext *dc, int rd, int rs1, int rs2, - void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i32, TCGv_i32)) -{ - TCGv_i64 dst; - TCGv_i32 src1, src2; - - src1 = gen_load_fpr_F(dc, rs1); - src2 = gen_load_fpr_F(dc, rs2); - dst = gen_dest_fpr_D(dc, rd); - - gen(dst, tcg_env, src1, src2); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_D(dc, rd, dst); -} - static void gen_fop_QDD(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_ptr, TCGv_i64, TCGv_i64)) { @@ -4916,6 +4900,28 @@ TRANS(FSUBd, ALL, do_env_ddd, a, gen_helper_fsubd) TRANS(FMULd, ALL, do_env_ddd, a, gen_helper_fmuld) TRANS(FDIVd, ALL, do_env_ddd, a, gen_helper_fdivd) +static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a) +{ + TCGv_i64 dst; + TCGv_i32 src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + if (!(dc->def->features & CPU_FEATURE_FSMULD)) { + 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); + gen_helper_fsmuld(dst, tcg_env, src1, src2); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + static bool do_dddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -5026,11 +5032,8 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x47: /* fsubq */ case 0x4b: /* fmulq */ case 0x4f: /* fdivq */ - g_assert_not_reached(); /* in decodetree */ case 0x69: /* fsmuld */ - CHECK_FPU_FEATURE(dc, FSMULD); - gen_fop_DFF(dc, rd, rs1, rs2, gen_helper_fsmuld); - break; + g_assert_not_reached(); /* in decodetree */ case 0x6e: /* fdmulq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QDD(dc, rd, rs1, rs2, gen_helper_fdmulq);