From patchwork Tue Oct 17 06:11:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734261 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp322410wro; Mon, 16 Oct 2023 23:14:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlBoCMhBKfbEUgdAO8Y/N0eUuudzl9j9ioqW/72aP/VEk0CNRejNz3pN0UFJuzRT9Qk1Ad X-Received: by 2002:a05:620a:1726:b0:775:93aa:cb91 with SMTP id az38-20020a05620a172600b0077593aacb91mr1427168qkb.35.1697523279405; Mon, 16 Oct 2023 23:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523279; cv=none; d=google.com; s=arc-20160816; b=Lui7g0hXwxQNepdazA0qc9Xoh/w4rJzC7re+Qp8fWMSjZVUotc0ziwbXmaUhLqEztj x0DAZwAvnv45Jhmj90V0cxa8hsqpndldk/KnKB5P1p8oIPp7QaKtszHKsJjbjKMu2AG1 vxEt4gTM6a2CXkfEXMzQRdVmYwy9nAYTl8zmnL7/4rePuQ6wauHf5T8DwRoC+CYkGVya HqTI/hlrpLVA98HOcwPzzMQf4+zcVHzZh5k0mvj9Y4eW0ze0WcYszE0IQqqwyt0bAX7C XggDTPyjmLXroCfezUlpN06TKLbc3OfgbpW/LDr16iDyvN/7xkBVFoM2oUp0jZTrUr3q IjGg== 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=uzIa5jkYKCXFsh4/+t2Ms/3odGLvuW7jHRTPUrJvLMI=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=U2FoeVZqWFhHTWump2n0dphKtO9XIm5w8CTbr45vx65Z7/z6T5REn+K6yNk3yabQ9K ocNUjign1hb9haDK2awWDKn4Py/eec65roJJKU+bQrEyz+qYs5j1DLv3qEi0ReGjYRup /Ivtb4ybIn2UcWz82eKrnpoe4fH0stu9hPpOmjA+7S7f+kWEXB164pVwEHyV0rM3uubz 2ZUUU5ol5qWqv8qCSr9VjGmHZW6p74XUdLJguBjFMm3p2eqJHFWEqnJ1WA7Mel5r7+Fc iLSNy2lNPE/xXCZEjPYLSFwXXr4FjnFaBLhKA4nVRYhQEDS7N7SvuZiyssYnPN7UuEjU 0xEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ygQJw8fW; 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 ee1-20020a05620a800100b00776fad0cc1fsi148881qkb.253.2023.10.16.23.14.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:14:39 -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=ygQJw8fW; 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 1qsdKY-0000oa-Na; Tue, 17 Oct 2023 02:13:26 -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 1qsdKQ-0000jo-5f for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:13:18 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdKO-0003xM-ET for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:13:17 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1c9a1762b43so42723305ad.1 for ; Mon, 16 Oct 2023 23:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523194; x=1698127994; 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=uzIa5jkYKCXFsh4/+t2Ms/3odGLvuW7jHRTPUrJvLMI=; b=ygQJw8fWLdrTmYGHrgb4KlsDPM1Dw6pFdTegNbVbvSYoyugItmVFgyDERx1O+Wf4pk eUJbKQMaKHmzQscCMzi+0K+fB2X1sRZxBhTeUVPvrDz443KMUuTGssuRvgNCREJe6pvP fOkG7dOGDsWn0lHaFrjL6S9lTjgjAgBlZcZqX3R9rBkT7UcNWvHhZUeRO82PJEr4Cazx FgJUXUaeqgld0FmfN/7LeT2OBkcYvZ/vIaoTCPfDAElbnrx1BrnX8YN3ECkF+UGTP07K cJC/S7aAFGkC4RZeMuMQjzDS2roDoPuBbRolWjTr132C+gYQw/xMV0TK/8pOyHTRoFMj Aaxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523194; x=1698127994; 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=uzIa5jkYKCXFsh4/+t2Ms/3odGLvuW7jHRTPUrJvLMI=; b=W2EWPy8cc86pzSFx+F2k7pUfhHe7TONS8NlnSOmSz9y4kZlZTZcOZTZMQyPQB4pdbw XxsTWhrnL7+aQWcJomXxvaC0PxuvXl9v/PrAv0U/Y3DqRkBL1oH0nJot0tfmBoJZ7Brd Cq6vAFofgtb05jZOD1U6zA4HX9Jeb7pzC64URQHlDU+ExDshEFdv38sp28PcXItN+QH6 b0HseYcP3UngiK87zy1UHJ5uuQ+ESHz5dlc/HFnT4/1m+umh01YDZypIwf3CudTQlYpd PYtPB6EkNQUr2n00SE9WO0j3og1oOElTI2MoF+zVrINmwQdBmNshu8NVzaLQI89f4fsO GdPA== X-Gm-Message-State: AOJu0YyrNGS32vxE8YOrjH0/E7IeWrODGCkrgQzHAJazAGSD9u7fzGol HorPf4DgKdCm8MpUjqoMCZxpfaUuAvELUMC9beE= X-Received: by 2002:a17:902:d48f:b0:1c9:f780:8070 with SMTP id c15-20020a170902d48f00b001c9f7808070mr1448922plg.19.1697523194447; Mon, 16 Oct 2023 23:13:14 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jf4-20020a170903268400b001ca21e05c69sm629150plb.109.2023.10.16.23.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:13:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 34/90] target/sparc: Move UDIVX, SDIVX to decodetree Date: Mon, 16 Oct 2023 23:11:48 -0700 Message-Id: <20231017061244.681584-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017061244.681584-1-richard.henderson@linaro.org> References: <20231017061244.681584-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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 | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 64f5885e67..a2512d8d47 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -178,5 +178,7 @@ SMUL 10 ..... 001011 ..... . ............. @r_r_ri SMULcc 10 ..... 011011 ..... . ............. @r_r_ri SUBC 10 ..... 001100 ..... . ............. @r_r_ri SUBCcc 10 ..... 011100 ..... . ............. @r_r_ri +UDIVX 10 ..... 001101 ..... . ............. @r_r_ri +SDIVX 10 ..... 101101 ..... . ............. @r_r_ri Tcc 10 0 cond:4 111010 rs1:5 imm:1 cc:1 00000 rs2_or_imm:7 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 30eb9bf94b..c2e4172872 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -53,6 +53,8 @@ #define gen_helper_write_softint(E, S) qemu_build_not_reached() #define gen_helper_saved ({ qemu_build_not_reached(); NULL; }) #define gen_helper_restored ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_udivx(D, E, A, B) qemu_build_not_reached() +#define gen_helper_sdivx(D, E, A, B) qemu_build_not_reached() #endif /* Dynamic PC, must exit to main loop. */ @@ -643,6 +645,16 @@ static void gen_op_smul(TCGv dst, TCGv src1, TCGv src2) gen_op_multiply(dst, src1, src2, 1); } +static void gen_op_udivx(TCGv dst, TCGv src1, TCGv src2) +{ + gen_helper_udivx(dst, tcg_env, src1, src2); +} + +static void gen_op_sdivx(TCGv dst, TCGv src1, TCGv src2) +{ + gen_helper_sdivx(dst, tcg_env, src1, src2); +} + // 1 static void gen_op_eval_ba(TCGv dst) { @@ -4187,6 +4199,8 @@ TRANS(XORN, ALL, do_arith, a, tcg_gen_eqv_tl, NULL) TRANS(MULX, 64, do_arith, a, tcg_gen_mul_tl, tcg_gen_muli_tl) TRANS(UMUL, MUL, do_arith, a, gen_op_umul, NULL) TRANS(SMUL, MUL, do_arith, a, gen_op_smul, NULL) +TRANS(UDIVX, 64, do_arith, a, gen_op_udivx, NULL) +TRANS(SDIVX, 64, do_arith, a, gen_op_sdivx, NULL) TRANS(ADDcc, ALL, do_cc_arith, a, CC_OP_ADD, gen_op_add_cc, NULL) TRANS(ANDcc, ALL, do_cc_arith, a, CC_OP_LOGIC, tcg_gen_and_tl, tcg_gen_andi_tl) @@ -4684,11 +4698,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) cpu_src1 = get_src1(dc, insn); cpu_src2 = get_src2(dc, insn); switch (xop & ~0x10) { -#ifdef TARGET_SPARC64 - case 0xd: /* V9 udivx */ - gen_helper_udivx(cpu_dst, tcg_env, cpu_src1, cpu_src2); - break; -#endif case 0xe: /* udiv */ CHECK_IU_FEATURE(dc, DIV); if (xop & 0x10) { @@ -4826,10 +4835,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) gen_store_gpr(dc, rd, dst); break; } - case 0x2d: /* V9 sdivx */ - gen_helper_sdivx(cpu_dst, tcg_env, cpu_src1, cpu_src2); - gen_store_gpr(dc, rd, cpu_dst); - break; case 0x2e: /* V9 popc */ tcg_gen_ctpop_tl(cpu_dst, cpu_src2); gen_store_gpr(dc, rd, cpu_dst);