From patchwork Sun Oct 22 23:29:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737047 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1282905wrl; Sun, 22 Oct 2023 16:34:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAJpAJLoootZFM4e6Wf6Z93c2tWPdBkQp4ApdALEFuEdHxObn1zEBrtQ9AtUzvAXwU55Rm X-Received: by 2002:ac8:5946:0:b0:41c:e009:6ad7 with SMTP id 6-20020ac85946000000b0041ce0096ad7mr8823352qtz.52.1698017654490; Sun, 22 Oct 2023 16:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017654; cv=none; d=google.com; s=arc-20160816; b=mBRLj7aj/qo8l9ZTeqGLvVyCjeHtMXhaXFLFbmqxvOgCibWHD66Mx3L6AkxF80rYjm 6ggGA18uWs1Ie0G5yaX0vELNlcuzCpqxBzCp5nP5YxC/aov42EUxWSeug4qC1nHkOcOU gEHs16sBJz42OfHYbj8x2UWIf3Y+e7DfRWkT8kjB3T7Okf+EIZsLmUskrDiXJjUiF+LM EIWtNARQPxvJnj8JCODqfpT4A6yzogh1TOAilzuGzKyujaHKN3FnepU/brw91GGmVv48 DW9iAcHuvbojXUX8QXzcMWB2v4S7C4aP0dXpglQLCWi6Wo2p1FekA+OayNFml4c5n9Wj fffQ== 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=/A+/aEu5nKFoGGCuyAZNsBHVSALjs1p5PFLe8pYDYdY=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=xzVSMk9/82VH5orY+mL7GN7JLLPkCdb/g+rbsR97ENmB3Rm/V8fU4tOo4PMaqq9uOx Q6enDtseLLAh/jF81SDn7YWff920vBabtepjXWvsYV3FaMrQP3bF7S73wmwglXpHvBha fN0iBokDz34uIdhewnJU1utfJQvN+J3VEgkznAjUP+CbHvgaPdCC0AyUeiin1ubTko5Q UqmDu6K9FRuVlu6pmVLwBiIy+4H/DwLqv7DjGf9a0go4rCCalw4eVgVYIvFUwW/MuHYF wwd7nEeK1X8DeFMiQv2YOSKDscl1LC/QN8MVbvcTt4dCbu57bUlUOU67berBwzf7TzuF CPJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NN/+ODYe"; 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 b6-20020ac87fc6000000b004199bf94c55si4641369qtk.197.2023.10.22.16.34.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:34:14 -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="NN/+ODYe"; 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 1quhwx-0006Uh-Bq; Sun, 22 Oct 2023 19:33:39 -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 1quhwr-00061P-QI for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:33 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhwo-0007el-Hl for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:33 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b2e4107f47so2107449b6e.2 for ; Sun, 22 Oct 2023 16:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017609; x=1698622409; 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=/A+/aEu5nKFoGGCuyAZNsBHVSALjs1p5PFLe8pYDYdY=; b=NN/+ODYesPDwA+30QsMnnehiufVrKiDiIquKuUowVC9b4tzRGgfk4Q1uxsG0p27Lz8 ok4i5CWJtPtGVMW+Kpm12XumLnkNSqYAMVOZvLo8Z/YyOeb48JwA4ZliqCcq0XoUMBGO GCOTYK6BCI6sOtLB0LLy1/OBRyLgVXpoNHA0ODoMIZ+nOw4cGqDx/zd3WBGb2D9OYx1A hiRlWybRJtxQGoaI0wpewBd5PaI0S8LNomn1PPxmai83d5EyyC0w0KCqmufWGEduPbIu qBgae3r0qSawoDMD9uG8fhhcI09omaGdTl2DaSMJC6hhBk/G4IGbFskQEu+L9qTPlfSw qd/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017609; x=1698622409; 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=/A+/aEu5nKFoGGCuyAZNsBHVSALjs1p5PFLe8pYDYdY=; b=F9KlT8BSolFDtr/DGITw2g32To3RVbAF7XPCWe7HH2GYI/Lj6Zh86DVBYc0phjUprg AOm/7rkE5du1/8rFwEk4no2SnU6tJv9sOQqkTfRWJvAOX9ozBjmsNYSp/kU6tZXQ48PW Huz3xY3JBp7uPNU8iln+XzkBs5HAuunU93uAnU/a3v+OKKijX01bjBtpAxZyHO7cx8uJ t8OrBujP00Stkwtx/am5vL5AHgId+Gz4uSMmS+AUlgu7CNdnqMioElwUMR1hzdN4U0PR tTD4JM2H2ENJcoZXTlRQF0d1DsX+5N/5SLuBcx1BX0ql0UEFYy7q7tRe5PiEZ7/U/v4S cMlQ== X-Gm-Message-State: AOJu0Ywls65rEd2kaJO3Q7nvprI6vZ80RLiIwKf2Kj6bbPJP9uDVuXyK gchCJ9I8x0Xj5ZbzKSVHGOM9jLuxIYtGT+q7f5E= X-Received: by 2002:a05:6808:1305:b0:3af:63ad:a610 with SMTP id y5-20020a056808130500b003af63ada610mr13198422oiv.14.1698017608981; Sun, 22 Oct 2023 16:33:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fe12-20020a056a002f0c00b0066a4e561beesm5182855pfb.173.2023.10.22.16.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:33:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 65/94] target/sparc: Move ADDRALIGN* to decodetree Date: Sun, 22 Oct 2023 16:29:03 -0700 Message-Id: <20231022232932.80507-66-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::22c; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22c.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 Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 3 +++ target/sparc/translate.c | 56 ++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index b15ede5fd4..f70423895e 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -252,6 +252,9 @@ RETRY 10 00001 111110 00000 0 0000000000000 ARRAY8 10 ..... 110110 ..... 0 0001 0000 ..... @r_r_r ARRAY16 10 ..... 110110 ..... 0 0001 0010 ..... @r_r_r ARRAY32 10 ..... 110110 ..... 0 0001 0100 ..... @r_r_r + + ALIGNADDR 10 ..... 110110 ..... 0 0001 1000 ..... @r_r_r + ALIGNADDRL 10 ..... 110110 ..... 0 0001 1010 ..... @r_r_r ] NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1 } diff --git a/target/sparc/translate.c b/target/sparc/translate.c index be298f185e..6a8835b8cc 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2747,18 +2747,6 @@ static void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr) } } -static void gen_alignaddr(TCGv dst, TCGv s1, TCGv s2, bool left) -{ - TCGv tmp = tcg_temp_new(); - - tcg_gen_add_tl(tmp, s1, s2); - tcg_gen_andi_tl(dst, tmp, -8); - if (left) { - tcg_gen_neg_tl(tmp, tmp); - } - tcg_gen_deposit_tl(cpu_gsr, cpu_gsr, tmp, 0, 3); -} - static void gen_faligndata(TCGv dst, TCGv gsr, TCGv s1, TCGv s2) { TCGv t1, t2, shift; @@ -4243,6 +4231,36 @@ TRANS(ARRAY8, VIS1, do_rrr, a, gen_helper_array8) TRANS(ARRAY16, VIS1, do_rrr, a, gen_op_array16) TRANS(ARRAY32, VIS1, do_rrr, a, gen_op_array32) +static void gen_op_alignaddr(TCGv dst, TCGv s1, TCGv s2) +{ +#ifdef TARGET_SPARC64 + TCGv tmp = tcg_temp_new(); + + tcg_gen_add_tl(tmp, s1, s2); + tcg_gen_andi_tl(dst, tmp, -8); + tcg_gen_deposit_tl(cpu_gsr, cpu_gsr, tmp, 0, 3); +#else + g_assert_not_reached(); +#endif +} + +static void gen_op_alignaddrl(TCGv dst, TCGv s1, TCGv s2) +{ +#ifdef TARGET_SPARC64 + TCGv tmp = tcg_temp_new(); + + tcg_gen_add_tl(tmp, s1, s2); + tcg_gen_andi_tl(dst, tmp, -8); + tcg_gen_neg_tl(tmp, tmp); + tcg_gen_deposit_tl(cpu_gsr, cpu_gsr, tmp, 0, 3); +#else + g_assert_not_reached(); +#endif +} + +TRANS(ALIGNADDR, VIS1, do_rrr, a, gen_op_alignaddr) +TRANS(ALIGNADDRL, VIS1, do_rrr, a, gen_op_alignaddrl) + static bool do_shift_r(DisasContext *dc, arg_shiftr *a, bool l, bool u) { TCGv dst, src1, src2; @@ -5145,21 +5163,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x010: /* VIS I array8 */ case 0x012: /* VIS I array16 */ case 0x014: /* VIS I array32 */ - g_assert_not_reached(); /* in decodetree */ case 0x018: /* VIS I alignaddr */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1 = gen_load_gpr(dc, rs1); - cpu_src2 = gen_load_gpr(dc, rs2); - gen_alignaddr(cpu_dst, cpu_src1, cpu_src2, 0); - gen_store_gpr(dc, rd, cpu_dst); - break; case 0x01a: /* VIS I alignaddrl */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1 = gen_load_gpr(dc, rs1); - cpu_src2 = gen_load_gpr(dc, rs2); - gen_alignaddr(cpu_dst, cpu_src1, cpu_src2, 1); - gen_store_gpr(dc, rd, cpu_dst); - break; + g_assert_not_reached(); /* in decodetree */ case 0x019: /* VIS II bmask */ CHECK_FPU_FEATURE(dc, VIS2); cpu_src1 = gen_load_gpr(dc, rs1);