From patchwork Sun Oct 22 23:29:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737231 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1284875wrl; Sun, 22 Oct 2023 16:42:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHo4AFJ/MdTWxYcCJp4Wr1mfdiuHMqBJV9c5OYfYh0m7Sk1DzvOmcuZKfNY9EK6HeWgbNOZ X-Received: by 2002:ac8:5a46:0:b0:417:cdad:4083 with SMTP id o6-20020ac85a46000000b00417cdad4083mr8369927qta.39.1698018149607; Sun, 22 Oct 2023 16:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698018149; cv=none; d=google.com; s=arc-20160816; b=s+24SVrWKe2BA+4Fi3JdVX6zn8uuslpqS/eViMr2Q7/aNG5dWPzLQf5TTDhW2rvpRP 13fDeMyGoY1/elT3+6QsS3JAMv4PI35D7vFUNjTWE95f6FLY1F4uCGzSElR7K/lIGoV0 wsKxofEK8wpici43k8qn6zgqzY3am6MgmvBxLvnEeBPUtWXiJiYDBdenOFV0AYTn9Emd HfFZAVfxJ/CBDASDa2GMq0fWgPYi7F+7cVOsfr9gTKiicrujWrLA/PjNnJQ6116si/BV GNo2uWtQkDtIfdaqex36Z6NjPnefPhHNl5V43OL2wIGUDhkCmUPiynXONNvH9t8e76CY hYdA== 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=y1jwu+dX3JxA0Jr4dP1slZrULRiUJNXonEUSUDKEKxQ=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=MyAXoUra1VBqIkZ4dCJ5fMC/7OpaCSBH5J2NKkxQoZSp/5SXVlt5j9lI5fjH7jFWkL 6Q4vooA/do7zXnCrl+e82i3DA6DqHuR6uEGjq7j+xgQio008OL8rh6amtH3QS2LND5hW tyHinpcCiALENecbfeqjWoOnrdKVwE98uUxTRPGU3DCyB6FBdyZFzbEEugbPGugDewog v0VuEirygbNTyw7IuDm7Umskr/fRRyLOaSXTuOWB64M9EaANxvnhyQ7KcC5tO1+5jl4L OePsESV6MzE5zKjdb24h6dgCyMSdcRLmeG6FdGL1+JlXt+9GNuvra+BwGp32StvSXVo1 nKfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OkWc324K; 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 d21-20020a05622a15d500b0040fe13367c8si4691356qty.243.2023.10.22.16.42.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:42:29 -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=OkWc324K; 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 1qui03-0007MI-0L; Sun, 22 Oct 2023 19:36:51 -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 1qui00-0007FP-AC for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:36:48 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhzx-0008Px-8v for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:36:46 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5b856d73a12so2036543a12.1 for ; Sun, 22 Oct 2023 16:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017804; x=1698622604; 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=y1jwu+dX3JxA0Jr4dP1slZrULRiUJNXonEUSUDKEKxQ=; b=OkWc324K6rXqeVl2bjXZa5d/m8JXJuwubTAySxKyVu422t5c2+1Z51yuSoLjsvwtqu pFaU8IXDbn19grnkyuZvuxBaO+9n1YTu6UC4lAFCtMumEiONQGKar439iXnZggidUZcK UUxBVEFId4aWbzz0lB3NRyM/0/v5ECLiwZhpwH5RzYLEd0XDdvLU4w3Y9w1sQ8EMGtIs glNHlGdhee9ppYystcsZCsBRyGKGkjJxC1cDfqKjrI1g3yYAxRE6T7U4ZzPidzffwOq1 Fkmd5DDcTpjzCR8OF9pksdNCofnP8VTr2UE280Mx6jOn74thQQPW0E2mtmEx5ktWpAc6 CQnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017804; x=1698622604; 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=y1jwu+dX3JxA0Jr4dP1slZrULRiUJNXonEUSUDKEKxQ=; b=MTh7QeGnv4NQnFEj/1CQY3iZxVRaRQk37d8yzCcvx7sXPKJU1ztlUlTejFNrE9SLCL 9Y44ceK7aADW60rH1DT3chzhtngFVtK7Gct2SjOI2fZk6xg4DwCKEArIPV8APgSg2SNz knpmfc19KwgowvWzRTzu6amaCgPmQ329SEq8Q6/L5icr2L86Uq1u1j1iykDiwPlBVlpi CAqaOAPFA7nvn8RToE61B6MmjO65+enGzsKs21SH7QJoQjOxLPYNi/hlzzFQP2s8nmvA psgk7GzsDbV6XLn4T10wIjvp85rRvL1JOXXsIJesrzL6ZJmLvbfkIcaj2ahVDnU7D9WZ 5NZg== X-Gm-Message-State: AOJu0YzcHF0sifh/EKIRN8zt1zvgJNK2MWhkrEyTvPVHUR8fCxBnGfUq /Mj3wEI3LC6ma/yyEZXK0xT9QDJBaD7IUYzLjUY= X-Received: by 2002:a05:6a21:4846:b0:13e:7d3:61d1 with SMTP id au6-20020a056a21484600b0013e07d361d1mr9522985pzc.12.1698017803942; Sun, 22 Oct 2023 16:36:43 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k26-20020a63ba1a000000b005b25a04cf8bsm4026861pgf.12.2023.10.22.16.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:36:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 82/94] target/sparc: Move gen_fop_FD insns to decodetree Date: Sun, 22 Oct 2023 16:29:20 -0700 Message-Id: <20231022232932.80507-83-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland 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 a19d191603..faf2bcef83 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -263,9 +263,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 88857dc2cd..92a443d61e 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -74,6 +74,7 @@ # define gen_helper_fmuld8ulx16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fpmerge ({ 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_pdist ({ qemu_build_not_reached(); NULL; }) # define FSR_LDXFSR_MASK 0 # define FSR_LDXFSR_OLDMASK 0 @@ -1700,21 +1701,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)) { @@ -4712,6 +4698,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)) { @@ -5052,10 +5061,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); @@ -5082,9 +5091,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); @@ -5109,9 +5115,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);