From patchwork Sat Oct 21 05:31:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736684 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp635543wrl; Fri, 20 Oct 2023 22:50:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IES5rwgbkgUUD/3bJVEWx7nIf00YpAeX0ewo9/7aZPjwFuSGZ+xs4wNRFKbEMWQ6e56vi9D X-Received: by 2002:a05:620a:24cb:b0:775:9f94:1a7b with SMTP id m11-20020a05620a24cb00b007759f941a7bmr4611604qkn.0.1697867420598; Fri, 20 Oct 2023 22:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697867420; cv=none; d=google.com; s=arc-20160816; b=tNvq0Cfm4l08tPqdNitNLjuAfBxNJnReiU1TT8ohQ2ErciT7ytbHkijaY3YSDaIIbL QK82E++XJV2q/ntTuu9kKon+QFEsMecHf3K9eban050qQ/MEXKwTizx46YSPAzpJcMgW gIUoXpJhv128c7jVyAsJjZmdHWU6gWsfRVi+kocpqmjZ0x6SxLR+whSzRqNZtANt2/js LXU/6666Bu35TXJTM6YViinlFwdqIxyRSZLuu1p0q55EFvLVnNLhd09GNbqOy1pr849l zd0UJdOFoLSLn0ffQ6EXskz0QOR9YIamNk8o+6585QzL8EcApqNlgHMTD4a91rMrsaCg PKEA== 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=zCddgK7z8uallbPSoWf9fgqngcXvdNDUOKMBy07dabs=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=GORO/MPrPGid/RsVLJvhE5I51WQjnFqXG/r5BS4hl2a9cq4ZIq5cy41rQh8q6DQgtS PqtYDCrs/u+0hHaS1UhKwlKBcMA09dO49bYthhBw8AprpNMgo5ZdFP8MTQal3A45/ick 4BTuyIDgd9mxC9vJ4R92ZRT9zAlucytC6l1+8zm+YBwMRw+4dXI0jGP7EjtJHwT6EM4l l5/1QYPtyfPgV+4Q4av2MOlua28O/35O9Lte7HzUkg6fWwo1qFJHKKDs5lT/HTRIyVGF Z6h6f5HHQQOSFLgOh+197lvnrtBAXzz6lbGETLbwYf+NEoUa5AjRowrgkH/Bylp19J7K tDzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DxC0kLCd; 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 vu7-20020a05620a560700b007759bc3be67si2402169qkn.91.2023.10.20.22.50.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 22:50:20 -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=DxC0kLCd; 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 1qu4bK-0007KX-Bp; Sat, 21 Oct 2023 01:32:42 -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 1qu4bC-0007Gb-E0 for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:32:34 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qu4b9-0008TF-1l for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:32:34 -0400 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3b2d9ac9926so1044328b6e.2 for ; Fri, 20 Oct 2023 22:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697866347; x=1698471147; 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=zCddgK7z8uallbPSoWf9fgqngcXvdNDUOKMBy07dabs=; b=DxC0kLCdWE8xI3Yg3r1CzmR6sWugRJcN/tApWGCxU0brecaea2hCa4ceNql4WFLPgJ k7YMFK2GQLmUR409FTy15LcZPWiPT/CbuPtfOO81lzxEFegeYLsXA3OI0IYPMzdxEDT2 IZd9OMJ0irf8kU0DXzE1h8e+uR6Xz56rZYmOtMGYMhmKAVFMkvupGnDn1CvApwCDdjSV iULC8j3SEXaKRFJ+ST6pXWevhfQPCelNkFJ/N63vXx6E96F9aOymyCF2Vs9C9BvzUyS4 nrIW7HviTgbvYtsBO7NY71oO30xuNXN1r2VHth7yrV5AY+OQLKy1Hxydnv53i+FKsnqs fr/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697866347; x=1698471147; 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=zCddgK7z8uallbPSoWf9fgqngcXvdNDUOKMBy07dabs=; b=adqsHlug+YPvP+23wTKAcJ+k/N5eYAsBjMQ61fZSq5ejHPLDr48RhdC/Z5fMz4tN3o uNQpbzarHWCMgspTWD3DwQSRyvNzr5AV5DaJXd8rFu4t9yDISpm1jQ9Svf1IMnfM0cz+ g2thkA789x945TW6wW8KZg9UToYPkxasOABxvOnully9lawPRbziDzwxBuUzj6uTNz0a 8f888TqRpckcASRoe4JFpvaciIvDUGl3R8ITj4ckxmT+uEYWA9a/gYmGIfTLy3ilRlQd jB8Xl5W5Te1YRBxhl1eWQjouLKDk3qozplspleObs5mJ4+6CqKjtn2Dd13aGCzEtFWuT nRCg== X-Gm-Message-State: AOJu0Yy/Q6UQFGOD64Rg98WINpBcj22HS9ufTDGaaFny104rHm+6h8mV vUIz8h5wL7ExgGY/KRNYsvl31fI5V7mmbLzABlU= X-Received: by 2002:a05:6808:150a:b0:3a7:6213:6899 with SMTP id u10-20020a056808150a00b003a762136899mr4923188oiw.24.1697866347705; Fri, 20 Oct 2023 22:32:27 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id f20-20020a056a001ad400b006b2677d3684sm2434831pfv.206.2023.10.20.22.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 22:32:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 34/90] target/sparc: Move UDIVX, SDIVX to decodetree Date: Fri, 20 Oct 2023 22:31:02 -0700 Message-Id: <20231021053158.278135-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231021053158.278135-1-richard.henderson@linaro.org> References: <20231021053158.278135-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 | 3 +++ target/sparc/translate.c | 23 ++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index ca54a090a3..94a85e488a 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -171,6 +171,9 @@ MULX 10 ..... 001001 ..... . ............. @r_r_ri_cc0 UMUL 10 ..... 0.1010 ..... . ............. @r_r_ri_cc SMUL 10 ..... 0.1011 ..... . ............. @r_r_ri_cc +UDIVX 10 ..... 001101 ..... . ............. @r_r_ri_cc0 +SDIVX 10 ..... 101101 ..... . ............. @r_r_ri_cc0 + Tcc_r 10 0 cond:4 111010 rs1:5 0 cc:1 0000000 rs2:5 { # For v7, the entire simm13 field is present, but masked to 7 bits. diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 2c9f5ec317..d0b570eb08 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. */ @@ -685,6 +687,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) { @@ -4192,6 +4204,8 @@ TRANS(XORN, ALL, do_arith, a, CC_OP_LOGIC, tcg_gen_eqv_tl, NULL) TRANS(MULX, 64, do_arith, a, 0, tcg_gen_mul_tl, tcg_gen_muli_tl) TRANS(UMUL, MUL, do_arith, a, CC_OP_LOGIC, gen_op_umul, NULL) TRANS(SMUL, MUL, do_arith, a, CC_OP_LOGIC, gen_op_smul, NULL) +TRANS(UDIVX, 64, do_arith, a, 0, gen_op_udivx, NULL) +TRANS(SDIVX, 64, do_arith, a, 0, gen_op_sdivx, NULL) static bool trans_OR(DisasContext *dc, arg_r_r_ri_cc *a) { @@ -4714,11 +4728,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) { @@ -4856,10 +4865,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);