From patchwork Fri Oct 13 21:28:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733332 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1680376wrv; Fri, 13 Oct 2023 14:38:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9ojvwPGwL9N85ynFvONOJOKk+ibSg3pBB4P0Z38gwF3ouyeqtz8bl4JnCR54110Oh6Mql X-Received: by 2002:a05:620a:678:b0:76f:20df:f032 with SMTP id a24-20020a05620a067800b0076f20dff032mr23493285qkh.69.1697233116449; Fri, 13 Oct 2023 14:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697233116; cv=none; d=google.com; s=arc-20160816; b=KypoKfZc/JIqOevLztzr4IbQyfEFK+7DfrX+oTx+yj0R/o7+t83nrk8GlyQ8VptB6y KxYLXZGZ4oimkBx79IT9+B2hXPonhmBff9DVI9AqBmkEC9PRWktibQ7pZ/KaLuzRi44t SGPT18NgFryRJbCnyf3q6z/OxTvAXdVH6JFraBugfoV2rc0v2+bc6mMuPnjlemE6x6hU YOlnunuxxDD4xfkJORcm2yJ3LbELtx4CkY4jcFLpNpvejubD+Dnz5ItTfomMyDFb3CSY 5r3wQRqLJYyYQT8eXA4p9vwM+LOe/sXSrXNy1h32TOMjGeMxhpHCpLwuLQ4lSUW0LCkR xd6w== 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=FcfUpbij0skmnmwjAH/0sErdA7OfmBslk5mRhk5iwjE=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=ZH7iSdyGyYUxJ3wsLuJVw+6bfHQxHQSPiN9DQTbQ4UE0hpIjX4lD5KWeoicZuRl9xg sYBMsjrBPWqLxtMjtB9TXNIV6/B1xWJ9TdVCHBupp2o3kWigc9h3sbZ8V2nOWsz4fma4 h2CgOjA22vl8rxuhLiB7bQyDoDnb1trQ2R0IfPJTcQ6qa6rPoCQnXZdjQqeGHCxGTsAJ 3Djak3o4DMJNEtBWR6itGk78n78iM5Ov2QV7lX/NT9JcO6a6kolHz/davVLQa1UyLCCM u4/iVSSsB2k9dxz6kKQwDXXBZNoB+WdxBvlQgLW8Ti9aiweOrUOH/n5Ra2eO4jBHNHh7 buhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kQU654qK; 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 k21-20020a05620a415500b0076c81b9cd8csi1928693qko.739.2023.10.13.14.38.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:38:36 -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=kQU654qK; 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 1qrPm1-0000Tz-Ay; Fri, 13 Oct 2023 17:32:45 -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 1qrPlz-0000KV-Ka for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:43 -0400 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPlx-0001Rb-Db for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:43 -0400 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-57be3d8e738so1470613eaf.1 for ; Fri, 13 Oct 2023 14:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232760; x=1697837560; 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=FcfUpbij0skmnmwjAH/0sErdA7OfmBslk5mRhk5iwjE=; b=kQU654qK/feZo52pot6vKMy0rzASZRoZ8LjBI4juxNgTrARI/uMhKLWGDg+FhJjzcP xz/HBiApm3k8Z9XfnX+wrZ6skvBRKvhhecL21j8J0w6jr71j1Qyo7Gafnca0ElUjrvSM bkZroRwg3Ara8ksxe5x2FgP6rtw3l4EwWTT4d8e9DJSUfVoiORmSsTeBuWLt20bX/nb/ EZqgmsXftQFzviuGGVp+dCYq0UqVUz/FEwdlXFX7vVnLFKw3GP7QIUmcyzqEl4yoCewX ar+gkSBK+Q73mP2Tcvk1oPW8MCLaloqlfXt//inRZ5prPyL7xV+NEaYISVMNI3YruF2t tZuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232760; x=1697837560; 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=FcfUpbij0skmnmwjAH/0sErdA7OfmBslk5mRhk5iwjE=; b=BoDoZEiTMZSudk16jKiU8+flbIBEXi62/QtWUKHZiXxiLUqdCCQPhg3ljzzDqoUIPY 8ypVgz7fp/i9lj9oc+AwfYK3C0XXMg4aSvMXAtDpq7dJGZfg8co00mer4Ne4pJSUnz2N M/SDqAaOtzwUNvsmnlGa8Znd8T6UB/CZ4I6tVtTPlu+Ko6KKkf/ZfdMqJIcmUF7DMkzB tqQJG+pdIhaHbY6wWGbPVuOII4f1MhYmDwGdxTIH6ICxlUyeLaE7H+ambLxB0XapWNuZ 8IkRrckjWG/1cA9TaArywhDLzbiciAvbkY4YItnbXV7Sj9rM2VGtU2Xm0NJJQmTFMVmq oUNQ== X-Gm-Message-State: AOJu0YytIpNBsM6U0pRvwoE0w3WSBLWLU6BEBPI7lnB3r4J/wH0TWF46 h/n3Ccb5t1N/DynxRRcNz5dkcrM6MFd6QaRar98= X-Received: by 2002:a05:6358:9691:b0:164:8742:525 with SMTP id o17-20020a056358969100b0016487420525mr24323132rwa.17.1697232759960; Fri, 13 Oct 2023 14:32:39 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 56/85] target/sparc: Move ADDRALIGN* to decodetree Date: Fri, 13 Oct 2023 14:28:17 -0700 Message-Id: <20231013212846.165724-57-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::c2d; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2d.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 | 56 ++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index e8d49de888..f6ac8672c8 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -246,6 +246,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 c8685c6837..0392ef7cda 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2636,18 +2636,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; @@ -4276,6 +4264,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; @@ -5168,21 +5186,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);