From patchwork Sun Oct 22 06:00: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: 736993 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1006273wrl; Sat, 21 Oct 2023 23:14:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqkK453JTqA/d5w+1T5xbbws9nN6ak1z/BD/l8Fi8gjdCNTN/FptQFcsHUphS+QWuZuUiZ X-Received: by 2002:a05:620a:4015:b0:774:2e8f:2170 with SMTP id h21-20020a05620a401500b007742e8f2170mr5681990qko.4.1697955272696; Sat, 21 Oct 2023 23:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697955272; cv=none; d=google.com; s=arc-20160816; b=DZnkHULrxn4XB9N3sKi11mCor1bukqXe2sU/PBRMOP4G4Pr2cdkjGiaDW87EBBQ84A Gdy7BP3wvYhJkK6jbEHhi0f8PIZH5hmFPI90nEJa6rKkLv2+KrMtjEX7+9nQmzTw566U 6G7ldPl2+0qc4rYoqkpra79tifgIt9C3wOKm4EXuxzXSFExvBC4iF3FA6j11N/wg1pZ0 8dQ4tRQJ3Zmf4WT3SX/PT0wLd79SFXuWK91JBdc7UHSHWvIUtAx4TT4HGj5PJZN+f32q UXvvfOrZNpzXC6Yzb/jVeOUYCp3IsEFSMm5Uwvuvz9kCgfJkuzbo+cANJ/J8OCa+Had3 jrFw== 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=0dGIKHgnks7VMeLKQBJKmStofpnFqBucPOv5sSVTrkA=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=DM9atxQzHcVs0S64f8EM4pEaBpJ2afIx+gMqR+G2e6faFLYZ5fBG+yMsmahmUaHrny rp7EitC+7HjZUC4sCaITIQy0bccG7v2rdp7OmccmBppldzqKjXU6tJSCGkNzooXV+a8b qPrl+AccryHzWR8R89cqOxMh1tiecw3q88kb6ECLtlzIbUtptE47WrpV8CwwcskRmTdN VsVWMENE+lRBMvO8OmJUUWcgyV/NcyY/oEgGEGCKDdMqi0lBd2FViapDY1mGmZUGkeUU 7+K1dyegH3RcJwJp8BN5sEJwMkxfK7tpKgZQhWtFtFrxQWK5pyV4U2+r5ZHBA6xrD1XN jfOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UPg0JPYl; 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 u6-20020a05620a120600b0076da127884csi3589583qkj.223.2023.10.21.23.14.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2023 23:14:32 -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=UPg0JPYl; 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 1quRar-0003pe-G2; Sun, 22 Oct 2023 02:05: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 1quRa6-00011s-Oc for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:04:58 -0400 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quRa2-0002H8-Tg for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:04:58 -0400 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-581edcde26cso1439256eaf.1 for ; Sat, 21 Oct 2023 23:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697954693; x=1698559493; 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=0dGIKHgnks7VMeLKQBJKmStofpnFqBucPOv5sSVTrkA=; b=UPg0JPYlrpv8pOAo1ZNEi2C8yOT+CSYyHbWlzFQuVTNlMzRfTictkRJqSRpYiTHGzR XiDx/KwnmaHdFFDNelAZ+hnNnfqIfBs/LRMGjsDf8Xt8pdnGRXwHC9lxTPLZpRypaBny HI+oWNFcySs9agInxr605xnCE0Wuy+AFo8v4bqMHXp6RUoU/ZRqYj88kCWfcBKvjNutd lTzwlQkosRIx4+sNXRdeKbLP0U/YhO1j0rGngErq/tAZ45h9QEqCHRIQuIOLc8M4FQGE tMDOfenNk6KBvaAiu0+O8f8mAAxvZBxhGvo9WVduqSHjZzYz3GCYkhhckDgn8kskS7Rz 8g+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697954693; x=1698559493; 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=0dGIKHgnks7VMeLKQBJKmStofpnFqBucPOv5sSVTrkA=; b=OueEaqFoAOSRe4r93rlAeGBDbLejzHmLzKb2T8LFOeVKxOiZscUntGdcVKkq3TB40X +3gqfnZMBZGcOGyEEdAAikOlum0jQVLIwrbgCUxPseMVbcILyB3j8Gn0xNCS4THJrUav WgT5kXZwZ8aRmCoMVjKjZMtT36+emcx1GkpijZSQ9e21xSpTQGdBklJgw8jJTwVD91e5 UmbB9hjUWKobzB9BSeiKfTcHI4zvd6a1zgdm+HKkT1HJPqNyL472VxaYGg3Sqs4chvK1 u0G/HeKB0pvDemQ+60isyb2gTiVLb5JEwr8xJvKHZDvhQNYYkyQYoCiomrTANcfpaVjf s49g== X-Gm-Message-State: AOJu0YydBFvp6rXVMqfKkI6CQrgekK/oMMxKuDRRmiiMjrzrDcadnEYq MLFe5MqniIkYHnnyfgOCI0WFjHIzuwt/s9EzYCM= X-Received: by 2002:a05:6358:7211:b0:166:e43e:6f5b with SMTP id h17-20020a056358721100b00166e43e6f5bmr9880292rwa.16.1697954692858; Sat, 21 Oct 2023 23:04:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fb13-20020a056a002d8d00b0068a46cd4120sm4007373pfb.199.2023.10.21.23.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 23:04:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v4 61/90] target/sparc: Move ADDRALIGN* to decodetree Date: Sat, 21 Oct 2023 23:00:02 -0700 Message-Id: <20231022060031.490251-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022060031.490251-1-richard.henderson@linaro.org> References: <20231022060031.490251-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c31; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc31.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 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 794e997a58..9b9281feb7 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2729,18 +2729,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; @@ -4395,6 +4383,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; @@ -5308,21 +5326,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);