From patchwork Thu Nov 2 01:28:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740363 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594756wrv; Wed, 1 Nov 2023 18:36:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPHnvXOZKGCzsySzYxtkd8ySNjtQ9beCJc5Q+lq63CSOXq1HjfQ6Sv3MKabtisTIp/lyl4 X-Received: by 2002:a05:620a:c41:b0:775:92ac:a3d6 with SMTP id u1-20020a05620a0c4100b0077592aca3d6mr10447448qki.14.1698888981031; Wed, 01 Nov 2023 18:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888981; cv=none; d=google.com; s=arc-20160816; b=dwrMsSetfTkTKMxZtadaeaZll3OnouEpFY6lJQoLf75a8pkebJAkl0V6K+7gaTPbyS gzBTkFg9hNGD8Sp3+4varJ8jWnKzRsfE/EV0qw7Fobyl9NDz0smHL2CfcRWzKJUSu1MC ySA15HgbRPu9NZp3+yMnZSQuB+ydV5PK0TsBJSDeUVCRlM56JWe1Gk2TZHGVg4Ocl7Sf Vnv6hTNFMiFLPovEi3rYCk1Gn6zzC3ewphLNJmaBWwKRlmLPAcdHNvbaGxiS666H1I/v qTA0GrWxFIETJYZuG1ptWMu9QoSunmygm1sKz/GhvT7au870Y9ZNx22t5lmTnNKSOoQv 9S0Q== 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=u6kOr3bnmnyAyVHH0Y0iv4quWP9D74WtGN7YLIlIm3w=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=IB5k7NwpXmBk+LntG7aOxcuHxKod32vfgNI6uBIeN/5hHm8nNZTWdBSUarsiFy2pnm rCDA8F58Hht9VcwZZmX8Mf9LKcdgoOHJh9AI7yA66VijDWdBCjtAO4t1myeXq+SQNcQK zEG7heHa9thTBvFIWWlHjO0ikCQVju2jlVcT9sDDt9I6kOWRwYhuttZOdv63e3Fmfxz/ E2wp7wdK7kGW8VNY+KlQFZrNnZST2n8iepWH9sC7rag576mj9MitmW/M4jJs5IVZidRN ntpkV9I8vYbM4DcOQwfI1bDLcM3expHHTGbnWwv6PIaWSXTqTZogZwHqXvjp+VCmNPvY 7h3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hyikjY1d; 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 s3-20020a05620a080300b0076ca1b8aaf6si3372772qks.634.2023.11.01.18.36.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:36:21 -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=hyikjY1d; 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 1qyMXi-0005iI-0J; Wed, 01 Nov 2023 21:30: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 1qyMXY-0005Ut-EN for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:32 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXU-0001Tu-8r for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:32 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6bd73395bceso406867b3a.0 for ; Wed, 01 Nov 2023 18:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888624; x=1699493424; 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=u6kOr3bnmnyAyVHH0Y0iv4quWP9D74WtGN7YLIlIm3w=; b=hyikjY1dKprd92Mn5O2dK09PkVLn0fbOj8wYT3K5HodcRchG8tXGYfl2gowOXTWvsh 9XN/oz2iGtWazPvCRwkh9gTVIcb6iu3o3+pUlEEXnQjGlGZHpw9AfF1f9qhymyupOKAO IWwVTVsn46CvPgxpVmZpCcJXyplfupKKM5SvgWJLRHV6aDhEz5vMTZCfy3YV1BTR4gpE Z9vGvdu2ZnxGHItCuNrdeDlb0MgDoXiGdZ7dNS+HTOQFiJX9AfDG/FrDErIj3hn/QOWF 9hBygEaXi1GMa667wAepmIuehKUBJYrc9roZIOiD9w2HBOJWqZ+DA/Fibu/SFUa7nbtY Muvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888624; x=1699493424; 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=u6kOr3bnmnyAyVHH0Y0iv4quWP9D74WtGN7YLIlIm3w=; b=kho7R80kvErCeRBh0DqaQZbQ0XXYqX5RC0rbV0vd+Rc5Xz3v27dvphop86lHD6A+oP tvmretLDk7EMHLy/8mSTF5VIqAkKSNEgAeyOjcrStIESPLf3cNBS5lSI1ivEcT4L1kku +mBBb+2ZiNeUM+Avwix0uEq1xLYOe0YSvc+lP3KFS6myMRAuz3hIBwaBDml6aWKq9EJ1 Q9RsGyzUFie74nCghdQN2OqHWjM1Bpy5ISJDIrCwB7Dl+YiNuuAJNKtfzDaXouOCDEll QWYoXXVow4aeBPz1GZDvFLgGkfxapdGlc8TAMEPL/KpC4i60X2lcet7ZO80Y/OzKLwKd uwXA== X-Gm-Message-State: AOJu0YwHztgaDMRelqKelOJ5Eg7icXmJJUPozlpnrK6M0wYxDPlvR6gD QSr6rssKR3y5gAesienwnuWGmTL/N6IOK8FgQiA= X-Received: by 2002:a05:6a00:4e46:b0:68f:cbd3:5b01 with SMTP id gu6-20020a056a004e4600b0068fcbd35b01mr5598882pfb.13.1698888618390; Wed, 01 Nov 2023 18:30:18 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 01/88] target/hppa: Include PSW_P in tb flags and mmu index Date: Wed, 1 Nov 2023 18:28:49 -0700 Message-Id: <20231102013016.369010-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Use a separate mmu index for PSW_P enabled vs disabled. This means we can elide the tlb flush in cpu_hppa_put_psw when PSW_P changes. This turns out to be the majority of all tlb flushes. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 36 ++++++++++++++++++++++++------------ target/hppa/helper.c | 8 -------- target/hppa/mem_helper.c | 6 ++---- target/hppa/translate.c | 5 +++-- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 798d0c26d7..48d735929e 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -30,21 +30,33 @@ basis. It's probably easier to fall back to a strong memory model. */ #define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define MMU_KERNEL_IDX 11 -#define MMU_PL1_IDX 12 -#define MMU_PL2_IDX 13 -#define MMU_USER_IDX 14 -#define MMU_PHYS_IDX 15 +#define MMU_KERNEL_IDX 7 +#define MMU_KERNEL_P_IDX 8 +#define MMU_PL1_IDX 9 +#define MMU_PL1_P_IDX 10 +#define MMU_PL2_IDX 11 +#define MMU_PL2_P_IDX 12 +#define MMU_USER_IDX 13 +#define MMU_USER_P_IDX 14 +#define MMU_PHYS_IDX 15 -#define PRIV_TO_MMU_IDX(priv) (MMU_KERNEL_IDX + (priv)) -#define MMU_IDX_TO_PRIV(mmu_idx) ((mmu_idx) - MMU_KERNEL_IDX) +#define MMU_IDX_TO_PRIV(MIDX) (((MIDX) - MMU_KERNEL_IDX) / 2) +#define MMU_IDX_TO_P(MIDX) (((MIDX) - MMU_KERNEL_IDX) & 1) +#define PRIV_P_TO_MMU_IDX(PRIV, P) ((PRIV) * 2 + !!(P) + MMU_KERNEL_IDX) #define TARGET_INSN_START_EXTRA_WORDS 1 /* No need to flush MMU_PHYS_IDX */ #define HPPA_MMU_FLUSH_MASK \ - (1 << MMU_KERNEL_IDX | 1 << MMU_PL1_IDX | \ - 1 << MMU_PL2_IDX | 1 << MMU_USER_IDX) + (1 << MMU_KERNEL_IDX | 1 << MMU_KERNEL_P_IDX | \ + 1 << MMU_PL1_IDX | 1 << MMU_PL1_P_IDX | \ + 1 << MMU_PL2_IDX | 1 << MMU_PL2_P_IDX | \ + 1 << MMU_USER_IDX | 1 << MMU_USER_P_IDX) + +/* Indicies to flush for access_id changes. */ +#define HPPA_MMU_FLUSH_P_MASK \ + (1 << MMU_KERNEL_P_IDX | 1 << MMU_PL1_P_IDX | \ + 1 << MMU_PL2_P_IDX | 1 << MMU_USER_P_IDX) /* Hardware exceptions, interrupts, faults, and traps. */ #define EXCP_HPMC 1 /* high priority machine check */ @@ -249,7 +261,7 @@ static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch) return MMU_USER_IDX; #else if (env->psw & (ifetch ? PSW_C : PSW_D)) { - return PRIV_TO_MMU_IDX(env->iaoq_f & 3); + return PRIV_P_TO_MMU_IDX(env->iaoq_f & 3, env->psw & PSW_P); } return MMU_PHYS_IDX; /* mmu disabled */ #endif @@ -299,8 +311,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, *cs_base = env->iaoq_b & -4; flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; #else - /* ??? E, T, H, L, B, P bits need to be here, when implemented. */ - flags |= env->psw & (PSW_W | PSW_C | PSW_D); + /* ??? E, T, H, L, B bits need to be here, when implemented. */ + flags |= env->psw & (PSW_W | PSW_C | PSW_D | PSW_P); flags |= (env->iaoq_f & 3) << TB_FLAG_PRIV_SHIFT; *pc = (env->psw & PSW_C diff --git a/target/hppa/helper.c b/target/hppa/helper.c index a8d3f456ee..cba8160b3d 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -51,7 +51,6 @@ target_ureg cpu_hppa_get_psw(CPUHPPAState *env) void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) { - target_ureg old_psw = env->psw; target_ureg cb = 0; env->psw = psw & ~(PSW_N | PSW_V | PSW_CB); @@ -67,13 +66,6 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) cb |= ((psw >> 9) & 1) << 8; cb |= ((psw >> 8) & 1) << 4; env->psw_cb = cb; - - /* If PSW_P changes, it affects how we translate addresses. */ - if ((psw ^ old_psw) & PSW_P) { -#ifndef CONFIG_USER_ONLY - tlb_flush_by_mmuidx(env_cpu(env), HPPA_MMU_FLUSH_MASK); -#endif - } } void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 350485f619..729032288d 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -144,7 +144,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, } /* access_id == 0 means public page and no check is performed */ - if ((env->psw & PSW_P) && ent->access_id) { + if (ent->access_id && MMU_IDX_TO_P(mmu_idx)) { /* If bits [31:1] match, and bit 0 is set, suppress write. */ int match = ent->access_id * 2 + 1; @@ -373,9 +373,7 @@ void HELPER(ptlbe)(CPUHPPAState *env) void cpu_hppa_change_prot_id(CPUHPPAState *env) { - if (env->psw & PSW_P) { - tlb_flush_by_mmuidx(env_cpu(env), HPPA_MMU_FLUSH_MASK); - } + tlb_flush_by_mmuidx(env_cpu(env), HPPA_MMU_FLUSH_P_MASK); } void HELPER(change_prot_id)(CPUHPPAState *env) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 9f3ba9f42f..f6a656325c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4071,8 +4071,9 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->unalign = (ctx->tb_flags & TB_FLAG_UNALIGN ? MO_UNALN : MO_ALIGN); #else ctx->privilege = (ctx->tb_flags >> TB_FLAG_PRIV_SHIFT) & 3; - ctx->mmu_idx = (ctx->tb_flags & PSW_D ? - PRIV_TO_MMU_IDX(ctx->privilege) : MMU_PHYS_IDX); + ctx->mmu_idx = (ctx->tb_flags & PSW_D + ? PRIV_P_TO_MMU_IDX(ctx->privilege, ctx->tb_flags & PSW_P) + : MMU_PHYS_IDX); /* Recover the IAOQ values from the GVA + PRIV. */ uint64_t cs_base = ctx->base.tb->cs_base; From patchwork Thu Nov 2 01:28:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740397 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596232wrv; Wed, 1 Nov 2023 18:42:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhzcLjQuT+RfIl/h55WsWqrwkCQNH/IWs4feUvrjHsvi8J/jd79O5yrhP+NPlC3uUh2Xlb X-Received: by 2002:a05:622a:2a81:b0:401:e2b1:d28d with SMTP id kf1-20020a05622a2a8100b00401e2b1d28dmr13053241qtb.20.1698889327601; Wed, 01 Nov 2023 18:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889327; cv=none; d=google.com; s=arc-20160816; b=U6gVF8qo8xfxH3CUGcwtRTaBsPDZxAhkHfkNAFv27ViluXFbi5oEz97gL03ciu3B/M vYGFtX5om/0yoVW35LomWEKHo9ySzs+4EgdKFnwT1yOl/NSALk0bMXQogiOnm6NhfSFq yycutpQ4yR0L9AE3zWGIfUe0G3mhN8A4TYa65A3K7qOY7pHcwL7FjLRqU3hB6pmh4MXP D/76RrXWCYf6mLA8ldJD7/aWYVt2G620zAqCYFLsYJZUo8lD/N9F+6O0Nim6SArRARsk mlAxf7Q2GELXpB3qY8R4n51jJw7MGD8/vDmUU6AXqThBjRURucNQYj5IwLEiX01dnOmf 3ecw== 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=QSghWCh0/B7R9F9ofg2fe1rpCsLVBNYGTwryZzXKsFo=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=N6mVSPehowHZNWhDcSthMsc6XHYP4DR8pp7ia4rzA/fYLOgkhlo31h40qvCMnua1hs iTkGLCW5DSNqoPlXfCEdz6nRRB5OZjqLnnN2CH2booQylwP9GxlPGMaw1DWTvikxPaUn u3jqQQqeH7EiS82TzCAELOO+QVxo1Xi4n6gDL0Gu2fQEFr+t/Knn3z911RN9RvjgRrZw 2/vI0v2Ou0WkewC6rmkbEdTHzAlmF/XWj/5WjFSCxdN9/3KyCA1quaEVz3bbOD+kfSa+ 1kfaeHC/0Y/gvTSdtQ7zG6PhL5f/Lb8eFANiFj2wzYoLK7l65O/TOCKtfH5lpVL1bzOm iZvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IZyAakk9; 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 r16-20020a05622a035000b0041999744a78si3735702qtw.335.2023.11.01.18.42.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42:07 -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=IZyAakk9; 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 1qyMXg-0005gJ-OU; Wed, 01 Nov 2023 21:30:40 -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 1qyMXa-0005YY-F0 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:34 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXV-0001WS-AR for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5a9bf4fbd3fso309658a12.1 for ; Wed, 01 Nov 2023 18:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888628; x=1699493428; 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=QSghWCh0/B7R9F9ofg2fe1rpCsLVBNYGTwryZzXKsFo=; b=IZyAakk9byWvC0Hsm4rEr6G4MGEboLWZNMd0vbWReSdODAk7zJEFqDQCWz1ErYULWG cT525thy/E85cHfEjMAtMhfNKKb9YuViZx2wIM95bxHxebE91JgEK7XI50D3dWf740A7 tuNRRo/W7qVxH/5JtOniVVYM4wKuIU48O160qS7gD3HPRllprqB/O1bzCJP7uE5U4EAl SH855XwGX+NTrGTSmcDTyCt6Dfq0HB3I7UHGFtFwPcmC2UOD+C3FPw7OpscZuT2uWE0+ HsDSol50yV0w3UjshTL/vyhMskpNpphKpHb8VAAcUEAHobGdvbbAj+i7E/NEZ1IT4Zoo RKLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888628; x=1699493428; 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=QSghWCh0/B7R9F9ofg2fe1rpCsLVBNYGTwryZzXKsFo=; b=XqmWOPfczqym77r6a5W+/9P/2TsM61rjUsfPT15NxiynPrGw9fdBuXHC8i+VJDKXpI bEJDyXM8yCmEixoBIK1uTomtfp6nr4GzEKK3UsCVHtI6aVD6EMwWnRcYqd/sVk0p1ixG cifrQk6GwIKVxeAkmrmKrj184KENgNFAlTSGbmQtiSXwImz4U3ltuG6hrUC/0dWRbvKM Kavo9+ePtcyQGlWlxsw8ngEz8vCNgTecXGs12bm/mEDHyPjre9ebVNqrbiox62FuRlLy Icceh0+0sepe+DVivAqlNNoa/hCqLnnF6ED4sI7K41JJ5Mix4fllUO7BKWE8E4hHUwPk D/xw== X-Gm-Message-State: AOJu0YxbdfU7umQLEgAdVIJmcKo7Lodl1BPnyE539Ft/iQFU3+RDmzM1 kwbTdMWfu8Jfhpilax5utUGFDtod5Q4AS/lGDhg= X-Received: by 2002:a05:6a21:a597:b0:172:918b:3907 with SMTP id gd23-20020a056a21a59700b00172918b3907mr24403115pzc.54.1698888619294; Wed, 01 Nov 2023 18:30:19 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 02/88] target/hppa: Rename hppa_tlb_entry to HPPATLBEntry Date: Wed, 1 Nov 2023 18:28:50 -0700 Message-Id: <20231102013016.369010-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Rename to CamelCase per coding style. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 8 ++++---- target/hppa/machine.c | 6 +++--- target/hppa/mem_helper.c | 30 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 48d735929e..22edfc955d 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -174,7 +174,7 @@ typedef int64_t target_sreg; #define TREG_FMT_ld "%"PRId64 #endif -typedef struct { +typedef struct HPPATLBEntry { uint64_t va_b; uint64_t va_e; target_ureg pa; @@ -188,7 +188,7 @@ typedef struct { unsigned ar_pl2 : 2; unsigned entry_valid : 1; unsigned access_id : 16; -} hppa_tlb_entry; +} HPPATLBEntry; typedef struct CPUArchState { target_ureg iaoq_f; /* front */ @@ -234,7 +234,7 @@ typedef struct CPUArchState { /* ??? Implement a unified itlb/dtlb for the moment. */ /* ??? We should use a more intelligent data structure. */ - hppa_tlb_entry tlb[HPPA_TLB_ENTRIES]; + HPPATLBEntry tlb[HPPA_TLB_ENTRIES]; uint32_t tlb_last; } CPUHPPAState; @@ -362,7 +362,7 @@ void hppa_cpu_do_interrupt(CPUState *cpu); bool hppa_cpu_exec_interrupt(CPUState *cpu, int int_req); int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, int type, hwaddr *pphys, int *pprot, - hppa_tlb_entry **tlb_entry); + HPPATLBEntry **tlb_entry); extern const MemoryRegionOps hppa_io_eir_ops; extern const VMStateDescription vmstate_hppa_cpu; void hppa_cpu_alarm_timer(void *); diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 905991d7f9..1d3f9b639d 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -69,7 +69,7 @@ static const VMStateInfo vmstate_psw = { static int get_tlb(QEMUFile *f, void *opaque, size_t size, const VMStateField *field) { - hppa_tlb_entry *ent = opaque; + HPPATLBEntry *ent = opaque; uint32_t val; memset(ent, 0, sizeof(*ent)); @@ -95,7 +95,7 @@ static int get_tlb(QEMUFile *f, void *opaque, size_t size, static int put_tlb(QEMUFile *f, void *opaque, size_t size, const VMStateField *field, JSONWriter *vmdesc) { - hppa_tlb_entry *ent = opaque; + HPPATLBEntry *ent = opaque; uint32_t val = 0; if (ent->entry_valid) { @@ -153,7 +153,7 @@ static VMStateField vmstate_env_fields[] = { VMSTATE_UINT32(fr0_shadow, CPUHPPAState), VMSTATE_ARRAY(tlb, CPUHPPAState, ARRAY_SIZE(((CPUHPPAState *)0)->tlb), - 0, vmstate_tlb, hppa_tlb_entry), + 0, vmstate_tlb, HPPATLBEntry), VMSTATE_UINT32(tlb_last, CPUHPPAState), VMSTATE_END_OF_LIST() diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 729032288d..a22de81a48 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -25,12 +25,12 @@ #include "hw/core/cpu.h" #include "trace.h" -static hppa_tlb_entry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) +static HPPATLBEntry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) { int i; for (i = 0; i < ARRAY_SIZE(env->tlb); ++i) { - hppa_tlb_entry *ent = &env->tlb[i]; + HPPATLBEntry *ent = &env->tlb[i]; if (ent->va_b <= addr && addr <= ent->va_e) { trace_hppa_tlb_find_entry(env, ent + i, ent->entry_valid, ent->va_b, ent->va_e, ent->pa); @@ -41,7 +41,7 @@ static hppa_tlb_entry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) return NULL; } -static void hppa_flush_tlb_ent(CPUHPPAState *env, hppa_tlb_entry *ent, +static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPATLBEntry *ent, bool force_flush_btlb) { CPUState *cs = env_cpu(env); @@ -65,9 +65,9 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, hppa_tlb_entry *ent, ent->va_b = -1; } -static hppa_tlb_entry *hppa_alloc_tlb_ent(CPUHPPAState *env) +static HPPATLBEntry *hppa_alloc_tlb_ent(CPUHPPAState *env) { - hppa_tlb_entry *ent; + HPPATLBEntry *ent; uint32_t i; if (env->tlb_last < HPPA_BTLB_ENTRIES || env->tlb_last >= ARRAY_SIZE(env->tlb)) { @@ -86,11 +86,11 @@ static hppa_tlb_entry *hppa_alloc_tlb_ent(CPUHPPAState *env) int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, int type, hwaddr *pphys, int *pprot, - hppa_tlb_entry **tlb_entry) + HPPATLBEntry **tlb_entry) { hwaddr phys; int prot, r_prot, w_prot, x_prot, priv; - hppa_tlb_entry *ent; + HPPATLBEntry *ent; int ret = -1; if (tlb_entry) { @@ -231,7 +231,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, { HPPACPU *cpu = HPPA_CPU(cs); CPUHPPAState *env = &cpu->env; - hppa_tlb_entry *ent; + HPPATLBEntry *ent; int prot, excp, a_prot; hwaddr phys; @@ -275,12 +275,12 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { - hppa_tlb_entry *empty = NULL; + HPPATLBEntry *empty = NULL; int i; /* Zap any old entries covering ADDR; notice empty entries on the way. */ for (i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb); ++i) { - hppa_tlb_entry *ent = &env->tlb[i]; + HPPATLBEntry *ent = &env->tlb[i]; if (ent->va_b <= addr && addr <= ent->va_e) { if (ent->entry_valid) { hppa_flush_tlb_ent(env, ent, false); @@ -303,7 +303,7 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) trace_hppa_tlb_itlba(env, empty, empty->va_b, empty->va_e, empty->pa); } -static void set_access_bits(CPUHPPAState *env, hppa_tlb_entry *ent, target_ureg reg) +static void set_access_bits(CPUHPPAState *env, HPPATLBEntry *ent, target_ureg reg) { ent->access_id = extract32(reg, 1, 18); ent->u = extract32(reg, 19, 1); @@ -321,7 +321,7 @@ static void set_access_bits(CPUHPPAState *env, hppa_tlb_entry *ent, target_ureg /* Insert (Insn/Data) TLB Protection. Note this is PA 1.1 only. */ void HELPER(itlbp)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { - hppa_tlb_entry *ent = hppa_find_tlb(env, addr); + HPPATLBEntry *ent = hppa_find_tlb(env, addr); if (unlikely(ent == NULL)) { qemu_log_mask(LOG_GUEST_ERROR, "ITLBP not following ITLBA\n"); @@ -337,7 +337,7 @@ static void ptlb_work(CPUState *cpu, run_on_cpu_data data) { CPUHPPAState *env = cpu_env(cpu); target_ulong addr = (target_ulong) data.target_ptr; - hppa_tlb_entry *ent = hppa_find_tlb(env, addr); + HPPATLBEntry *ent = hppa_find_tlb(env, addr); if (ent && ent->entry_valid) { hppa_flush_tlb_ent(env, ent, false); @@ -407,7 +407,7 @@ target_ureg HELPER(lpa)(CPUHPPAState *env, target_ulong addr) /* Return the ar_type of the TLB at VADDR, or -1. */ int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr) { - hppa_tlb_entry *ent = hppa_find_tlb(env, vaddr); + HPPATLBEntry *ent = hppa_find_tlb(env, vaddr); return ent ? ent->ar_type : -1; } @@ -422,7 +422,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) unsigned int phys_page, len, slot; int mmu_idx = cpu_mmu_index(env, 0); uintptr_t ra = GETPC(); - hppa_tlb_entry *btlb; + HPPATLBEntry *btlb; uint64_t virt_page; uint32_t *vaddr; From patchwork Thu Nov 2 01:28:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740350 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593959wrv; Wed, 1 Nov 2023 18:33:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETzJlXrEfvbVs/U6P3dcVI/gb4chF+KJJAXZPrp3YZx66Bur1cviu17u9Ag0ZRnI9r2vHM X-Received: by 2002:ac8:59c3:0:b0:41c:e02a:eba0 with SMTP id f3-20020ac859c3000000b0041ce02aeba0mr22546818qtf.17.1698888817943; Wed, 01 Nov 2023 18:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888817; cv=none; d=google.com; s=arc-20160816; b=jp4MGfG1LaxHJb0NeqA10yG+pGzprCMB6ehoHfsk38Ht6lzB5Ef7h0dortgmjW7Ajj FivVlxUkd95RqpWi28zjhaQCWmRo2pVovETw8+y5SI16JUvYp97kdKZtkWW4Ij2/9QHz 3OtIwhMbwgw64OnBdkB9TTSILzkbpr/GMygscefl9SnoIpIW7mlraG5Do0F6KUDhoVNR uVg0riIVBf0NaZWjJ2fCSH0JNRvJdcQADVlb1CVqewt3SwLB5QuvH+c5tbssFLYvJ747 5q7SdKW95t+3t0QxGnT0ZQB1UjfzgVKWzdmE9WKOpDTY39IFUIhe7YVvWTxHq1k9AXBI 21vA== 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=dpWvX3bMUy0LLw33Nd4xLQ7viiveU8nGbCNPBx3bpac=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=rumLxXOoWCSoZY06b6u3zoG/B9ezi0KZ0BwFdSBIkoQhlV+dVtAazbTH+XCJCnfDX2 YLcra46MCN1eVR9z6y4xlH7O0JnBi8Qc37bIobYLgTJNO4zRY7/OLbl58tHO1PMKpYhf J2bLOHbxNFQ1OfKUNV2ox5JdU2JDAIOKJMXQFUm3QGO9TJDLnO1MCZQYHPMph5NkjS+1 F18HpFcoqgXp+sElXez3MKoypMKZ2fmt5LD6YW3+AHAKpyQ/EP5gbyD5dLmQ4u/ApNFC adK2UuLwRr1q71J2AiwLbZlTQHFUHCe3Jwr6Ep4pbu4kQrxy7JZ1F2pyv0U7KDzsqqWH IL6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tmKa3iFq; 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 o9-20020ac85a49000000b0041b83bbd0d6si3506036qta.604.2023.11.01.18.33.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:33:37 -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=tmKa3iFq; 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 1qyMXZ-0005Vy-4u; Wed, 01 Nov 2023 21:30:33 -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 1qyMXW-0005TN-Eg for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:30 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXS-0001Rc-V3 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:30 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6c0f14d6875so471810b3a.1 for ; Wed, 01 Nov 2023 18:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888621; x=1699493421; 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=dpWvX3bMUy0LLw33Nd4xLQ7viiveU8nGbCNPBx3bpac=; b=tmKa3iFqSVXVSpEKssVOC0RXdYvdV/iNtqv3ZAv2Yb3rW5oIWk64+g5Zf30pOdc/dq iTufLQdFOKIGC7I+YkI8TgbKzNnDxSTro3ty154Otq67IqYSZZ2Q+iPoLbKnKNYvPbi9 QtfwzWdWqKZY4fhYRX6g6Fil+qTmqTpQYPAMf1937Isuy3rcOSRlmNF+e1vWxOw+b3vi 1nBL04dGnSN/OCHPA/918aEzDldqVVJlIhJXx6ANmYX9wpqvJiozf3gEsSUMH/wo2qwq 88jD8PmiHwFNP8pHN1RYWUCA0EpkYsEv1ywFnObM6WRgu7ltx+NqUYbo4Qmqyo3qzErX XcQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888621; x=1699493421; 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=dpWvX3bMUy0LLw33Nd4xLQ7viiveU8nGbCNPBx3bpac=; b=Th+CoKUeIzUZ9ZbzxYsWXoUspL3gruNqKLjlOMLCergZy4YlkqAxiulmO4ZzI9OVwr I4P7kVBAxG5VArA0r+MatNiFIADPpWEpQAvy27R1JdcVuJS2KaMZGxxHoUxa2Uj4J3c0 iqwtiFyMrrGaf1e4fmVtsc+QLOrPyDWZoY2AcWEwBYA84OxTgwhzeUg62trBGlrEqLqm LnTTexSFMUEJ5f+Z5Aoy66iMtr3h9kMDqmzMv1iBzSMdol44/d21Rc2h/hbgcZL6JCYG nMwzlpMeKWJOEHqteE3nQrR8NpqdiwJvxcgSUOk38ckXKF3C6OD9+3gx/QrsUa7g9Ayt R8rw== X-Gm-Message-State: AOJu0Yw07MJJ+JUeMJA4W1c/jxs6HPsAmjZmdouTWrKcVz1UCZaRN2lX hp4HC+6wXvpr5jRvAGJbOxo284+bBkya5AAUZXM= X-Received: by 2002:a05:6a00:84b:b0:69b:5395:59a8 with SMTP id q11-20020a056a00084b00b0069b539559a8mr17228805pfk.34.1698888620119; Wed, 01 Nov 2023 18:30:20 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 03/88] target/hppa: Use IntervalTreeNode in HPPATLBEntry Date: Wed, 1 Nov 2023 18:28:51 -0700 Message-Id: <20231102013016.369010-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Replace the va_b and va_b fields with the interval tree node. The actual interval tree is not yet used. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 5 +++-- target/hppa/machine.c | 6 +++--- target/hppa/mem_helper.c | 31 +++++++++++++++++-------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 22edfc955d..84bb6edc60 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -23,6 +23,7 @@ #include "cpu-qom.h" #include "exec/cpu-defs.h" #include "qemu/cpu-float.h" +#include "qemu/interval-tree.h" /* PA-RISC 1.x processors have a strong memory model. */ /* ??? While we do not yet implement PA-RISC 2.0, those processors have @@ -175,8 +176,8 @@ typedef int64_t target_sreg; #endif typedef struct HPPATLBEntry { - uint64_t va_b; - uint64_t va_e; + IntervalTreeNode itree; + target_ureg pa; unsigned u : 1; unsigned t : 1; diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 1d3f9b639d..4535195ca2 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -74,7 +74,7 @@ static int get_tlb(QEMUFile *f, void *opaque, size_t size, memset(ent, 0, sizeof(*ent)); - ent->va_b = qemu_get_be64(f); + ent->itree.start = qemu_get_be64(f); ent->pa = qemu_get_betr(f); val = qemu_get_be32(f); @@ -88,7 +88,7 @@ static int get_tlb(QEMUFile *f, void *opaque, size_t size, ent->d = extract32(val, 28, 1); ent->t = extract32(val, 29, 1); - ent->va_e = ent->va_b + TARGET_PAGE_SIZE - 1; + ent->itree.last = ent->itree.start + TARGET_PAGE_SIZE - 1; return 0; } @@ -110,7 +110,7 @@ static int put_tlb(QEMUFile *f, void *opaque, size_t size, val = deposit32(val, 29, 1, ent->t); } - qemu_put_be64(f, ent->va_b); + qemu_put_be64(f, ent->itree.start); qemu_put_betr(f, ent->pa); qemu_put_be32(f, val); return 0; diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index a22de81a48..687ae44ed0 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -31,9 +31,10 @@ static HPPATLBEntry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) for (i = 0; i < ARRAY_SIZE(env->tlb); ++i) { HPPATLBEntry *ent = &env->tlb[i]; - if (ent->va_b <= addr && addr <= ent->va_e) { + if (ent->itree.start <= addr && addr <= ent->itree.last) { trace_hppa_tlb_find_entry(env, ent + i, ent->entry_valid, - ent->va_b, ent->va_e, ent->pa); + ent->itree.start, ent->itree.last, + ent->pa); return ent; } } @@ -50,11 +51,12 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPATLBEntry *ent, return; } - trace_hppa_tlb_flush_ent(env, ent, ent->va_b, ent->va_e, ent->pa); + trace_hppa_tlb_flush_ent(env, ent, ent->itree.start, + ent->itree.last, ent->pa); - tlb_flush_range_by_mmuidx(cs, ent->va_b, - ent->va_e - ent->va_b + 1, - HPPA_MMU_FLUSH_MASK, TARGET_LONG_BITS); + tlb_flush_range_by_mmuidx(cs, ent->itree.start, + ent->itree.last - ent->itree.start + 1, + HPPA_MMU_FLUSH_MASK, TARGET_LONG_BITS); /* never clear BTLBs, unless forced to do so. */ if (ent < &env->tlb[HPPA_BTLB_ENTRIES] && !force_flush_btlb) { @@ -62,7 +64,7 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPATLBEntry *ent, } memset(ent, 0, sizeof(*ent)); - ent->va_b = -1; + ent->itree.start = -1; } static HPPATLBEntry *hppa_alloc_tlb_ent(CPUHPPAState *env) @@ -118,7 +120,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, } /* We now know the physical address. */ - phys = ent->pa + (addr - ent->va_b); + phys = ent->pa + (addr - ent->itree.start); /* Map TLB access_rights field to QEMU protection. */ priv = MMU_IDX_TO_PRIV(mmu_idx); @@ -281,7 +283,7 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) /* Zap any old entries covering ADDR; notice empty entries on the way. */ for (i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb); ++i) { HPPATLBEntry *ent = &env->tlb[i]; - if (ent->va_b <= addr && addr <= ent->va_e) { + if (ent->itree.start <= addr && addr <= ent->itree.last) { if (ent->entry_valid) { hppa_flush_tlb_ent(env, ent, false); } @@ -297,10 +299,11 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) } /* Note that empty->entry_valid == 0 already. */ - empty->va_b = addr & TARGET_PAGE_MASK; - empty->va_e = empty->va_b + TARGET_PAGE_SIZE - 1; + empty->itree.start = addr & TARGET_PAGE_MASK; + empty->itree.last = empty->itree.start + TARGET_PAGE_SIZE - 1; empty->pa = extract32(reg, 5, 20) << TARGET_PAGE_BITS; - trace_hppa_tlb_itlba(env, empty, empty->va_b, empty->va_e, empty->pa); + trace_hppa_tlb_itlba(env, empty, empty->itree.start, + empty->itree.last, empty->pa); } static void set_access_bits(CPUHPPAState *env, HPPATLBEntry *ent, target_ureg reg) @@ -467,8 +470,8 @@ void HELPER(diag_btlb)(CPUHPPAState *env) /* force flush of possibly existing BTLB entry */ hppa_flush_tlb_ent(env, btlb, true); /* create new BTLB entry */ - btlb->va_b = virt_page << TARGET_PAGE_BITS; - btlb->va_e = btlb->va_b + len * TARGET_PAGE_SIZE - 1; + btlb->itree.start = virt_page << TARGET_PAGE_BITS; + btlb->itree.last = btlb->itree.start + len * TARGET_PAGE_SIZE - 1; btlb->pa = phys_page << TARGET_PAGE_BITS; set_access_bits(env, btlb, env->gr[20]); btlb->t = 0; From patchwork Thu Nov 2 01:28:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740375 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595248wrv; Wed, 1 Nov 2023 18:38:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEQRgrZYI/UfDb5ztTBezkwtoLD39S0PS7+YZrJNvxKWAbsvwf+7VN+Gu6EphYHBYZFvYV X-Received: by 2002:a05:620a:878a:b0:76c:ba25:a8f1 with SMTP id py10-20020a05620a878a00b0076cba25a8f1mr14337617qkn.42.1698889099397; Wed, 01 Nov 2023 18:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889099; cv=none; d=google.com; s=arc-20160816; b=FO+tn/BSxXgrVtCdAwksmIzY3H1lCiNEZRwaK1SNlpAX2J8vI86++wRxwesEgyI54S uWQhxR68D7o93XUi2C9uBzzJ2ixTXTShRzcMfiuVTnxs+zxoT0nqTSt6zFLwCBWlYiFj xQap67tPqhWEOMZ3bQ9hV8h06IMxCYdmuV9HhyMWwLLMcpIvPS+q0b3l1+VVZZs/f9AI Ew+HIkoSOy9/atU/J99DdabQoWChDqyyFm0tOe/qwwASPmU2GbGds3ncprwUaG2w79vt C/8t/JggkPQSXXhV8FxyEDFeRPfjP6ZME3NUCkrfhXLaSaBNS0K7hAP5zgr6vfDp57Ed JaJg== 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=YyJfb6Wojnqq08dXxiqAELvXf9aCz7pqkYhEssz6d0I=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=El0XZ4XlZt7LSJ1JCpLybn3IaNj6Ix0kAwrPPg96hhXxmvFYfLzNmn3/GhMiKtuXPq EghTx9dWonASbIdhOxNrSamB36mB7fRisk//Pkz9HxwJ8c9uwThFCnhjnVu0bBFn0Stx raAkx+QAufZlF4uF0W094J0dX1hoLqfHiHYpBV1Z4DNCmKsc4/UxOosOdHWpehsEk11d fbcJmOm1YhSTkLjWlgr11gkTsja7I6MaluPIMzv32nwboCW5lMKZYn/xiVuDi7ZvCoM6 nXoARd3QrUgcRUtjUSHRZg0FsHCDR7h7jGb9lkUoatPYNmanIoxygXTrg1B4HVl2iUh4 k7Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XjU0JoYG; 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 f2-20020a05620a280200b007625731b2acsi3609425qkp.636.2023.11.01.18.38.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:19 -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=XjU0JoYG; 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 1qyMXi-0005ii-No; Wed, 01 Nov 2023 21:30: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 1qyMXZ-0005Xf-QV for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXU-0001Rd-8u for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6c3077984e8so469183b3a.0 for ; Wed, 01 Nov 2023 18:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888621; x=1699493421; 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=YyJfb6Wojnqq08dXxiqAELvXf9aCz7pqkYhEssz6d0I=; b=XjU0JoYGg2opJ28XXYT32tKdiiLqZUWVsebbpCE973hdlT7o7S1bWGH9A7uVq0HUp2 ToDlZUJt1Kz3JUQ757jK4qsJpYZtmu7VHVR1JDKziUmctKhqjuVfQYdaUcwCzt8zW8d+ 0HS/B5GV+B2K989jlmZgmam5YKjhvOqWK6DcmqHm6k5x2Z3gM/l3Pt/MlCI48GiQ9VuY 1Qap6XUQZq7rSYbRwWHmNPKdLsmvE8a6Y1Z3qlDfUVniPeWAYOUWEmNJPXahJrV0lGkP 286jYtoqQwlpXsU/tKpbGXmiju3uV9HSP1WT9JzEwZ0Z7OkZFawp3Eyqyh3odC0O4YNT xBdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888621; x=1699493421; 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=YyJfb6Wojnqq08dXxiqAELvXf9aCz7pqkYhEssz6d0I=; b=CNeC+G2VVt1Pmj3wzLChyTHj4RUOEF5bpY0GQk3V/osUvGuO5ULtuXPJ3zO2oMeTXy hlHJUrd8EQDR82s6ll2nL0z9tflopcEfD+/rwmuainEe1BfMnfLLm+kG1KfaxswroCiG S2ZvGcHjQwLh3IBwd7UtUAuBth/HOvr02gsZATI5x2kS+PmVkZriRNufo5NZ2FUF32G1 XVWHvr88pBHwH08PO5fskpKS9ODCUzOYThxB02MP02B5OCchNAsfqWgWSUUB+y5Z9wOD m15eUODTb1B0ekoTBOqdh7AiICAlVyGEQCp8Eoyq+xPWTEZgQgUbl9gU7IAqXnUw8lb/ aetw== X-Gm-Message-State: AOJu0YylzSeyEfilCSryUHkSBp5ckrxZUVQuRo2dZ2JnahPohySAk49C xkAHNbZFg1NFCnrbsp17cAlBhbsFN014mbbU49w= X-Received: by 2002:a05:6a00:1786:b0:6b6:1216:d8fe with SMTP id s6-20020a056a00178600b006b61216d8femr19527430pfg.27.1698888621029; Wed, 01 Nov 2023 18:30:21 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 04/88] target/hppa: Always report one page to tlb_set_page Date: Wed, 1 Nov 2023 18:28:52 -0700 Message-Id: <20231102013016.369010-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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, T_SCC_BODY_TEXT_LINE=-0.01 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 No need to trigger the large_page_mask code unnecessarily. Drop the now unused HPPATLBEntry.page_size field. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 5 +++-- target/hppa/mem_helper.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 84bb6edc60..1480d0237a 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -179,15 +179,16 @@ typedef struct HPPATLBEntry { IntervalTreeNode itree; target_ureg pa; + + unsigned entry_valid : 1; + unsigned u : 1; unsigned t : 1; unsigned d : 1; unsigned b : 1; - unsigned page_size : 4; unsigned ar_type : 3; unsigned ar_pl1 : 2; unsigned ar_pl2 : 2; - unsigned entry_valid : 1; unsigned access_id : 16; } HPPATLBEntry; diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 687ae44ed0..60cae646cc 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -268,9 +268,16 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, trace_hppa_tlb_fill_success(env, addr & TARGET_PAGE_MASK, phys & TARGET_PAGE_MASK, size, type, mmu_idx); - /* Success! Store the translation into the QEMU TLB. */ + + /* + * Success! Store the translation into the QEMU TLB. + * Note that we always install a single-page entry, because that + * is what works best with softmmu -- anything else will trigger + * the large page protection mask. We do not require this, + * because we record the large page here in the hppa tlb. + */ tlb_set_page(cs, addr & TARGET_PAGE_MASK, phys & TARGET_PAGE_MASK, - prot, mmu_idx, TARGET_PAGE_SIZE << (ent ? 2 * ent->page_size : 0)); + prot, mmu_idx, TARGET_PAGE_SIZE); return true; } From patchwork Thu Nov 2 01:28:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740346 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593698wrv; Wed, 1 Nov 2023 18:32:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMe3eV6hJPGY1PHfbjqQu+rJYgfsAIRaVrgUf+AtAHFOlJqna2S+Dc3h0oQC8wHI6E77IQ X-Received: by 2002:ac8:7f83:0:b0:417:b970:f2a4 with SMTP id z3-20020ac87f83000000b00417b970f2a4mr21456855qtj.1.1698888760309; Wed, 01 Nov 2023 18:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888760; cv=none; d=google.com; s=arc-20160816; b=TIt4qqrwMj3llTiLv1QJSj2jbAps1ZX2X7824M5z9PTdHEIoaytTgcuLiUzRqUY7SB /yV3u2ew6o3IS/VJQ+dY6qnr+PPHXFO9dp1MbZv67Hf/yYptTgNSEv/8NBWhrPeprpb6 QJ6OCOJuJgXZfitHckHg0U25ujXEwrW+tonPZuZb/ryEeCQBpnOyL3gD/syu/AJfmXBx PsK0kzOA5fQic6Ot4Ht3dMowIE/RjfwOGE/SZaOt5bLYySj98v/0+6OkSEOq77KWgQsL rxCu6JIu1QcPYyks/J1+77rVR+v4EjYk8dWUX247uSZGbxNPc6DC6dbyDV9w65CuWjgU SkFQ== 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=Ez2Z78a8l3Rct3xuqmIfMNHaaKAnGMRqCCq6D0MIJeY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=IGB+Gf5ZZ2TF4XpDflxZx2bhP88tCELZfvai4WnZ/VU20F3hILzra1MfDh8PVb0hlq QQKx+l5BCg102JNjgacH7ywmp5paY7BIL3JRlWcVrA0Te6T2cveADQV2MZFrAakiV++/ ZL6vNVWQa0FG7hSQhVpNieUMkq8f7VX42DhMy/WiHxnkSQR3zdLBnYCIrbIvswo/CoUH Gjx853h95sBEgMB9x5m8F38C2/Xs7et65x0HKp9F5L+LhTR8rxOG8CLRWlZhGFuIE6ER wT2tyk7OyU2WS8Pr/o8IfK6lQExqqcIsq1+MtAi3LJQC4mMzWDjxgq9/WF7YnlxWlxTK GTZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DhzL42zm; 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 f16-20020a05622a1a1000b0041092ca3dd6si3700663qtb.306.2023.11.01.18.32.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:40 -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=DhzL42zm; 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 1qyMXg-0005eU-A7; Wed, 01 Nov 2023 21:30:40 -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 1qyMXY-0005Ur-EA for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:32 -0400 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXU-0001SP-8s for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:31 -0400 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b2ea7cca04so261083b6e.2 for ; Wed, 01 Nov 2023 18:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888622; x=1699493422; 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=Ez2Z78a8l3Rct3xuqmIfMNHaaKAnGMRqCCq6D0MIJeY=; b=DhzL42zmJgVmEruVEx3Go8xFh98hTOBMBjdz0tmL8UTMxccejpVDrK/qw7snmj+4y0 HeXCDRIbIOkAzqUdELSB0L750ycqg4F3Q/dIulT/Cs1YLg2HeIIJVCP5N1Ueo4uUaAV3 aduMNJaUToiEJ6fXHqeqQVgjghvgn96+FhvkkmJELn09Rfjhe0lK1tWJdjrq7LSdeK1Q V6mGUh7dgef4L/4mLPitfK9TLcZ67trkp3FhMXyOdeId2XM1mtKGBScz+CFhP/0QcMhr br7ugA2O0ZtDI81Kju00Ydr6CGucfbQGHdgvTs+Xn+WcESBfYlrksmfIv5TpKdEnxWov XLSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888622; x=1699493422; 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=Ez2Z78a8l3Rct3xuqmIfMNHaaKAnGMRqCCq6D0MIJeY=; b=ea4ZyhT5psv9q8lfyp7nDu4CCGfYLmtz9b8cxMOudIsdQYTsEVHRgWx9nPTyoqQs1G IyScYV0PJBOD/lOTByXci6RHy53eQASrEWQRw3CMP7+v7E+VIn2YjLOWqpBYj3q8wuJU /vHw+6M4ELOrvVgV54yobgu2D+iEulCT+SrbAzbTf0kvktsGFBRHPponpZ796EB4f19Q Xms4TcBt46jPUJyeQQkOOqYnbuxP0Wfqmr1QpGq6u+XG3J7Oaac3xuT+O7nW8s0+/89S xF1zL1fB7RAU07TgfMHJTSZI5auIt+CdWvFweSza2g8of527QjbcqdDK3cYZrK0s4bqn ZLuw== X-Gm-Message-State: AOJu0YxCBA54XAsfIM+9VH7BLOdTeWrTCj+7ODwRPl7b2EF7fofO2EvH 4CaFqU5gmEn1zutoyTiwNkQjTWoPbsRPqDRU+OI= X-Received: by 2002:a05:6808:bc6:b0:3b2:ec66:d868 with SMTP id o6-20020a0568080bc600b003b2ec66d868mr22524295oik.41.1698888621865; Wed, 01 Nov 2023 18:30:21 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 05/88] target/hppa: Split out hppa_flush_tlb_range Date: Wed, 1 Nov 2023 18:28:53 -0700 Message-Id: <20231102013016.369010-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/mem_helper.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 60cae646cc..828cceb29c 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -67,6 +67,25 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPATLBEntry *ent, ent->itree.start = -1; } +static HPPATLBEntry *hppa_flush_tlb_range(CPUHPPAState *env, + vaddr va_b, vaddr va_e) +{ + HPPATLBEntry *empty = NULL; + + /* Zap any old entries covering ADDR; notice empty entries on the way. */ + for (int i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb); ++i) { + HPPATLBEntry *ent = &env->tlb[i]; + + if (!ent->entry_valid) { + empty = ent; + } else if (va_e >= ent->itree.start && va_b <= ent->itree.last) { + hppa_flush_tlb_ent(env, ent, false); + empty = ent; + } + } + return empty; +} + static HPPATLBEntry *hppa_alloc_tlb_ent(CPUHPPAState *env) { HPPATLBEntry *ent; @@ -284,21 +303,11 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { - HPPATLBEntry *empty = NULL; - int i; + HPPATLBEntry *empty; /* Zap any old entries covering ADDR; notice empty entries on the way. */ - for (i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb); ++i) { - HPPATLBEntry *ent = &env->tlb[i]; - if (ent->itree.start <= addr && addr <= ent->itree.last) { - if (ent->entry_valid) { - hppa_flush_tlb_ent(env, ent, false); - } - if (!empty) { - empty = ent; - } - } - } + addr &= TARGET_PAGE_MASK; + empty = hppa_flush_tlb_range(env, addr, addr + TARGET_PAGE_SIZE - 1); /* If we didn't see an empty entry, evict one. */ if (empty == NULL) { @@ -306,8 +315,8 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) } /* Note that empty->entry_valid == 0 already. */ - empty->itree.start = addr & TARGET_PAGE_MASK; - empty->itree.last = empty->itree.start + TARGET_PAGE_SIZE - 1; + empty->itree.start = addr; + empty->itree.last = addr + TARGET_PAGE_SIZE - 1; empty->pa = extract32(reg, 5, 20) << TARGET_PAGE_BITS; trace_hppa_tlb_itlba(env, empty, empty->itree.start, empty->itree.last, empty->pa); From patchwork Thu Nov 2 01:28:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740419 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp598088wrv; Wed, 1 Nov 2023 18:49:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEu0jTovGrFEKv+q0LIB+6X09zJmfgLQv5xq+Qu62NYytM6lTsslaP1NALvGdx94ZeCHajo X-Received: by 2002:a05:620a:2983:b0:76f:b00:4e66 with SMTP id r3-20020a05620a298300b0076f0b004e66mr5932762qkp.9.1698889752929; Wed, 01 Nov 2023 18:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889752; cv=none; d=google.com; s=arc-20160816; b=YcFT5ZKW2no3dtYXTzb4cF2aWWcFWPt6OUJB4Lv1fRelPgT5YgwnCHO84e+m3TeGhp P0Dk8KRQfZlLkBJwZouV/VRoVWK0hz4p1ff6T0BXJk+lBFBiv8ZpBzzOpZ3aP63WmevT +oTzQiTKiqclF1IBew5+cgKK5g/7mkAsOshXCtuYscoilgzHkuq198Qy05EUBXVLQ6oG J1VZ5EqWu5mppJT5FUZcSS4OsmEE9i6agVW4ZTKmdzDGsUImQ2/Az6Iz6GThHrBQA3mq tW6rHv2L/NGPGQzyhi9SBnMBz+jcqqg+7cchU4pxItde7bOqIoYvtGlT11ATG3JN8vEz KJZA== 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=nB70z+ZvL+Oe/IRdMH3NRlu18gtAh7HSDv+Gha4r1Og=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=0eXOPw5rlE60+abs6hQhatSD00+e7rSS26qf9X3XfRw0qzJVu//cs8ZS6leGvh+DVE Nh+BFsSnTXfXs6JrvGuuUtbb3sBJYKUwW9yg9F6anLEr4mEcgkBa9bRkmv2HPhO++hgw UEOH0zitZ6aivP+CPHcfjZPuE7KR+TJE7hN6ScifsLe4QyWFtJdgSZjQvhUuOnj19E3H gkwxMaWyAb9gbVB11e/RFw8qwIqgVNqtbqXpABmUAN98CyZ1mUTCWV5kkbP06MIwUTyU 34NvGJROn52fzm83Ho9x76F2u1Z/Z2Jr+iXMWag1LYui04y0EzVTS1iMHcjvKk7W8ndL DB2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fh2HxucC; 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 cy16-20020a05621418d000b0065b14c19db6si3662257qvb.288.2023.11.01.18.49.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:49:12 -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=Fh2HxucC; 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 1qyMXl-0005kd-DP; Wed, 01 Nov 2023 21:30: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 1qyMXa-0005YW-CD for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:34 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXV-0001Vr-AB for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso382025b3a.1 for ; Wed, 01 Nov 2023 18:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888627; x=1699493427; 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=nB70z+ZvL+Oe/IRdMH3NRlu18gtAh7HSDv+Gha4r1Og=; b=Fh2HxucCYNOCeGZHXeYKaA8BuuUVlme3P3zuwQ7ZdApseE4348qrD4Ole8SpKDmvXh wTmBYirB2T2HrhPOo8qrgJSvO6a+G7i4Nu8HAiSOLBjt+0NtzuQP2ILedtMdRGWHd8eS nlP4Ue8GWZS1NOEd66Abf0dPdmta15FaKUMrG6tcLcpafnTrQMEBvTFO5W8rbeyf6Cpa 2PHX8WtYFUDDO1fdt18ZT6yOPEkqrJUjd3LVOWSDc3W84hWXbU7EZdwMtBBpjj91FxcL XarOca/0i3KSYNDrWIgL3cH3GvPt2gcWOdeVrJUA7T8OC9pTHWMsae60KeZi6LIfXXYk KK3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888627; x=1699493427; 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=nB70z+ZvL+Oe/IRdMH3NRlu18gtAh7HSDv+Gha4r1Og=; b=ArfsUC0AJAkrqPeb4xkWzHOwWGhL9D00G0EpXbMOdOyHHLv7ZY5b6IVBQhqjyeOocE T6c3r+3BY5yVl2evHcNdLKu7HwPJtAs9/z3rT5t2/E8mJn7uNIMByGo6G11y9/c4SqIE yIkg6bYZDDLq0yQffM12JA8H6B2N0zF1966zwAzEsvcWh8/pLOa3C4Xvx3Hf2lPR5Qv4 VM5jZa4X4ju7qY/UD8BdNjuCOXT84atyu1I1yc3x8y6pDEG0YtxJmqtI4DE1Zdd44v7l zpvPmmvdbSacVfXTG80tchqYB7abzp5rzGwaGIUq1MLU27uL+Mhb3ENCr3iniYFqBnNw fm7g== X-Gm-Message-State: AOJu0YxbILib5HfrqcxXUytwO8meiJRqGCOa5/xhUW0x/su9T0ot2x3N 0suEmOZDQQe9BcY+HV0ZtfohljhX/70pz45ThiA= X-Received: by 2002:aa7:8894:0:b0:68b:e29c:b69 with SMTP id z20-20020aa78894000000b0068be29c0b69mr9513066pfe.9.1698888622587; Wed, 01 Nov 2023 18:30:22 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 06/88] target/hppa: Populate an interval tree with valid tlb entries Date: Wed, 1 Nov 2023 18:28:54 -0700 Message-Id: <20231102013016.369010-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Complete the data structure conversion started earlier. This reduces the perf overhead of hppa_get_physical_address from ~5% to ~0.25%. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 24 +++++- target/hppa/cpu.c | 2 + target/hppa/machine.c | 51 ++++++++++++- target/hppa/mem_helper.c | 161 +++++++++++++++++++++++---------------- 4 files changed, 167 insertions(+), 71 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 1480d0237a..08de894393 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -176,7 +176,10 @@ typedef int64_t target_sreg; #endif typedef struct HPPATLBEntry { - IntervalTreeNode itree; + union { + IntervalTreeNode itree; + struct HPPATLBEntry *unused_next; + }; target_ureg pa; @@ -234,10 +237,22 @@ typedef struct CPUArchState { #define HPPA_TLB_ENTRIES 256 #define HPPA_BTLB_ENTRIES (HPPA_BTLB_FIXED + HPPA_BTLB_VARIABLE) - /* ??? Implement a unified itlb/dtlb for the moment. */ - /* ??? We should use a more intelligent data structure. */ - HPPATLBEntry tlb[HPPA_TLB_ENTRIES]; + /* Index for round-robin tlb eviction. */ uint32_t tlb_last; + + /* + * For pa1.x, the partial initialized, still invalid tlb entry + * which has had ITLBA performed, but not yet ITLBP. + */ + HPPATLBEntry *tlb_partial; + + /* Linked list of all invalid (unused) tlb entries. */ + HPPATLBEntry *tlb_unused; + + /* Root of the search tree for all valid tlb entries. */ + IntervalTreeRoot tlb_root; + + HPPATLBEntry tlb[HPPA_TLB_ENTRIES]; } CPUHPPAState; /** @@ -356,6 +371,7 @@ int hppa_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int hppa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void hppa_cpu_dump_state(CPUState *cs, FILE *f, int); #ifndef CONFIG_USER_ONLY +void hppa_ptlbe(CPUHPPAState *env); hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr); bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 1644297bf8..5e1240c631 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -137,8 +137,10 @@ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) #ifndef CONFIG_USER_ONLY { HPPACPU *cpu = HPPA_CPU(cs); + cpu->alarm_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, hppa_cpu_alarm_timer, cpu); + hppa_ptlbe(&cpu->env); } #endif } diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 4535195ca2..ab3e8c81fa 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -72,8 +72,6 @@ static int get_tlb(QEMUFile *f, void *opaque, size_t size, HPPATLBEntry *ent = opaque; uint32_t val; - memset(ent, 0, sizeof(*ent)); - ent->itree.start = qemu_get_be64(f); ent->pa = qemu_get_betr(f); val = qemu_get_be32(f); @@ -122,6 +120,53 @@ static const VMStateInfo vmstate_tlb = { .put = put_tlb, }; +static int tlb_pre_load(void *opaque) +{ + CPUHPPAState *env = opaque; + + /* + * Zap the entire tlb, on-the-side data structures and all. + * Each tlb entry will have data re-filled by put_tlb. + */ + memset(env->tlb, 0, sizeof(env->tlb)); + memset(&env->tlb_root, 0, sizeof(env->tlb_root)); + env->tlb_unused = NULL; + env->tlb_partial = NULL; + + return 0; +} + +static int tlb_post_load(void *opaque, int version_id) +{ + CPUHPPAState *env = opaque; + HPPATLBEntry **unused = &env->tlb_unused; + HPPATLBEntry *partial = NULL; + + /* + * Re-create the interval tree from the valid entries. + * Truely invalid entries should have start == end == 0. + * Otherwise it should be the in-flight tlb_partial entry. + */ + for (uint32_t i = 0; i < ARRAY_SIZE(env->tlb); ++i) { + HPPATLBEntry *e = &env->tlb[i]; + + if (e->entry_valid) { + interval_tree_insert(&e->itree, &env->tlb_root); + } else if (i < HPPA_BTLB_ENTRIES) { + /* btlb not in unused list */ + } else if (partial == NULL && e->itree.start < e->itree.last) { + partial = e; + } else { + *unused = e; + unused = &e->unused_next; + } + } + env->tlb_partial = partial; + *unused = NULL; + + return 0; +} + static VMStateField vmstate_env_fields[] = { VMSTATE_UINTTR_ARRAY(gr, CPUHPPAState, 32), VMSTATE_UINT64_ARRAY(fr, CPUHPPAState, 32), @@ -164,6 +209,8 @@ static const VMStateDescription vmstate_env = { .version_id = 1, .minimum_version_id = 1, .fields = vmstate_env_fields, + .pre_load = tlb_pre_load, + .post_load = tlb_post_load, }; static VMStateField vmstate_cpu_fields[] = { diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 828cceb29c..b1773ece61 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -27,16 +27,13 @@ static HPPATLBEntry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) { - int i; + IntervalTreeNode *i = interval_tree_iter_first(&env->tlb_root, addr, addr); - for (i = 0; i < ARRAY_SIZE(env->tlb); ++i) { - HPPATLBEntry *ent = &env->tlb[i]; - if (ent->itree.start <= addr && addr <= ent->itree.last) { - trace_hppa_tlb_find_entry(env, ent + i, ent->entry_valid, - ent->itree.start, ent->itree.last, - ent->pa); - return ent; - } + if (i) { + HPPATLBEntry *ent = container_of(i, HPPATLBEntry, itree); + trace_hppa_tlb_find_entry(env, ent, ent->entry_valid, + ent->itree.start, ent->itree.last, ent->pa); + return ent; } trace_hppa_tlb_find_entry_not_found(env, addr); return NULL; @@ -46,6 +43,7 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPATLBEntry *ent, bool force_flush_btlb) { CPUState *cs = env_cpu(env); + bool is_btlb; if (!ent->entry_valid) { return; @@ -58,50 +56,55 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPATLBEntry *ent, ent->itree.last - ent->itree.start + 1, HPPA_MMU_FLUSH_MASK, TARGET_LONG_BITS); - /* never clear BTLBs, unless forced to do so. */ - if (ent < &env->tlb[HPPA_BTLB_ENTRIES] && !force_flush_btlb) { + /* Never clear BTLBs, unless forced to do so. */ + is_btlb = ent < &env->tlb[HPPA_BTLB_ENTRIES]; + if (is_btlb && !force_flush_btlb) { return; } + interval_tree_remove(&ent->itree, &env->tlb_root); memset(ent, 0, sizeof(*ent)); - ent->itree.start = -1; + + if (!is_btlb) { + ent->unused_next = env->tlb_unused; + env->tlb_unused = ent; + } } -static HPPATLBEntry *hppa_flush_tlb_range(CPUHPPAState *env, - vaddr va_b, vaddr va_e) +static void hppa_flush_tlb_range(CPUHPPAState *env, vaddr va_b, vaddr va_e) { - HPPATLBEntry *empty = NULL; + IntervalTreeNode *i, *n; - /* Zap any old entries covering ADDR; notice empty entries on the way. */ - for (int i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb); ++i) { - HPPATLBEntry *ent = &env->tlb[i]; + i = interval_tree_iter_first(&env->tlb_root, va_b, va_e); + for (; i ; i = n) { + HPPATLBEntry *ent = container_of(i, HPPATLBEntry, itree); - if (!ent->entry_valid) { - empty = ent; - } else if (va_e >= ent->itree.start && va_b <= ent->itree.last) { - hppa_flush_tlb_ent(env, ent, false); - empty = ent; - } + /* + * Find the next entry now: In the normal case the current entry + * will be removed, but in the BTLB case it will remain. + */ + n = interval_tree_iter_next(i, va_b, va_e); + hppa_flush_tlb_ent(env, ent, false); } - return empty; } static HPPATLBEntry *hppa_alloc_tlb_ent(CPUHPPAState *env) { - HPPATLBEntry *ent; - uint32_t i; + HPPATLBEntry *ent = env->tlb_unused; - if (env->tlb_last < HPPA_BTLB_ENTRIES || env->tlb_last >= ARRAY_SIZE(env->tlb)) { - i = HPPA_BTLB_ENTRIES; - env->tlb_last = HPPA_BTLB_ENTRIES + 1; - } else { - i = env->tlb_last; - env->tlb_last++; + if (ent == NULL) { + uint32_t i = env->tlb_last; + + if (i < HPPA_BTLB_ENTRIES || i >= ARRAY_SIZE(env->tlb)) { + i = HPPA_BTLB_ENTRIES; + } + env->tlb_last = i + 1; + + ent = &env->tlb[i]; + hppa_flush_tlb_ent(env, ent, false); } - ent = &env->tlb[i]; - - hppa_flush_tlb_ent(env, ent, false); + env->tlb_unused = ent->unused_next; return ent; } @@ -127,7 +130,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, /* Find a valid tlb entry that matches the virtual address. */ ent = hppa_find_tlb(env, addr); - if (ent == NULL || !ent->entry_valid) { + if (ent == NULL) { phys = 0; prot = 0; ret = (type == PAGE_EXEC) ? EXCP_ITLB_MISS : EXCP_DTLB_MISS; @@ -303,23 +306,23 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { - HPPATLBEntry *empty; + HPPATLBEntry *ent; - /* Zap any old entries covering ADDR; notice empty entries on the way. */ + /* Zap any old entries covering ADDR. */ addr &= TARGET_PAGE_MASK; - empty = hppa_flush_tlb_range(env, addr, addr + TARGET_PAGE_SIZE - 1); + hppa_flush_tlb_range(env, addr, addr + TARGET_PAGE_SIZE - 1); - /* If we didn't see an empty entry, evict one. */ - if (empty == NULL) { - empty = hppa_alloc_tlb_ent(env); + ent = env->tlb_partial; + if (ent == NULL) { + ent = hppa_alloc_tlb_ent(env); + env->tlb_partial = ent; } - /* Note that empty->entry_valid == 0 already. */ - empty->itree.start = addr; - empty->itree.last = addr + TARGET_PAGE_SIZE - 1; - empty->pa = extract32(reg, 5, 20) << TARGET_PAGE_BITS; - trace_hppa_tlb_itlba(env, empty, empty->itree.start, - empty->itree.last, empty->pa); + /* Note that ent->entry_valid == 0 already. */ + ent->itree.start = addr; + ent->itree.last = addr + TARGET_PAGE_SIZE - 1; + ent->pa = extract32(reg, 5, 20) << TARGET_PAGE_BITS; + trace_hppa_tlb_itlba(env, ent, ent->itree.start, ent->itree.last, ent->pa); } static void set_access_bits(CPUHPPAState *env, HPPATLBEntry *ent, target_ureg reg) @@ -333,6 +336,8 @@ static void set_access_bits(CPUHPPAState *env, HPPATLBEntry *ent, target_ureg re ent->d = extract32(reg, 28, 1); ent->t = extract32(reg, 29, 1); ent->entry_valid = 1; + + interval_tree_insert(&ent->itree, &env->tlb_root); trace_hppa_tlb_itlbp(env, ent, ent->access_id, ent->u, ent->ar_pl2, ent->ar_pl1, ent->ar_type, ent->b, ent->d, ent->t); } @@ -340,14 +345,16 @@ static void set_access_bits(CPUHPPAState *env, HPPATLBEntry *ent, target_ureg re /* Insert (Insn/Data) TLB Protection. Note this is PA 1.1 only. */ void HELPER(itlbp)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { - HPPATLBEntry *ent = hppa_find_tlb(env, addr); + HPPATLBEntry *ent = env->tlb_partial; - if (unlikely(ent == NULL)) { - qemu_log_mask(LOG_GUEST_ERROR, "ITLBP not following ITLBA\n"); - return; + if (ent) { + env->tlb_partial = NULL; + if (ent->itree.start <= addr && addr <= ent->itree.last) { + set_access_bits(env, ent, reg); + return; + } } - - set_access_bits(env, ent, reg); + qemu_log_mask(LOG_GUEST_ERROR, "ITLBP not following ITLBA\n"); } /* Purge (Insn/Data) TLB. This is explicitly page-based, and is @@ -356,17 +363,15 @@ static void ptlb_work(CPUState *cpu, run_on_cpu_data data) { CPUHPPAState *env = cpu_env(cpu); target_ulong addr = (target_ulong) data.target_ptr; - HPPATLBEntry *ent = hppa_find_tlb(env, addr); - if (ent && ent->entry_valid) { - hppa_flush_tlb_ent(env, ent, false); - } + hppa_flush_tlb_range(env, addr, addr); } void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) { CPUState *src = env_cpu(env); CPUState *cpu; + trace_hppa_tlb_ptlb(env); run_on_cpu_data data = RUN_ON_CPU_TARGET_PTR(addr); @@ -378,16 +383,40 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) async_safe_run_on_cpu(src, ptlb_work, data); } +void hppa_ptlbe(CPUHPPAState *env) +{ + uint32_t i; + + /* Zap the (non-btlb) tlb entries themselves. */ + memset(&env->tlb[HPPA_BTLB_ENTRIES], 0, + sizeof(env->tlb) - HPPA_BTLB_ENTRIES * sizeof(env->tlb[0])); + env->tlb_last = HPPA_BTLB_ENTRIES; + env->tlb_partial = NULL; + + /* Put them all onto the unused list. */ + env->tlb_unused = &env->tlb[HPPA_BTLB_ENTRIES]; + for (i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb) - 1; ++i) { + env->tlb[i].unused_next = &env->tlb[i + 1]; + } + + /* Re-initialize the interval tree with only the btlb entries. */ + memset(&env->tlb_root, 0, sizeof(env->tlb_root)); + for (i = 0; i < HPPA_BTLB_ENTRIES; ++i) { + if (env->tlb[i].entry_valid) { + interval_tree_insert(&env->tlb[i].itree, &env->tlb_root); + } + } + + tlb_flush_by_mmuidx(env_cpu(env), HPPA_MMU_FLUSH_MASK); +} + /* Purge (Insn/Data) TLB entry. This affects an implementation-defined number of pages/entries (we choose all), and is local to the cpu. */ void HELPER(ptlbe)(CPUHPPAState *env) { trace_hppa_tlb_ptlbe(env); qemu_log_mask(CPU_LOG_MMU, "FLUSH ALL TLB ENTRIES\n"); - memset(&env->tlb[HPPA_BTLB_ENTRIES], 0, - sizeof(env->tlb) - HPPA_BTLB_ENTRIES * sizeof(env->tlb[0])); - env->tlb_last = HPPA_BTLB_ENTRIES; - tlb_flush_by_mmuidx(env_cpu(env), HPPA_MMU_FLUSH_MASK); + hppa_ptlbe(env); } void cpu_hppa_change_prot_id(CPUHPPAState *env) @@ -483,9 +512,11 @@ void HELPER(diag_btlb)(CPUHPPAState *env) (long long) virt_page, phys_page, len, slot); if (slot < HPPA_BTLB_ENTRIES) { btlb = &env->tlb[slot]; - /* force flush of possibly existing BTLB entry */ + + /* Force flush of possibly existing BTLB entry. */ hppa_flush_tlb_ent(env, btlb, true); - /* create new BTLB entry */ + + /* Create new BTLB entry */ btlb->itree.start = virt_page << TARGET_PAGE_BITS; btlb->itree.last = btlb->itree.start + len * TARGET_PAGE_SIZE - 1; btlb->pa = phys_page << TARGET_PAGE_BITS; From patchwork Thu Nov 2 01:28:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740343 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593596wrv; Wed, 1 Nov 2023 18:32:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtJJESU/V9Dso7o8YLymKI0duc5qzNRLPXwvYzk599l1gCSfreClVe4lu9QZhrA2E4qvzr X-Received: by 2002:ac8:57cb:0:b0:419:50d0:cf5a with SMTP id w11-20020ac857cb000000b0041950d0cf5amr23224355qta.2.1698888742367; Wed, 01 Nov 2023 18:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888742; cv=none; d=google.com; s=arc-20160816; b=a2Q+N2+JSEx2NlJ+YdvpLW9X+/jkX3FgRoAgAYnReK+TjNdaauhcAZOMvJfgOUplbo bUC4GNSYMq6V8COK8AegpbNkdY+0SWF5GOLAnw0Zhkf74knbsPcHrXvkq1b57l1HQJGs q8q0uouQInrwL2JogAM2Uu/VUbm5PFptDowjPIN4p79hHmwEE62mJh7Y5SnsciGFvjIZ ml3xrI1VWwVoRzO/QqIdeh7uUkv7Q2yy8XAoGEapZ+D/hScX9gtPFUtQHX5wY3tmnYki /2Cjl+hkwdWGI8dFvMKoSoK3hpr5MkVTyCGb5idCSL3FcH23t65EEFXp1NKRXNIYeHsW LfoQ== 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=57r4dbvGmT9c7SflZoBSmAA2ZbZqs4+A6cLuNHSqKd0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=NTh/uXmndLEY0OyX8FjpglNPGWFkH3pE1htUvVZwtxzaLsitSZgABJ/FituvUNC9kX 5LHKjVETferrfzcWEPmnG/zdhFzrrqKO0a1ylUuh/pOaDXX92orygqF3vkDkWrsZWLtP CdffWtEaawzen5U/VGz0BOb9PIYRpKQChS4eEnTThjb7Rj2Uldqp0kUDFEn66XwlX55r NX3WgRg4sL4b+djubuL+HR0Z2oVhH6wHUXWzlhgU2Fa4uHLynQXVdBoKhC/tjdLLfLeX 75pWme3QQwD7ORIe9mZxc45Rzp/NCB1jQ4/sbr1IcwAbtIlW412poUXPOeYvUoJJiFhg oTUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D97rk0yu; 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 x16-20020a05622a001000b00417be34bff9si3357574qtw.675.2023.11.01.18.32.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:22 -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=D97rk0yu; 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 1qyMXe-0005cn-Rh; Wed, 01 Nov 2023 21:30:38 -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 1qyMXZ-0005Xe-P6 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXU-0001TS-8t for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6c32a20d5dbso152072b3a.1 for ; Wed, 01 Nov 2023 18:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888623; x=1699493423; 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=57r4dbvGmT9c7SflZoBSmAA2ZbZqs4+A6cLuNHSqKd0=; b=D97rk0yuZMAldmA/xQResC7VUNBu8oQQfLpqmD5s5e3gCLg3xVjCxg7Vnbm+GeZmm6 zKYJMOUnGzBLRHRlFLRIu7O3BXDCdm6+1/nUZdaZO6XnkZyrBRQUOyj+ZvzvdtLueFmR nipcI4xaUqqZzbF6Nups1tehdWJ0eqHHfBz+nMlxK/TcU4xNEpaX5tHB3kuxPYMZQEAE bW6oUwekw8Yxu2ZBiKp3Q4Ivl9ILFzevZheV8BBB8RGvldazIxJHKLRlRfgPPNYFj9z9 karLsABklCT2YiZHllCdBWaP3mzEqzeOjxgeOZ5Uoq+9Hq/jVcoSezpwfB/663dtbNcg HYBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888623; x=1699493423; 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=57r4dbvGmT9c7SflZoBSmAA2ZbZqs4+A6cLuNHSqKd0=; b=oVrkV4jFVdHhtB3WlUtw9CP5kCcVetA74hRBKFFQBeaTlzvQe7Wz6BmeD9yMRKeP81 9c9rwKstKHosTUXcChgSkY83hEnjMCoaweK6I4520hCeqQMeK5Jf9c1iqY8ybWdKqF4R jtwiaiybGfSwsm2CvLOSAPJUv1gpQj0fXI1f8FNIOwTq7nU79Xzm+ha3+FaIxg1wsTU6 k6ue/q+uSE2x/pT/6PKIbYj5DGM/SGjiIlgzSl+p8Q9vZ8/493tvonohNlhPf1NBzXGm YMBx8wKBDiV61wHATV7lDJ4EC86X8N4C+MXjLm16Qr7Gu1Qzcmy1qp6WmmcggX0n1XOP L9wA== X-Gm-Message-State: AOJu0YzFJqURkCR3TWcI9s8bx0LyW5/Kkcv0mrm9okJOJICxAdE3wNAp pAMpQqC8b7fmsID3NU8FIRqeDQLxYx0Xb/579IU= X-Received: by 2002:a05:6a00:807:b0:6be:2991:d878 with SMTP id m7-20020a056a00080700b006be2991d878mr17109310pfk.15.1698888623485; Wed, 01 Nov 2023 18:30:23 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 07/88] tcg: Improve expansion of deposit of constant Date: Wed, 1 Nov 2023 18:28:55 -0700 Message-Id: <20231102013016.369010-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 The extract2 expansion is too difficult for the optimizer to simplify. If we have an immediate input, use and+or instead, skipping the and if the field becomes all 1's. Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 828eb9ee46..e305260099 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -608,6 +608,7 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, { uint32_t mask; TCGv_i32 t1; + TCGTemp *ts; tcg_debug_assert(ofs < 32); tcg_debug_assert(len > 0); @@ -623,6 +624,19 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, return; } + /* Deposit of a constant into a value. */ + ts = tcgv_i32_temp(arg2); + if (ts->kind == TEMP_CONST) { + uint32_t mask0 = deposit32(-1, ofs, len, 0); + uint32_t maski = deposit32(0, ofs, len, ts->val); + + if (mask0 != ~maski) { + tcg_gen_andi_i32(ret, arg1, mask0); + } + tcg_gen_ori_i32(ret, ret, maski); + return; + } + t1 = tcg_temp_ebb_new_i32(); if (TCG_TARGET_HAS_extract2_i32) { @@ -2229,6 +2243,7 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, { uint64_t mask; TCGv_i64 t1; + TCGTemp *ts; tcg_debug_assert(ofs < 64); tcg_debug_assert(len > 0); @@ -2244,6 +2259,19 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, return; } + /* Deposit of a constant into a value. */ + ts = tcgv_i64_temp(arg2); + if (ts->kind == TEMP_CONST) { + uint64_t mask0 = deposit64(-1, ofs, len, 0); + uint64_t maski = deposit64(0, ofs, len, ts->val); + + if (mask0 != ~maski) { + tcg_gen_andi_i64(ret, arg1, mask0); + } + tcg_gen_ori_i64(ret, ret, maski); + return; + } + if (TCG_TARGET_REG_BITS == 32) { if (ofs >= 32) { tcg_gen_deposit_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1), From patchwork Thu Nov 2 01:28:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740351 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594004wrv; Wed, 1 Nov 2023 18:33:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2xD4XB9DaaJcvpJNzgHsK+/jVWbKHjaf5WcXBqq94uig/8aJGmH16MY9jdw46i8lXaT73 X-Received: by 2002:ad4:5bce:0:b0:66d:2fda:c9e0 with SMTP id t14-20020ad45bce000000b0066d2fdac9e0mr21539629qvt.61.1698888825000; Wed, 01 Nov 2023 18:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888824; cv=none; d=google.com; s=arc-20160816; b=D5Y+AFx3NhbyI6/+6wLDjxLb0L61hWlrM2Wj/5t2yG6ARom4UTMxHRUSAjMMGZqRej Zs/YKiEsXzqvMXzrseARMIzdo+MQ6yZWV646+h85rdhLK9xxSDOT5yN7c3GeA8M1WYwk wWBwn7TMLNU1tjynJbNpAkrg7VHu61XBa48x0gHtnGZeQ11slpWI2KfpfoFpF+hHhQFP C4Dl8B6ZaJb9dCXX40HYsFbStbvNHRSX5En4xdZNys9+k5zbFTQL6K7kfwD1tNSO+9Gx xDJv/r/hackvRxq8EbI1SRdbEUfmiQC/zyaCtUMmg9SiCJ8pV9C7M5489HYxcHdUdgS1 zcSA== 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=2BJlcx9oSMgaomOh7sPzTCOyXOzihSFEWq7bL9QPBTQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=0ck0baGiby8dREhla+JgXL3GNnXs0P6BdYIliRZggaw+9P+PCW4z23kA9eqZCd+5Qi wUgJejI5tKMSH8MwA4v2r8lGqLIt/bReonQtfhrD6yN2U5Gdqn5dVBimOQThp0fMy9Ca kLZMUO3PfUC4PFKGml4jQnPM/S27ljD9XhS7GdikRhhs7z5fBuLeCeWzuWiGiO+5Cclx DJ3JgBSOUZRjN6Fuzx04euB4dHuS1dxhjWO3VJlEtgBPphOhTM5A9D9sAx5iICopdseW p/EkKQCWJEh4Bi5gnfCu7TmKw6tlkTjIdSd6VkQqTrQDb0gkrw7+adQX6dhiteuf7V6H Jl7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B+JQs8re; 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 ef12-20020a0562140a6c00b006238ad6d2d2si3697229qvb.577.2023.11.01.18.33.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:33:44 -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=B+JQs8re; 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 1qyMXm-0005kV-1G; Wed, 01 Nov 2023 21:30:46 -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 1qyMXZ-0005Xd-ON for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXU-0001VC-8x for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:32 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so439726b3a.1 for ; Wed, 01 Nov 2023 18:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888625; x=1699493425; 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=2BJlcx9oSMgaomOh7sPzTCOyXOzihSFEWq7bL9QPBTQ=; b=B+JQs8reI4GrYaj4IioPFzXB1LmosxX5bqNnYj7Kgm3Xn2innnYz7yI1DwA5eUO8Ye Jkw2AMIlbTsRk+epizx/2N3XdWXVWivSusTeX2bhy9DUTzSX4UA90uILKMbXabrEk7Li GZqtJ5jDpI7auH91n8sBpuMKb1btYPlWqEKeRk0QS4W04iuK/uy2EZle6nqMasTsv1gH eB3E0QeS7x8pqXNvIAqRv+Bi4tkiiN+bPCG+r1veNAN3SDbFCpiqdSez6naXJPOEvhue 9ObhQi/Q+CpCdQZSYE75C1doRGT9P+6ViFfFj1Gjoz/ngw6HEgelHMbCG4qRfRFlOuOe YwIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888625; x=1699493425; 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=2BJlcx9oSMgaomOh7sPzTCOyXOzihSFEWq7bL9QPBTQ=; b=DiDlfs2pTnvzfWC85pDJp52rAOrZuAHRSZireitqPfkGzA8zzr8gBtpUyHYTjxFbiw bQRyPhvx5MuPOJD/XNUcIWO1HWQSxjqo0M5ujaffbPsPufUbeCfehJ2y/sRF6RZFa7EN UK6XiYgMuvD1kDzm+r8nmj3ROaP3mBoBuWM4azz/fax2g87saUZkh8y4VicW268yMxcE skz/pyoaAFtu3YdU905XzhpvHv1sl8uBQyvWYrw+5TW2I6oQZI/Qes6Y2LfSUsgvskG9 hGvQ3kUycBUf8quZ049q72Kdxd+ATgTaNkSzh4rckZ3bhNHV6cj3Kb4p6Wp+eE8oGmkI zwfg== X-Gm-Message-State: AOJu0Yxu+kHhZvJE+3mFkEsJSgDrVCk7M+Lout1X4IdWA705ukqvtDYL KcKWWCcsWYMop8VojGDKE8SlVYUFty6mhL6wtMI= X-Received: by 2002:a05:6a00:9a6:b0:6be:18a9:8f60 with SMTP id u38-20020a056a0009a600b006be18a98f60mr18378034pfg.16.1698888624315; Wed, 01 Nov 2023 18:30:24 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 08/88] tcg: Improve expansion of deposit into a constant Date: Wed, 1 Nov 2023 18:28:56 -0700 Message-Id: <20231102013016.369010-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Generalize tcg_gen_deposit_z_* from 0 to any constant. Use this to automatically simplify tcg_gen_deposit_*. Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 295 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 174 insertions(+), 121 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index e305260099..e6bf942106 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -603,6 +603,70 @@ void tcg_gen_rotri_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2) } } +static void tcg_gen_deposit_i_i32(TCGv_i32 ret, uint32_t i, TCGv_i32 arg, + unsigned int ofs, unsigned int len) +{ + i = deposit32(i, ofs, len, 0); + + if (ofs + len == 32) { + tcg_gen_shli_i32(ret, arg, ofs); + goto finish; + } + if (ofs == 0) { + tcg_gen_andi_i32(ret, arg, (1u << len) - 1); + goto finish; + } + if (TCG_TARGET_HAS_deposit_i32 + && TCG_TARGET_deposit_i32_valid(ofs, len)) { + tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, + tcg_constant_i32(i), arg, ofs, len); + return; + } + + /* + * To help two-operand hosts we prefer to zero-extend first, + * which allows ARG to stay live. + */ + switch (len) { + case 16: + if (TCG_TARGET_HAS_ext16u_i32) { + tcg_gen_ext16u_i32(ret, arg); + tcg_gen_shli_i32(ret, ret, ofs); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i32) { + tcg_gen_ext8u_i32(ret, arg); + tcg_gen_shli_i32(ret, ret, ofs); + goto finish; + } + break; + } + /* Otherwise prefer zero-extension over AND for code size. */ + switch (ofs + len) { + case 16: + if (TCG_TARGET_HAS_ext16u_i32) { + tcg_gen_shli_i32(ret, arg, ofs); + tcg_gen_ext16u_i32(ret, ret); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i32) { + tcg_gen_shli_i32(ret, arg, ofs); + tcg_gen_ext8u_i32(ret, ret); + goto finish; + } + break; + } + tcg_gen_andi_i32(ret, arg, (1u << len) - 1); + tcg_gen_shli_i32(ret, ret, ofs); + + finish: + tcg_gen_ori_i32(ret, ret, i); +} + void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, unsigned int ofs, unsigned int len) { @@ -619,6 +683,14 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, tcg_gen_mov_i32(ret, arg2); return; } + + /* Deposit of a value into a constant. */ + ts = tcgv_i32_temp(arg1); + if (ts->kind == TEMP_CONST) { + tcg_gen_deposit_i_i32(ret, ts->val, arg2, ofs, len); + return; + } + if (TCG_TARGET_HAS_deposit_i32 && TCG_TARGET_deposit_i32_valid(ofs, len)) { tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, arg1, arg2, ofs, len); return; @@ -673,53 +745,7 @@ void tcg_gen_deposit_z_i32(TCGv_i32 ret, TCGv_i32 arg, tcg_debug_assert(len <= 32); tcg_debug_assert(ofs + len <= 32); - if (ofs + len == 32) { - tcg_gen_shli_i32(ret, arg, ofs); - } else if (ofs == 0) { - tcg_gen_andi_i32(ret, arg, (1u << len) - 1); - } else if (TCG_TARGET_HAS_deposit_i32 - && TCG_TARGET_deposit_i32_valid(ofs, len)) { - TCGv_i32 zero = tcg_constant_i32(0); - tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, zero, arg, ofs, len); - } else { - /* To help two-operand hosts we prefer to zero-extend first, - which allows ARG to stay live. */ - switch (len) { - case 16: - if (TCG_TARGET_HAS_ext16u_i32) { - tcg_gen_ext16u_i32(ret, arg); - tcg_gen_shli_i32(ret, ret, ofs); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i32) { - tcg_gen_ext8u_i32(ret, arg); - tcg_gen_shli_i32(ret, ret, ofs); - return; - } - break; - } - /* Otherwise prefer zero-extension over AND for code size. */ - switch (ofs + len) { - case 16: - if (TCG_TARGET_HAS_ext16u_i32) { - tcg_gen_shli_i32(ret, arg, ofs); - tcg_gen_ext16u_i32(ret, ret); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i32) { - tcg_gen_shli_i32(ret, arg, ofs); - tcg_gen_ext8u_i32(ret, ret); - return; - } - break; - } - tcg_gen_andi_i32(ret, arg, (1u << len) - 1); - tcg_gen_shli_i32(ret, ret, ofs); - } + tcg_gen_deposit_i_i32(ret, 0, arg, ofs, len); } void tcg_gen_extract_i32(TCGv_i32 ret, TCGv_i32 arg, @@ -2238,6 +2264,98 @@ void tcg_gen_rotri_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2) } } +static void tcg_gen_deposit_i_i64(TCGv_i64 ret, uint64_t i, TCGv_i64 arg, + unsigned int ofs, unsigned int len) +{ + i = deposit64(i, ofs, len, 0); + + if (ofs + len == 64) { + tcg_gen_shli_i64(ret, arg, ofs); + goto finish; + } + if (ofs == 0) { + tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); + goto finish; + } + if (TCG_TARGET_HAS_deposit_i64 + && TCG_TARGET_deposit_i64_valid(ofs, len)) { + tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, + tcg_constant_i64(i), arg, ofs, len); + return; + } + + if (TCG_TARGET_REG_BITS == 32) { + if (ofs >= 32) { + tcg_gen_deposit_i_i32(TCGV_HIGH(ret), i >> 32, + TCGV_LOW(arg), ofs - 32, len); + tcg_gen_movi_i32(TCGV_LOW(ret), i); + return; + } + if (ofs + len <= 32) { + tcg_gen_deposit_i_i32(TCGV_LOW(ret), i, TCGV_LOW(arg), ofs, len); + tcg_gen_movi_i32(TCGV_HIGH(ret), i >> 32); + return; + } + } + + /* + * To help two-operand hosts we prefer to zero-extend first, + * which allows ARG to stay live. + */ + switch (len) { + case 32: + if (TCG_TARGET_HAS_ext32u_i64) { + tcg_gen_ext32u_i64(ret, arg); + tcg_gen_shli_i64(ret, ret, ofs); + goto finish; + } + break; + case 16: + if (TCG_TARGET_HAS_ext16u_i64) { + tcg_gen_ext16u_i64(ret, arg); + tcg_gen_shli_i64(ret, ret, ofs); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i64) { + tcg_gen_ext8u_i64(ret, arg); + tcg_gen_shli_i64(ret, ret, ofs); + goto finish; + } + break; + } + /* Otherwise prefer zero-extension over AND for code size. */ + switch (ofs + len) { + case 32: + if (TCG_TARGET_HAS_ext32u_i64) { + tcg_gen_shli_i64(ret, arg, ofs); + tcg_gen_ext32u_i64(ret, ret); + goto finish; + } + break; + case 16: + if (TCG_TARGET_HAS_ext16u_i64) { + tcg_gen_shli_i64(ret, arg, ofs); + tcg_gen_ext16u_i64(ret, ret); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i64) { + tcg_gen_shli_i64(ret, arg, ofs); + tcg_gen_ext8u_i64(ret, ret); + goto finish; + } + break; + } + tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); + tcg_gen_shli_i64(ret, ret, ofs); + + finish: + tcg_gen_ori_i64(ret, ret, i); +} + void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, unsigned int ofs, unsigned int len) { @@ -2254,6 +2372,14 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, tcg_gen_mov_i64(ret, arg2); return; } + + /* Deposit of a value into a constant. */ + ts = tcgv_i64_temp(arg1); + if (ts->kind == TEMP_CONST) { + tcg_gen_deposit_i_i64(ret, ts->val, arg2, ofs, len); + return; + } + if (TCG_TARGET_HAS_deposit_i64 && TCG_TARGET_deposit_i64_valid(ofs, len)) { tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, arg1, arg2, ofs, len); return; @@ -2323,80 +2449,7 @@ void tcg_gen_deposit_z_i64(TCGv_i64 ret, TCGv_i64 arg, tcg_debug_assert(len <= 64); tcg_debug_assert(ofs + len <= 64); - if (ofs + len == 64) { - tcg_gen_shli_i64(ret, arg, ofs); - } else if (ofs == 0) { - tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); - } else if (TCG_TARGET_HAS_deposit_i64 - && TCG_TARGET_deposit_i64_valid(ofs, len)) { - TCGv_i64 zero = tcg_constant_i64(0); - tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, zero, arg, ofs, len); - } else { - if (TCG_TARGET_REG_BITS == 32) { - if (ofs >= 32) { - tcg_gen_deposit_z_i32(TCGV_HIGH(ret), TCGV_LOW(arg), - ofs - 32, len); - tcg_gen_movi_i32(TCGV_LOW(ret), 0); - return; - } - if (ofs + len <= 32) { - tcg_gen_deposit_z_i32(TCGV_LOW(ret), TCGV_LOW(arg), ofs, len); - tcg_gen_movi_i32(TCGV_HIGH(ret), 0); - return; - } - } - /* To help two-operand hosts we prefer to zero-extend first, - which allows ARG to stay live. */ - switch (len) { - case 32: - if (TCG_TARGET_HAS_ext32u_i64) { - tcg_gen_ext32u_i64(ret, arg); - tcg_gen_shli_i64(ret, ret, ofs); - return; - } - break; - case 16: - if (TCG_TARGET_HAS_ext16u_i64) { - tcg_gen_ext16u_i64(ret, arg); - tcg_gen_shli_i64(ret, ret, ofs); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i64) { - tcg_gen_ext8u_i64(ret, arg); - tcg_gen_shli_i64(ret, ret, ofs); - return; - } - break; - } - /* Otherwise prefer zero-extension over AND for code size. */ - switch (ofs + len) { - case 32: - if (TCG_TARGET_HAS_ext32u_i64) { - tcg_gen_shli_i64(ret, arg, ofs); - tcg_gen_ext32u_i64(ret, ret); - return; - } - break; - case 16: - if (TCG_TARGET_HAS_ext16u_i64) { - tcg_gen_shli_i64(ret, arg, ofs); - tcg_gen_ext16u_i64(ret, ret); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i64) { - tcg_gen_shli_i64(ret, arg, ofs); - tcg_gen_ext8u_i64(ret, ret); - return; - } - break; - } - tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); - tcg_gen_shli_i64(ret, ret, ofs); - } + tcg_gen_deposit_i_i64(ret, 0, arg, ofs, len); } void tcg_gen_extract_i64(TCGv_i64 ret, TCGv_i64 arg, From patchwork Thu Nov 2 01:28:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740361 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594662wrv; Wed, 1 Nov 2023 18:36:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUwQRxPjZGwWesyxRNe5YsHnVccD8goDSg/gN4dTE9i3S0XVUPNGLLA9ae6NfGnIvxCHBG X-Received: by 2002:a05:6214:daa:b0:671:e02a:8bfc with SMTP id h10-20020a0562140daa00b00671e02a8bfcmr12540471qvh.16.1698888961090; Wed, 01 Nov 2023 18:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888961; cv=none; d=google.com; s=arc-20160816; b=wac3AIWYobP0Pib6BARkZJcca/BsSanRqEqNevhvyF/eoo/jJbrZ4jnIBGIOPOVdy6 TDqUKeY5It3J9NuPyDcyLGN3YDH7jZiSXMnuP5lwIq+loGB5VsXHhBHJHbX4Ybgy6UWf hUlYyzG3DOEqxpeYJChZSFiekt99JvGVcTQtdLtuDrq1PStKmuglpObBitb14gWKUAvc jHPo6yu4EHmjMhAQMlWXyd0XOht7wmUzhRmaSP+3tWDiqgv7K7XZNEVBzpL8w9R7kuSM w03XnARQ9CTCprfezz2GAn8GYj7J5/3hujBDpLqt5GVmSnTXE1yAu+K9qroMbX6yvqAb h9hg== 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=F19bYNjMsTQHbwWV3iaC5iIhiXLyL36kX1RXeq0LCC0=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=jxrbhyfDAervCnI0X2qvwLQDofT0FI80OQ+UtzbZNmiGP84mW9K/AK29uSwbHf3uOR WJRE96pU9bjUNSt+jRVc3ZWHPbSK9eDvJNK7j1i0FIMAtkP0gZZ+NzDk7s0P3YETSd7j kAaR4XcxwcRCXkNqCP4TJylpgZiXTancrqV8akHgBq7G4+Vd4T/vgeo3kj6TVJIfjLnM wXSXmQ5RX+5w9s0YXdfANyS9lOA1SSCz8TgnWuU1qeRiq5RBoWaKB8QC7UPnAzFjzl3g yZxl+M8+mc+TaRxUWogQyOuMNLG/1kK8ywSLGaR+CNai0u2OOj7Ki6dRQ9dgWsnrIUej BYAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wk0T+EU4; 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 e7-20020ad44427000000b0065b182a39e9si3579490qvt.26.2023.11.01.18.36.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:36:01 -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=Wk0T+EU4; 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 1qyMXi-0005ih-NJ; Wed, 01 Nov 2023 21:30: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 1qyMXa-0005Ya-Fu for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:34 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXV-0001WT-RP for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:34 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5b999980689so307560a12.1 for ; Wed, 01 Nov 2023 18:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888628; x=1699493428; 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=F19bYNjMsTQHbwWV3iaC5iIhiXLyL36kX1RXeq0LCC0=; b=Wk0T+EU4WTIABQH6NfEu6DiqBXPDtPppWuVvtMYJDa0WSVAmECgJNaiwvA2eDV+rjr RR2qiy6ZpD04kIqb8lqmDdqBLQpSqLNvfEUJ+7D5uf9zc22XbJPWYLB3npQqFHOa8SZN FzcoApLJMAkZqwQfyYY/D1r8Qim0Awx8BfEUiMj8w02gyFp+YmQs5hWYAw9xud5itzxy yuMj64jXeWgm4hlxpMxMPYX4EianBb1zxprmi7ovGzvmV5mv6ZsfpWTAEbbNm0ANcG9T zcohloXyQWJSSNKahd5bg7qcTW1M+Uow6KJvzdepL2+XmzQiRUAcGVUgYko3o/ykWnMe 3hOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888628; x=1699493428; 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=F19bYNjMsTQHbwWV3iaC5iIhiXLyL36kX1RXeq0LCC0=; b=oUzqvPjdrOUokCgV2T58HKGCWAC0AOVtgjoeLptY+KHHZYp125MmYBmKjrC5lZrWYj V4HY/TfmFrq2zHMYIj9F361AzHppanODdvjwF+93Xyhbt8ojU2VF4K3KkT0khgVmBl12 c5r/Tp2AJJRCUb/b7YkrYpWCwhwvjx/OWf6ajaWWVxR0AUTLrslcq+4/6smM8aa+Ske+ G9OvTmKDGP1v0N95+0D24AjYrTjaazRN8GK9onQLqSgZw4OfPAYQ/+voHS1+5FUZ0XG/ HruIuoxnSHQEp6tdVz0vJvmbmWvDXX1w47zPRZgEBJaMFj1i0N/EGhjSONXdbNHkUiqt xN6Q== X-Gm-Message-State: AOJu0YxY/Ne/oOI9aDpVRQRasF4SO+BiXUzaB8cGJySG7YpY4YPISg2d KYBP/pJUjUb/X499z3aa2+J/xFIgVx1Za8FmF1M= X-Received: by 2002:a05:6a21:788b:b0:14c:5dc3:f1c9 with SMTP id bf11-20020a056a21788b00b0014c5dc3f1c9mr16597788pzc.49.1698888625252; Wed, 01 Nov 2023 18:30:25 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 09/88] target/hppa: Remove get_temp Date: Wed, 1 Nov 2023 18:28:57 -0700 Message-Id: <20231102013016.369010-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Replace with tcg_temp_new without recording into ctx. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 76 +++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 45 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f6a656325c..99b9fc0561 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -254,8 +254,7 @@ typedef struct DisasContext { target_ureg iaoq_n; TCGv_reg iaoq_n_var; - int ntempr, ntempl; - TCGv_reg tempr[8]; + int ntempl; TCGv_tl templ[4]; DisasCond null_cond; @@ -492,13 +491,6 @@ static void cond_free(DisasCond *cond) } } -static TCGv_reg get_temp(DisasContext *ctx) -{ - unsigned i = ctx->ntempr++; - g_assert(i < ARRAY_SIZE(ctx->tempr)); - return ctx->tempr[i] = tcg_temp_new(); -} - #ifndef CONFIG_USER_ONLY static TCGv_tl get_temp_tl(DisasContext *ctx) { @@ -510,7 +502,7 @@ static TCGv_tl get_temp_tl(DisasContext *ctx) static TCGv_reg load_const(DisasContext *ctx, target_sreg v) { - TCGv_reg t = get_temp(ctx); + TCGv_reg t = tcg_temp_new(); tcg_gen_movi_reg(t, v); return t; } @@ -518,7 +510,7 @@ static TCGv_reg load_const(DisasContext *ctx, target_sreg v) static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_reg t = get_temp(ctx); + TCGv_reg t = tcg_temp_new(); tcg_gen_movi_reg(t, 0); return t; } else { @@ -529,7 +521,7 @@ static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) static TCGv_reg dest_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0 || ctx->null_cond.c != TCG_COND_NEVER) { - return get_temp(ctx); + return tcg_temp_new(); } else { return cpu_gr[reg]; } @@ -1071,7 +1063,7 @@ static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) { - TCGv_reg sv = get_temp(ctx); + TCGv_reg sv = tcg_temp_new(); TCGv_reg tmp = tcg_temp_new(); tcg_gen_xor_reg(sv, res, in1); @@ -1085,7 +1077,7 @@ static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, static TCGv_reg do_sub_sv(DisasContext *ctx, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) { - TCGv_reg sv = get_temp(ctx); + TCGv_reg sv = tcg_temp_new(); TCGv_reg tmp = tcg_temp_new(); tcg_gen_xor_reg(sv, res, in1); @@ -1108,20 +1100,20 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, cb_msb = NULL; if (shift) { - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_shli_reg(tmp, in1, shift); in1 = tmp; } if (!is_l || cond_need_cb(c)) { TCGv_reg zero = tcg_constant_reg(0); - cb_msb = get_temp(ctx); + cb_msb = tcg_temp_new(); tcg_gen_add2_reg(dest, cb_msb, in1, zero, in2, zero); if (is_c) { tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cpu_psw_cb_msb, zero); } if (!is_l) { - cb = get_temp(ctx); + cb = tcg_temp_new(); tcg_gen_xor_reg(cb, in1, in2); tcg_gen_xor_reg(cb, cb, dest); } @@ -1414,11 +1406,11 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, /* Note that RX is mutually exclusive with DISP. */ if (rx) { - ofs = get_temp(ctx); + ofs = tcg_temp_new(); tcg_gen_shli_reg(ofs, cpu_gr[rx], scale); tcg_gen_add_reg(ofs, ofs, base); } else if (disp || modify) { - ofs = get_temp(ctx); + ofs = tcg_temp_new(); tcg_gen_addi_reg(ofs, base, disp); } else { ofs = base; @@ -1538,7 +1530,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, dest = dest_gpr(ctx, rt); } else { /* Make sure if RT == RB, we see the result of the load. */ - dest = get_temp(ctx); + dest = tcg_temp_new(); } do_load_reg(ctx, dest, rb, rx, scale, disp, sp, modify, mop); save_gpr(ctx, rt, dest); @@ -1854,7 +1846,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, if (link != 0) { copy_iaoq_entry(cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } - next = get_temp(ctx); + next = tcg_temp_new(); tcg_gen_mov_reg(next, dest); if (is_n) { if (use_nullify_skip(ctx)) { @@ -1896,7 +1888,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, a1 = ctx->null_cond.a1; tmp = tcg_temp_new(); - next = get_temp(ctx); + next = tcg_temp_new(); copy_iaoq_entry(tmp, ctx->iaoq_n, ctx->iaoq_n_var); tcg_gen_movcond_reg(c, next, a0, a1, tmp, dest); @@ -1938,11 +1930,11 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) return offset; case 3: /* Privilege 3 is minimum and is never allowed to increase. */ - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_ori_reg(dest, offset, 3); break; default: - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_andi_reg(dest, offset, -4); tcg_gen_ori_reg(dest, dest, ctx->privilege); tcg_gen_movcond_reg(TCG_COND_GTU, dest, dest, offset, dest, offset); @@ -2104,7 +2096,7 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) break; } - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); save_gpr(ctx, rt, tmp); @@ -2177,7 +2169,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) case CR_IIAOQ: /* FIXME: Respect PSW_Q bit */ /* The write advances the queue and stores to the back element. */ - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); tcg_gen_st_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); @@ -2243,7 +2235,7 @@ static bool trans_rsm(DisasContext *ctx, arg_rsm *a) nullify_over(ctx); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_andi_reg(tmp, tmp, ~a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2263,7 +2255,7 @@ static bool trans_ssm(DisasContext *ctx, arg_ssm *a) nullify_over(ctx); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_ori_reg(tmp, tmp, a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2283,7 +2275,7 @@ static bool trans_mtsm(DisasContext *ctx, arg_mtsm *a) nullify_over(ctx); reg = load_gpr(ctx, a->r); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); gen_helper_swap_system_mask(tmp, tcg_env, reg); /* Exit the TB to recognize new interrupts. */ @@ -2692,7 +2684,7 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf *a, bool is_tc) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_not_reg(tmp, tcg_r2); do_unit(ctx, a->t, tcg_r1, tmp, a->cf, is_tc, tcg_gen_add_reg); return nullify_end(ctx); @@ -2714,7 +2706,7 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf *a, bool is_i) nullify_over(ctx); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_shri_reg(tmp, cpu_psw_cb, 3); if (!is_i) { tcg_gen_not_reg(tmp, tmp); @@ -2866,7 +2858,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) if (a->m) { /* Base register modification. Make sure if RT == RB, we see the result of the load. */ - dest = get_temp(ctx); + dest = tcg_temp_new(); } else { dest = dest_gpr(ctx, a->t); } @@ -2992,7 +2984,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, DisasCond cond; in2 = load_gpr(ctx, r); - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_sub_reg(dest, in1, in2); @@ -3029,7 +3021,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, cb_msb = NULL; if (cond_need_cb(c)) { - cb_msb = get_temp(ctx); + cb_msb = tcg_temp_new(); tcg_gen_movi_reg(cb_msb, 0); tcg_gen_add2_reg(dest, cb_msb, in1, cb_msb, in2, cb_msb); } else { @@ -3388,7 +3380,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) nullify_over(ctx); #endif - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_addi_reg(tmp, load_gpr(ctx, a->b), a->disp); tmp = do_ibranch_priv(ctx, tmp); @@ -3485,7 +3477,7 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) static bool trans_blr(DisasContext *ctx, arg_blr *a) { if (a->x) { - TCGv_reg tmp = get_temp(ctx); + TCGv_reg tmp = tcg_temp_new(); tcg_gen_shli_reg(tmp, load_gpr(ctx, a->x), 3); tcg_gen_addi_reg(tmp, tmp, ctx->iaoq_f + 8); /* The computation here never changes privilege level. */ @@ -3503,7 +3495,7 @@ static bool trans_bv(DisasContext *ctx, arg_bv *a) if (a->x == 0) { dest = load_gpr(ctx, a->b); } else { - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_shli_reg(dest, load_gpr(ctx, a->x), 3); tcg_gen_add_reg(dest, dest, load_gpr(ctx, a->b)); } @@ -3834,7 +3826,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) nullify_over(ctx); - t = get_temp(ctx); + t = tcg_temp_new(); tcg_gen_ld32u_reg(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); if (a->y == 1) { @@ -4090,9 +4082,7 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; ctx->base.max_insns = MIN(ctx->base.max_insns, bound); - ctx->ntempr = 0; ctx->ntempl = 0; - memset(ctx->tempr, 0, sizeof(ctx->tempr)); memset(ctx->templ, 0, sizeof(ctx->templ)); } @@ -4141,7 +4131,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) This will be overwritten by a branch. */ if (ctx->iaoq_b == -1) { ctx->iaoq_n = -1; - ctx->iaoq_n_var = get_temp(ctx); + ctx->iaoq_n_var = tcg_temp_new(); tcg_gen_addi_reg(ctx->iaoq_n_var, cpu_iaoq_b, 4); } else { ctx->iaoq_n = ctx->iaoq_b + 4; @@ -4162,13 +4152,9 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) } /* Forget any temporaries allocated. */ - for (i = 0, n = ctx->ntempr; i < n; ++i) { - ctx->tempr[i] = NULL; - } for (i = 0, n = ctx->ntempl; i < n; ++i) { ctx->templ[i] = NULL; } - ctx->ntempr = 0; ctx->ntempl = 0; /* Advance the insn queue. Note that this check also detects From patchwork Thu Nov 2 01:28:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740337 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593318wrv; Wed, 1 Nov 2023 18:31:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6UBCX5HTRwquK7kzNHFh3lizK4Q+snlo+k4UHWcfqrVbzJzRjePcCTcfT3wim1UKu598S X-Received: by 2002:a05:620a:454c:b0:76f:2899:3a96 with SMTP id u12-20020a05620a454c00b0076f28993a96mr20464361qkp.0.1698888683280; Wed, 01 Nov 2023 18:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888683; cv=none; d=google.com; s=arc-20160816; b=eit2ovo31jyfVRDZTF1uX5uVdtvp4Cxf/ePec/ov9XyhWXJkpZXVAq6ni3dao1pzw0 1NEpl+HiPTUOC3gpXLJrg+xokcy06QVtCbV70YorU9bXrvj3OwfcP5Drf4cIn03HeJlr sfddU6DwZuOntaICqYAGn6UVeEXalhUChbzQzL96+J3E1NO9uME6HmIn9iW3JgZmRbWQ QZ3MEuz80p0IoBxK4hqsHOnouUKhBj5RbvzRlt+v3QcYSsvOmAArekihIPLNzMJEXnVd 1FZzuTZnt4ZcO9+jVYOS4quQNV2EXj2W+RYetKTCXGqRBLda3h12QKrm4wv9HbAuxYtQ /M/A== 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=bvXYKg4Es3NrG6eHMj0weL8uuUejOJtJKCTcJARULmU=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=fosnXb7yI1/YsJRt/+1RQIi0ULdw/PDYxEP8CGMqxL2/hfk6i4QnAZmApo8cSMlUbI /iB+1qL/NwZoUnbtx71BA4/oOMxKPzgSLNSnZPUIPSGqgfNYoZP5B9Y1XXoNF8zZObRX nL9dkEv8SIs81d74bUOfkasls7mBb4mXOHH8ogBEZWYWj9OhtFMTOxQ1hVZ9MwFDoF7c z21SIzNA2Q9DccAfnjQe30dy3e9sKlCDcDeouVm6vSPmqytNI4f+Vv47j+5MhdCvmInH ooOK+LVidHi3wjVdDYdkzuZB3I9JlFpgTbFyFuJ+232qH7hpX3DtG3JFO/yz3vWRcHkf 1sdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HvP8BLTQ; 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 bk12-20020a05620a1a0c00b0077429eb9588si3633725qkb.326.2023.11.01.18.31.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:31:23 -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=HvP8BLTQ; 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 1qyMXe-0005aG-Cd; Wed, 01 Nov 2023 21:30:38 -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 1qyMXY-0005Uq-CS for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:32 -0400 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXU-0001VL-9b for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:31 -0400 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3b2e44c7941so277470b6e.2 for ; Wed, 01 Nov 2023 18:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888626; x=1699493426; 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=bvXYKg4Es3NrG6eHMj0weL8uuUejOJtJKCTcJARULmU=; b=HvP8BLTQDWYG2mqewOAfslLNCFvYSj+73pDS7kurOk5krBXpqXJ8F9DrIvFaeiCylu wfgIcQ3Inu1KIc4IXvNIgtxzWLyw4Ve9e9Oycnq3dyIGtqo+7eh7L13bZKoFv9iBy3OM M0vtckWo3HToxykvsPiGS6LImQ/1ZM1zk6zgNMpr5Pk9OzT4AVFVPQPw6nyx/GR7SG0C QPwP0oeBTBFAMCX05iov7TmsURB9eZ4OAS1fpwK10ucH3NEd8qSAv3npRc7a0lZzX2Hw IyGvlpSRUqfwsZJoehIk6dCHvY+AZwwBLXHCg8Bu3rggbHS238+F6emq3trUyyCE5C0R bBZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888626; x=1699493426; 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=bvXYKg4Es3NrG6eHMj0weL8uuUejOJtJKCTcJARULmU=; b=AmpQPLBtugyQ4NFKLsfVtjFfe4ijaYQkpuJc3b47MG/kABtKCxDWXedhzGmMpP0RVo WC9X8T6PQJE7sxQLN10XrOWHuhGqTOUg/Rydv326phUYyyO21nxoYPcLc4KJuiytHIyI lnJyLuYWuCZA/4gdPWbOEa96OEt0QUs5T9yZeBhtY7LHCzQ10Y/B0fCSPAdvlbi3pI3D xaMQWWh0/7tbVnO4g5oJXCxzaSEJCBlDINbaZWHphPGLdftgF73lM3QPj1NIo1PVrduy Fzt0a9F53fr/0B5muOVYr1MRoPIOHPxktgqv9PMU/Cfj/2bhnnGgh2b25wZ+e/a9ejuI XN1A== X-Gm-Message-State: AOJu0Yw2NjQYR+MBlz1t7msv3T/PWjF2yamxnMIINPQDinGykAOiha4l DiCw6+IRYYeO4DPZKV3tN4LgdMP7o6HzyoXJpNc= X-Received: by 2002:a05:6808:208a:b0:3b5:65b0:425 with SMTP id s10-20020a056808208a00b003b565b00425mr7626435oiw.21.1698888626699; Wed, 01 Nov 2023 18:30:26 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 10/88] target/hppa: Remove get_temp_tl Date: Wed, 1 Nov 2023 18:28:58 -0700 Message-Id: <20231102013016.369010-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Replace with tcg_temp_new_tl without recording into ctx. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 99b9fc0561..3c4a759628 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -254,9 +254,6 @@ typedef struct DisasContext { target_ureg iaoq_n; TCGv_reg iaoq_n_var; - int ntempl; - TCGv_tl templ[4]; - DisasCond null_cond; TCGLabel *null_lab; @@ -491,15 +488,6 @@ static void cond_free(DisasCond *cond) } } -#ifndef CONFIG_USER_ONLY -static TCGv_tl get_temp_tl(DisasContext *ctx) -{ - unsigned i = ctx->ntempl++; - g_assert(i < ARRAY_SIZE(ctx->templ)); - return ctx->templ[i] = tcg_temp_new_tl(); -} -#endif - static TCGv_reg load_const(DisasContext *ctx, target_sreg v) { TCGv_reg t = tcg_temp_new(); @@ -1374,7 +1362,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) if (sp < 0) { sp = ~sp; } - spc = get_temp_tl(ctx); + spc = tcg_temp_new_tl(); load_spr(ctx, spc, sp); return spc; } @@ -1384,7 +1372,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) ptr = tcg_temp_new_ptr(); tmp = tcg_temp_new(); - spc = get_temp_tl(ctx); + spc = tcg_temp_new_tl(); tcg_gen_shri_reg(tmp, base, TARGET_REGISTER_BITS - 5); tcg_gen_andi_reg(tmp, tmp, 030); @@ -1420,7 +1408,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, #ifdef CONFIG_USER_ONLY *pgva = (modify <= 0 ? ofs : base); #else - TCGv_tl addr = get_temp_tl(ctx); + TCGv_tl addr = tcg_temp_new_tl(); tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); if (ctx->tb_flags & PSW_W) { tcg_gen_andi_tl(addr, addr, 0x3fffffffffffffffull); @@ -4081,9 +4069,6 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) /* Bound the number of instructions by those left on the page. */ bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; ctx->base.max_insns = MIN(ctx->base.max_insns, bound); - - ctx->ntempl = 0; - memset(ctx->templ, 0, sizeof(ctx->templ)); } static void hppa_tr_tb_start(DisasContextBase *dcbase, CPUState *cs) @@ -4112,7 +4097,6 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) DisasContext *ctx = container_of(dcbase, DisasContext, base); CPUHPPAState *env = cpu_env(cs); DisasJumpType ret; - int i, n; /* Execute one insn. */ #ifdef CONFIG_USER_ONLY @@ -4151,12 +4135,6 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) } } - /* Forget any temporaries allocated. */ - for (i = 0, n = ctx->ntempl; i < n; ++i) { - ctx->templ[i] = NULL; - } - ctx->ntempl = 0; - /* Advance the insn queue. Note that this check also detects a priority change within the instruction queue. */ if (ret == DISAS_NEXT && ctx->iaoq_b != ctx->iaoq_f + 4) { From patchwork Thu Nov 2 01:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740341 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593514wrv; Wed, 1 Nov 2023 18:32:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSrz6RtErniODXPBerEL4zokB5oR50ccRQQiUpedkyU/OMg1HSrHO55GIpVH7OoahUb/8K X-Received: by 2002:a05:6830:a:b0:6bd:1059:8212 with SMTP id c10-20020a056830000a00b006bd10598212mr17372297otp.26.1698888722104; Wed, 01 Nov 2023 18:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888722; cv=none; d=google.com; s=arc-20160816; b=luoNEwD0JMjayVfRITzleelyHlWpirUfRGSIZ/DIIItIXaKRKUe7jO1Cwvb9YhoGPm UUc/N4oc1wB+AvqsoHSmcttv0BYRdhDMBpIruJMExA1DZVN6gtyxHN4eQ8aKKQBH+oEI TbcCBqccAeep8TucJw7rdGJnuEXkzYJ5m1BcQAwmQMppkNk/wKXyBX0Ae6rfiWEiDygW UKBBzMry5FBjLGhBW9dRyUfhk/DS/iYg7v0LsJkLyGcGp6ldpW/4bF4bhBYA9/pKO4VU 7NCzDeJbTPJMgTClA+MohGB9uSz4sICbyPAMbnNlKrLdSDHcnHWNLMu5Q37ILWOsvaGo aV/A== 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=BJWPaMmS7HS/DrXXKR0DYhMSrnqFI+qqQylX9ZBFipk=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=f/4NKFpeos+rdpvFZfp2D27x8toG2iFrCLjW+Xd+MojrQIynfdVriJ0C+S380Re2CD G/JhHXwxqwLtxvR6lk6DXO8RrbiEAPv06N+VNB5KDpFCwwAO6i/A/GhSY7YNwpgtRjn2 Oh1vF7ojB6vINzCKInL5Xuac0iUcuDdqW76B0/MqGPMzYhre8z9n0vyYEE1RgOXC6WG0 AYszVOroJnetlz8YXQ7Ptd1bAUmmeTdwGbVaX+GWfPD/AVrG2C6axQBjBcjL3gXCyRsZ oC0ut1SGiHfB2jJLcYzi/vCvWneIOUoJJHU97CUum38okCL8aB53OIMtrHSDQau+CpHK X4oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rRMwf5ej; 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 c17-20020ac85a91000000b004197e89b6e1si3544627qtc.474.2023.11.01.18.32.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:02 -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=rRMwf5ej; 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 1qyMYJ-0005pH-F0; Wed, 01 Nov 2023 21:31:19 -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 1qyMXe-0005cH-Gr for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:38 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXa-0001Xh-22 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:35 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6ba172c5f3dso493616b3a.0 for ; Wed, 01 Nov 2023 18:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888632; x=1699493432; 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=BJWPaMmS7HS/DrXXKR0DYhMSrnqFI+qqQylX9ZBFipk=; b=rRMwf5eji0NArohWASGJVPPLJVSOj0tGJvxFYPqAg8VA+dDWUOr57+pXbZBRwhRgYk NxX9gu9oCjM+iOKLqiwFng/MlsktA30IaXm+wsbUStQkOtG2Z5biHXfYjMxWVXptQhWB RZsXYbgMUstHdyE9Mz/Yo5gtKDorQzI18rZ1qgG1BjHHvP/drLhEg7cDyy5++IKRpU+M mLYYWJGYCdaa3V0YRsKtcSVN6dnvhAbiU0isFgSa3ZCTQA7v58imEnNVKDoZf3gDuwlR vYrn0r+lv252x51REgOsxq0VgIqXFeg17O+9o5WevGIpdhiOwhOryAikuNcMn2H1sALU 4W6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888632; x=1699493432; 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=BJWPaMmS7HS/DrXXKR0DYhMSrnqFI+qqQylX9ZBFipk=; b=OUpH4eLiYMU7SinHQm6aqy5YDwKTMYbMe0sCBrEYb+wsXmKn7aTgd6s6zVxk/Pr/MC wkeoMI/dfn1qTlbQs52z1n+YdcmFEZ8HFOT7dEEwmEVWPTY4mRJ3EPmw/IxIbO3Tp6LB JzMx9ifs3sF6GIgcrhOA3IOlBZWe/XfOzsfFdXmN41yHA+PrjSRAaPB3a0rFudNymXiB X/8GCu2GTz8MpSR4cqp23JZLpnhn2R7JVjjjjhB0glxE0GzGsk8vgIbppk322qEdohYw lhMQpnZX0pN666hykrUNOK1vc5aQARpDlIHtio/Et0yu3tJxqTCeRIAX7FL8cEJvXrl1 471A== X-Gm-Message-State: AOJu0YyTH59F9wmgDDjP8AXUfwldrOpJarCzpUpMXjLYi0J4DTzeUQKu WYzDs7X8lLZtyzoUhC5psjj/hzJx7c1+41xlCj8= X-Received: by 2002:a05:6a00:2e28:b0:68e:41e9:10be with SMTP id fc40-20020a056a002e2800b0068e41e910bemr17533565pfb.20.1698888627393; Wed, 01 Nov 2023 18:30:27 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 11/88] target/hppa: Remove load_const Date: Wed, 1 Nov 2023 18:28:59 -0700 Message-Id: <20231102013016.369010-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Replace with tcg_constant_reg. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3c4a759628..c8384fccd9 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -488,13 +488,6 @@ static void cond_free(DisasCond *cond) } } -static TCGv_reg load_const(DisasContext *ctx, target_sreg v) -{ - TCGv_reg t = tcg_temp_new(); - tcg_gen_movi_reg(t, v); - return t; -} - static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { @@ -1164,7 +1157,7 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, if (a->cf) { nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf); return nullify_end(ctx); @@ -1253,7 +1246,7 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) if (a->cf) { nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf); return nullify_end(ctx); @@ -2808,7 +2801,7 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf *a) nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf); @@ -2994,7 +2987,7 @@ static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a) static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) { nullify_over(ctx); - return do_cmpb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n, a->disp); + return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); } static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, @@ -3033,7 +3026,7 @@ static bool trans_addb(DisasContext *ctx, arg_addb *a) static bool trans_addbi(DisasContext *ctx, arg_addbi *a) { nullify_over(ctx); - return do_addb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n, a->disp); + return do_addb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); } static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) @@ -3345,7 +3338,7 @@ static bool trans_depwi_sar(DisasContext *ctx, arg_depwi_sar *a) if (a->c) { nullify_over(ctx); } - return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, load_const(ctx, a->i)); + return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, tcg_constant_reg(a->i)); } static bool trans_be(DisasContext *ctx, arg_be *a) @@ -3852,7 +3845,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) return true; } if (inv) { - TCGv_reg c = load_const(ctx, mask); + TCGv_reg c = tcg_constant_reg(mask); tcg_gen_or_reg(t, t, c); ctx->null_cond = cond_make(TCG_COND_EQ, t, c); } else { From patchwork Thu Nov 2 01:29:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740339 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593502wrv; Wed, 1 Nov 2023 18:32:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGLMNYD0pkpX2OaxmUxAbizPNXv4yD3/M76FyAuiylUWRWGeR2j4CN9aI9FeKXXNlGzhWb X-Received: by 2002:a1f:2ac5:0:b0:493:7df9:bcc4 with SMTP id q188-20020a1f2ac5000000b004937df9bcc4mr12426205vkq.4.1698888720108; Wed, 01 Nov 2023 18:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888720; cv=none; d=google.com; s=arc-20160816; b=TxrIk+iofQfw8nYShPijmJfL+OHHhJApZ9DwW6e++afXjQVTDuG/UxavKumqrCCVR9 prBbbmbVNiQ4TIfoBi1nWgocpTQxTBTYNbtQ/LhXcn5mYyJBnlvQmheZlV9U7Q7L5Zpg DPsI2IlhPXt7CLBhicucMSXz4jkCU+7a8NL/tJJh1JuNxgKE2iMO5sr6yAwQ2xEg0iBi gDWBFICLXHecFTFifKT0rsXU7c6UmtbCYYkYyAaFJXVBWJ1OZFD18jcnw7Jffxlmi/5I Mj4Sk0U4+ooCs3qDSNGj9TYjDV9zRxAUT6CQhRSE9Kcjh/vAeOBz/js9NKE162E+5wOK xXxQ== 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=WGcbTt26SgxS0ytgFRjc8lzuW9J4z1MRxuXRCSnc66o=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=GYvTxJxzGdFMA4Ij7gBMvghU2lUtewGg7ytxrH3wKkYpOChfP+g3vL1dMHfyztF28w lrUyjEQAUyeABTHWmHiHOBul4aLbIZRyZt++dCFtjdZKCalU8GXMyRGct+I6pyHxmXW8 Fn2IyxF1Lg4TzsAF6tZOLp0ugsyqaM56JNntrtNgoqBjPldwZVKCquuvb62sbviXBlpa /c2wMZ7myKSwZqCV4xQjoVxVsalVtRc0T+xHD88ToVxMDCE+D0mh0Is7L/cmtY8iTM/M MTUsfJq7e1Xh5NOoufQt3K9jxjSsNgaP71kog1GMJqdiH0+3i49WQBrD+iGQND1ZUm4H txrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jxrfuVut; 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 i8-20020a05620a248800b0077a02969c52si3114999qkn.65.2023.11.01.18.31.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:00 -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=jxrfuVut; 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 1qyMXn-0005l6-2i; Wed, 01 Nov 2023 21:30:49 -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 1qyMXa-0005YZ-Ez for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:34 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXW-0001Ww-9q for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:33 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso500087b3a.2 for ; Wed, 01 Nov 2023 18:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888629; x=1699493429; 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=WGcbTt26SgxS0ytgFRjc8lzuW9J4z1MRxuXRCSnc66o=; b=jxrfuVutmwWCVj810h/jVmNUT6D6EF4lotCL7AYsnxfBsPlJy1kDYwMfFurAkPVaJ5 TH15rkIIwtXqRSdE6n65Eb+IO9ZCG0Swk1tuOTR7isLB2XfoI6eG9lGV3tkxDqoAyR1g YJ73UPLzrQ89eW9MSl5iv94A6DJ3XzkpbNWQmxn4dJR+8hO+9zt8x3NOXaWdHY6Q6Iir zEAY78rY//5d7n71iI/fPzxz9BgGgmax0A2P0LsRz5RUn/Zz83Rq0vEQTDIaIGNRPgV5 jFiErKqtga5buZ3o7uoF2Ab6vSdvwSvPg6+2zqX8ylzUfbQVVNkizThPDpxP61V3g13t inEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888629; x=1699493429; 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=WGcbTt26SgxS0ytgFRjc8lzuW9J4z1MRxuXRCSnc66o=; b=dc5eIvxBJXG1RGIBDy+aKx0nK87Quma1o6/6bxjH2uj17zLCnsGEtNO7vXEAp5PHzY qGQE7T3I/Vic7WBw9G3yKVlA5KZM98/uN6nZZ9W/zRo+3LyWfARCESQ4BWOBvShtIDr9 4tTVBoayq+KRMZl2Bb53D3DGx7vAj9JJvtYlOPFKQl2VM0bthbUTGjaJNRvS3DQOFO2n x3POCf4xSmwK1TGGjwJIAu5eMTIeDc4Xfee0ZVPmKUKYFVq90mMwrl7c1PgvG7GJ2fvL 2LuYf+mgQ0ILTpCd/rhj7v3jOLD6ZtGTLqUoFBYlCT+VVVE05r2g/y1uaTHlEzMh/8fD /ahg== X-Gm-Message-State: AOJu0YwnON/Dqr7hi3GwmXiz7/7QgPN34b2P6A31i/LYZdrlsEq2Wbnc jh2pJZt45Hh+ddfBET6mz6ox1/LGhM7jTmyr0kQ= X-Received: by 2002:a05:6a00:16ce:b0:6bc:62d0:fff6 with SMTP id l14-20020a056a0016ce00b006bc62d0fff6mr21933584pfc.32.1698888628054; Wed, 01 Nov 2023 18:30:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 12/88] target/hppa: Fix hppa64 case in machine.c Date: Wed, 1 Nov 2023 18:29:00 -0700 Message-Id: <20231102013016.369010-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Typo of VMSTATE_UINTTR_V and VMSTATE_UINTTR_ARRAY_V macros. Signed-off-by: Richard Henderson --- target/hppa/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/machine.c b/target/hppa/machine.c index ab3e8c81fa..61ae942ff1 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -24,9 +24,9 @@ #if TARGET_REGISTER_BITS == 64 #define qemu_put_betr qemu_put_be64 #define qemu_get_betr qemu_get_be64 -#define VMSTATE_UINTTL_V(_f, _s, _v) \ +#define VMSTATE_UINTTR_V(_f, _s, _v) \ VMSTATE_UINT64_V(_f, _s, _v) -#define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \ +#define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) #else #define qemu_put_betr qemu_put_be32 From patchwork Thu Nov 2 01:29:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740388 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595734wrv; Wed, 1 Nov 2023 18:40:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIq+z3vGE7rfJGO4+sNT7r8/77m7bJ4K/5nF14Fgr0C98M62iu0sijuY6+S3jkZOaD1Zd0 X-Received: by 2002:a1f:2cc9:0:b0:499:dec9:e1a8 with SMTP id s192-20020a1f2cc9000000b00499dec9e1a8mr15418133vks.14.1698889208212; Wed, 01 Nov 2023 18:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889208; cv=none; d=google.com; s=arc-20160816; b=x+Ol+h7QKbxCe4LZqYEtvTkEVtMCL+v/DDXpC6xRrj68MXD4vMeeneXtAJ1Z0sCYYp 0iI++stvb1GKriVRnQmZUm7JDMURUqzLRh8/Oyk8dJjVC9l3ISXQMTXNcw7L84eUqpPH 6ASSZYbjwmcNEqWqN3P1zBSQe2LJmtL+BJ6Qf1MXMLOkjn2ydIhPa3uzeq+y7282dQCK BoFM6l643RsPB/lhlPa2mYxfdzeRaJqXPUxhgprzbTbsL3Utzta6+XYBUWZYtE/ZoobX PhTALRRBu3zWCcB2fqAPEggZTjGB7QhQvySy1g7XlmExxNff44uCuEU6lvviQC1cjTVw MZig== 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=FgvfDwyIoGSK++AEaNdMmfoRCVSVHMXHgiFS4BjrPMw=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=DO/eRsfHG/HIMAQmSFqrGFgK0GK2o2/v6mHMZQJEW/FBdhxz/WeHHxjl8K6IkL67VX B1kfevjxbipmP9p3D8g8C+Tn5NmvwyaqUDcTBm7z10XRBmW6BbPyaLFLV00sirfmYXuK 5Ce/pA8GXABGrupzcdohOOu8e3CF8HKYhFhSEIJ+zgWhnbTsScJphMD9vMlyXdRQUi9B Mv0l/ZPOUoGJSnQxm6OGAl4I4TUBSrvGGHeTt67sbtPPMUxsUnIgWb6TUxGut2bWWseK RsBZ8l4s/RIqa+M6Iqg2JOv8fjl0NRQqOlqwUiOhhkh1g2alOaDHqE+Tezyom4/JTMoS sR2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RxHVe8Fp; 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 f18-20020ac87f12000000b00418122a226dsi3594353qtk.159.2023.11.01.18.40.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:40:08 -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=RxHVe8Fp; 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 1qyMXq-0005nA-TU; Wed, 01 Nov 2023 21:30:50 -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 1qyMXe-0005cF-GG for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:38 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXa-0001Xz-Cc for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:37 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-692c02adeefso466035b3a.3 for ; Wed, 01 Nov 2023 18:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888633; x=1699493433; 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=FgvfDwyIoGSK++AEaNdMmfoRCVSVHMXHgiFS4BjrPMw=; b=RxHVe8FpoamB40fRCEiUyFNytX29/prRAhFy+uHJtn35VpdTOaH18X6T0frjK+H0C1 k/QsKA2yy/dbKhXikCj//vf9wpFlZWzVNsorsq5OR7qh1veNdqn0Duk4dSrpGAWCxKTw +kOnW3REZ25z0W25Rn2srCtIk27OhJ0b+F+3AWUvktFisiVDuwX36zvho1zwPRZid9ch 6MldHd5zxJUjKCDw2Km/P+reMQszqpJcepreoWBFMVJspG2tWUsiCP7Ycp1EJ+9cZYJq w54CalV9KzQitPuxOjURwwqIF37FyKI3LPj03P18iP+Cp4KXdXcJX9wHE2k/lXSrUYDt 5JQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888633; x=1699493433; 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=FgvfDwyIoGSK++AEaNdMmfoRCVSVHMXHgiFS4BjrPMw=; b=WZoIvPy4EAYOLID0Xh1bdSWASlGS1CXeQjO3I3i0jHCY9hiDZFEwiqAuKxT+epr15B gPxoa2M5UmZGrD6fz7rOOwAoO0TkYW6togSvoKhkYSnOCuK9AlZOz/MmeZh8ljXLqusw SFVWwG5TWJiDh2hUqKZ8WZB7CBkFEwYs0JK+49kuH8L5SfTiJQM3F4FrFtu5H5XAKc4Z DyzHMQvdDT/SWabjOhkjvTtdtvWFqP6ED6Jjqhp2Wvb8mMLldUykV5SoZu/NfKgylX7m g9C5nSzdysVqgjoGd5Euuc+KNHQ08Jk/C4hdEHUZZXhvfs6MtZcopPNTbNjKAUHgnUKT hWBg== X-Gm-Message-State: AOJu0YxGOpetdCOIMCQkQqnDwHPKaGofCo5DIxra0NSqyl4I8eMfWEnv gyITRY2aKR0R7yEDlETonuIwryQcHcV0umsGP/Q= X-Received: by 2002:a05:6a00:138a:b0:68e:3772:4e40 with SMTP id t10-20020a056a00138a00b0068e37724e40mr17728137pfg.3.1698888628817; Wed, 01 Nov 2023 18:30:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 13/88] target/hppa: Fix load in do_load_32 Date: Wed, 1 Nov 2023 18:29:01 -0700 Message-Id: <20231102013016.369010-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 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 The destination is TCGv_i32, so use tcg_gen_qemu_ld_i32 not tcg_gen_qemu_ld_reg. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c8384fccd9..20e44ed528 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1430,7 +1430,7 @@ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, form_gva(ctx, &addr, &ofs, rb, rx, scale, disp, sp, modify, ctx->mmu_idx == MMU_PHYS_IDX); - tcg_gen_qemu_ld_reg(dest, addr, ctx->mmu_idx, mop | UNALIGN(ctx)); + tcg_gen_qemu_ld_i32(dest, addr, ctx->mmu_idx, mop | UNALIGN(ctx)); if (modify) { save_gpr(ctx, rb, ofs); } From patchwork Thu Nov 2 01:29: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: 740353 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594372wrv; Wed, 1 Nov 2023 18:35:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDISNk3+bP9lfApHlSNq4aVbJI58YlhHKcRzi3qUJ2LiHLY8cx+MYCYWQSLg0lkf4l8tZU X-Received: by 2002:a05:622a:138f:b0:41c:dd28:d16f with SMTP id o15-20020a05622a138f00b0041cdd28d16fmr22195718qtk.55.1698888908733; Wed, 01 Nov 2023 18:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888908; cv=none; d=google.com; s=arc-20160816; b=s9IO3b4Gh3vrK0RKiikSseiK8GrGPhXg6pcWjENypU1IZ882CQpHqmYkET+mwflerJ hRx3q8TFyxLbqwvbxOWy1YZYOYDrAsKdMJlLe4IdybB3hy/+zGh0bf4k1B1N3ZNiDKZQ 7OkWuwLC5uwnHHoE95l78nFGvKXK+BAPAr6Fk0iNnHDDZ6BhyzGL4HLxN1B+EZl9M8QD /Xe+mqLrLChrtaQsXRfVdO+t6OqtWm6c+lPhk+FNfvVCp+IvLAsLBRaQszCwtCFZt71H IcTaMaQ5wELHrCSmtE01Jso2t+sdGkISqjl4tZfzFMuYJouiMWLTjGUAFfmVFGtI5K3R 7JCw== 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=XeA0a/Gb8/dUQrnhDd66G5WVnhzf9jbEb4csjTyLblA=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=XE/hlZd1wZns7VZ07+A2XlMhX9KOkQTrEDOWObUImIQctthhbvQ9d9CVrgVe/gskbS DXwbtb4Z0oDmBxCgyeY20yQzPvDFC9UuaHwT27Nr7msunBO9m9PPao2u4Z6Lv2zc2hST NQTIJY7G9Iu4NnMSQW7kUq7oiUnpNOXPP9Th9Ec7MFXnHcLp3relPJ9+YOAFXieuZF/v B4jfgQR7fon2MZN/Q1NMBxKDnD8d0brY9jI85VN4grI7DW3rm+CfeNkldJPHl8yqo+CX 7fynD7hDRrZc64ad6DFEIMpluhzrP7bdrUnFJdHgMdHEIzU/igyK75Kdp0anFe39RLpu T/HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wADSRQ+f; 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 w16-20020ac857d0000000b0041e4be2d3c7si3747266qta.360.2023.11.01.18.35.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:35:08 -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=wADSRQ+f; 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 1qyMXh-0005hI-0H; Wed, 01 Nov 2023 21:30:41 -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 1qyMXe-0005c1-GG for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:38 -0400 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXW-0001X2-JF for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:34 -0400 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3b5714439b3so243894b6e.3 for ; Wed, 01 Nov 2023 18:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888629; x=1699493429; 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=XeA0a/Gb8/dUQrnhDd66G5WVnhzf9jbEb4csjTyLblA=; b=wADSRQ+fRsb6cmD1ZP9qL76zNb52oL2EGFR/zR4UnNVXco6Fx5A6Aedv1SrNuTJnJD wakJkTUtoBqvqb4zM6sjiHJrMGzFSpTtFUe2WkDynW+lDOxCdMNjfm7TOde9WpdMVwUZ 9+sCVDYaz7anSmttZsQrHKd74TxNO/6vObWNX9XPNujplQHIym1AxGV9lkwnvPM4hL7c F2CmYn8n71J7pz3t8tpegZpRiZuLMrpKX81pDNTm3ekj/f3JZaqHXTJEVXxufQTuoSGy 6jRCkaIPwcg6x3iYFiqpoy5WlsPPWmYf8AHFvI4ua0BNAX6MhoVKD0ACNY2EHEsjiwXb Mjcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888629; x=1699493429; 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=XeA0a/Gb8/dUQrnhDd66G5WVnhzf9jbEb4csjTyLblA=; b=aDd8lcHVQx4Tatqny0S+a6G6mBeNVs+CbVBTgD57nj12PYUfzw7IfxwFGb5waLvafT snceWPLE2I5Cqm7Oz8fqTDEyrWoQ+RzZaZfqa4I2TyCj9SB7Q+LSuqzCzwJtBaWEm7mM A1RmwQq74/twCzfBnwPydNV8Of7eIjC+HZTDN6ROg9tK+O58vSzBJSdwIrINxs2hUIp4 IuXv1SVwYdlL1TM3TvGgcAUq/ptN8RiTzSgjY6f2vBFxMepftiUQfZ+SgzE3lPXLPLk+ Xt3J4oxtKy4PkLMNLJAViTQVsi3cD8PCcKZ5pE/fpN5V/KCTxY7RarZlO61C4eq1Ko8/ VmuA== X-Gm-Message-State: AOJu0Yy19D4+1K6E3yKvKSeFBrgL2ZRNsOCWbDR8EzeBaUDJeRHBG7TR UKr+HmUwN4ndYCx97xzHSXIXLYH0lHMRc5m14hc= X-Received: by 2002:a05:6808:1304:b0:3ae:614:a782 with SMTP id y4-20020a056808130400b003ae0614a782mr18620419oiv.38.1698888629542; Wed, 01 Nov 2023 18:30:29 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 14/88] target/hppa: Truncate rotate count in trans_shrpw_sar Date: Wed, 1 Nov 2023 18:29:02 -0700 Message-Id: <20231102013016.369010-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::232; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x232.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, T_SCC_BODY_TEXT_LINE=-0.01 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 When forcing rotate by i32, the shift count must be as well. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 20e44ed528..d6ccce020a 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3105,8 +3105,11 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) tcg_gen_shr_reg(dest, dest, cpu_sar); } else if (a->r1 == a->r2) { TCGv_i32 t32 = tcg_temp_new_i32(); + TCGv_i32 s32 = tcg_temp_new_i32(); + tcg_gen_trunc_reg_i32(t32, load_gpr(ctx, a->r2)); - tcg_gen_rotr_i32(t32, t32, cpu_sar); + tcg_gen_trunc_reg_i32(s32, cpu_sar); + tcg_gen_rotr_i32(t32, t32, s32); tcg_gen_extu_i32_reg(dest, t32); } else { TCGv_i64 t = tcg_temp_new_i64(); From patchwork Thu Nov 2 01: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: 740349 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593818wrv; Wed, 1 Nov 2023 18:33:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENcuaQdjLT0r6f/XxNetYRbO/hfr0cxF5qt3Gcdady06o/1VwRYt9g4gYkAzPu6Gx+D7/c X-Received: by 2002:a05:620a:4621:b0:76f:f64:58b4 with SMTP id br33-20020a05620a462100b0076f0f6458b4mr18594079qkb.31.1698888786320; Wed, 01 Nov 2023 18:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888786; cv=none; d=google.com; s=arc-20160816; b=eDHwpCqmH1dK32ByuzmH1RA8uTdIYhCj1sJDLAO0VCTPnyQ863JgYT25pwJ/Drombv xElHu3K7teaJAE841IwGWN056GslGfWbWZPr6HV8tFRZYr5z/HloVVTuIvHrlqRhW8T+ Ptxc8yFLS8CUQmPnjXzSLNN6347xIRKIy6s55zgBvNtELwImCpKuxPA1dc8fxgJqcDcT 8cj2UoWyzQtW9XMI+etNmeGCNvDt6aOa/8IzNt5ixJi/5scNw83urtB6tsbb5QFbo6Jq ys2B0Hnql6wUaIXRZmKyW/r1PmuvCotmSRXdYXtWvSss5p7TMHAyp+UlH60ZxCS2HCRC RLmw== 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=TPY1sdpy0MpwadGHKWVBaHzMfJjgShg6fGAA7ikVCVc=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=X6Kz8vplx0fyiw1sUixEOYh7CMjFz5qTFxCzbV9maF8Lt/YOYSlDZGindpF4qZjVO2 5l0J9Kt3X4kRYlUCHgFSKBZVCYOMS1C2v2iCv0yYqHzsdWszUzMdFQe/Yy4FmmhAvkDF g1fVgSJpOEIq4181SolFiwaHbIHIZEh5CAO0Pe4r5kC9DZnE94OVIHk7BFoXdWNVn2p4 DUujnnu7XEyvMDFSbW3bw2zprUFS4Yp+B5JhNq+9kJtv9JxcnzGlnFPNkxrGmD6vUkUj gq4Cii/IeB3MRoiv28kK57ZevDYXQMFT0Ac62gGlqZZSFLxXA/ga/2Ulu29FzwnqsFuW XQOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wwQh41y3; 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 pw9-20020a05620a63c900b007757fdc191dsi3750620qkn.451.2023.11.01.18.33.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:33:06 -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=wwQh41y3; 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 1qyMXj-0005jE-F8; Wed, 01 Nov 2023 21:30:43 -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 1qyMXe-0005cD-GJ for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:38 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXZ-0001XL-FS for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:35 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b709048f32so492567b3a.0 for ; Wed, 01 Nov 2023 18:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888631; x=1699493431; 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=TPY1sdpy0MpwadGHKWVBaHzMfJjgShg6fGAA7ikVCVc=; b=wwQh41y3lx6oAxsdC3eDtRUNo84zAtFGLAlMTanSYJo+i4QmqxxmRofJZZq8tX/K3E hgBXYEadPkY0GIIYGoPsIGGICe6RMFRKsYI/wX6N6YB1GgX+VcG6Ojj8QFWtuDJ1x2Re 91Ifr/JuQ6B3O91wpNoHFMVlNk8cP6309tOkYqiXD5EI0R1EDkWxiXQtRYLCuvi5xT9G OeyFY8vPYrm8976sngYwPvSVrtVyGd1C4osoOz0GjCOZWM35565ZuDy0VXHdouBclpFz ghuEflbY9CPRjxrrmjW/HKAt+YKFu35VjETnYX5sphhQeCHPAHEq5uBEnJuJvrrU8YzH F1uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888631; x=1699493431; 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=TPY1sdpy0MpwadGHKWVBaHzMfJjgShg6fGAA7ikVCVc=; b=wBZGInXZ+VfZLP4vwK451qzFK5cDdmEvUHOny8g2EEb20bOQuFDia1yhdku+DIVo4Y uDEqUxpq4LZrA8EC4pXQS+OpGz1dAjq0Nt7WtvIaMuM0MEGlG5gMjWqvrKID4fJEKVX2 mk5jFFGPWmnQi4LMpNCAIzH0lln+kypPqCrJ1xgicJ99fu3NJp+OE4wvj2i3iJaQStwk ExyWzIuS8wtaYhgWpJA3wPVnxBKdj27PjUBTUSiTl/kF9hhtICq/sT63BpWt7QI1rVEy vo2NKljGY8QWhNwSHQERwSAxYzyymlZ4cOV0ruoh7ToYXj0/IXddfgSAcKnB3R9Ip9F+ z2CA== X-Gm-Message-State: AOJu0YzzDcwAuzkvP+WwdgUfcZvo/Ypi5v6U7DdyhB20RlhC9n1FXeQQ NQ8qk6wJWmj0G/iFnnq5Vnq/4vt8zTzWealYgS4= X-Received: by 2002:a05:6a00:3024:b0:6c2:cb9a:885e with SMTP id ay36-20020a056a00302400b006c2cb9a885emr5344157pfb.15.1698888630356; Wed, 01 Nov 2023 18:30:30 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 15/88] target/hppa: Fix trans_ds for hppa64 Date: Wed, 1 Nov 2023 18:29:03 -0700 Message-Id: <20231102013016.369010-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 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 This instruction always uses the input carry from bit 32, but produces all 16 output carry bits. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 48 +++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d6ccce020a..8ba95ae320 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -803,6 +803,12 @@ static bool cond_need_cb(int c) return c == 4 || c == 5; } +/* Need extensions from TCGv_i32 to TCGv_reg. */ +static bool cond_need_ext(DisasContext *ctx, bool d) +{ + return TARGET_REGISTER_BITS == 64 && !d; +} + /* * Compute conditional for arithmetic. See Page 5-3, Table 5-1, of * the Parisc 1.1 Architecture Reference Manual for details. @@ -1040,6 +1046,22 @@ static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, return cond; } +static TCGv_reg get_carry(DisasContext *ctx, bool d, + TCGv_reg cb, TCGv_reg cb_msb) +{ + if (cond_need_ext(ctx, d)) { + TCGv_reg t = tcg_temp_new(); + tcg_gen_extract_reg(t, cb, 32, 1); + return t; + } + return cb_msb; +} + +static TCGv_reg get_psw_carry(DisasContext *ctx, bool d) +{ + return get_carry(ctx, d, cpu_psw_cb, cpu_psw_cb_msb); +} + /* Compute signed overflow for addition. */ static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) @@ -2712,6 +2734,7 @@ static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf *a) static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) { TCGv_reg dest, add1, add2, addc, zero, in1, in2; + TCGv_reg cout; nullify_over(ctx); @@ -2726,18 +2749,20 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) /* Form R1 << 1 | PSW[CB]{8}. */ tcg_gen_add_reg(add1, in1, in1); - tcg_gen_add_reg(add1, add1, cpu_psw_cb_msb); + tcg_gen_add_reg(add1, add1, get_psw_carry(ctx, false)); - /* Add or subtract R2, depending on PSW[V]. Proper computation of - carry{8} requires that we subtract via + ~R2 + 1, as described in - the manual. By extracting and masking V, we can produce the - proper inputs to the addition without movcond. */ - tcg_gen_sari_reg(addc, cpu_psw_v, TARGET_REGISTER_BITS - 1); + /* + * Add or subtract R2, depending on PSW[V]. Proper computation of + * carry requires that we subtract via + ~R2 + 1, as described in + * the manual. By extracting and masking V, we can produce the + * proper inputs to the addition without movcond. + */ + tcg_gen_sextract_reg(addc, cpu_psw_v, 31, 1); tcg_gen_xor_reg(add2, in2, addc); tcg_gen_andi_reg(addc, addc, 1); - /* ??? This is only correct for 32-bit. */ - tcg_gen_add2_i32(dest, cpu_psw_cb_msb, add1, zero, add2, zero); - tcg_gen_add2_i32(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); + + tcg_gen_add2_reg(dest, cpu_psw_cb_msb, add1, zero, add2, zero); + tcg_gen_add2_reg(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); /* Write back the result register. */ save_gpr(ctx, a->t, dest); @@ -2747,7 +2772,8 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) tcg_gen_xor_reg(cpu_psw_cb, cpu_psw_cb, dest); /* Write back PSW[V] for the division step. */ - tcg_gen_neg_reg(cpu_psw_v, cpu_psw_cb_msb); + cout = get_psw_carry(ctx, false); + tcg_gen_neg_reg(cpu_psw_v, cout); tcg_gen_xor_reg(cpu_psw_v, cpu_psw_v, in2); /* Install the new nullification. */ @@ -2757,7 +2783,7 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) /* ??? The lshift is supposed to contribute to overflow. */ sv = do_add_sv(ctx, dest, add1, add2); } - ctx->null_cond = do_cond(a->cf, dest, cpu_psw_cb_msb, sv); + ctx->null_cond = do_cond(a->cf, dest, cout, sv); } return nullify_end(ctx); From patchwork Thu Nov 2 01:29:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740359 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594645wrv; Wed, 1 Nov 2023 18:35:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbRt7LBhFlBdLAu3jqlFefuYnqpl12wEng6cWvEGAO3eY5BZ7TpUN21eAzYCuL6Z+sl18D X-Received: by 2002:a0c:e2c5:0:b0:672:7fe3:7aae with SMTP id t5-20020a0ce2c5000000b006727fe37aaemr9862554qvl.56.1698888957891; Wed, 01 Nov 2023 18:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888957; cv=none; d=google.com; s=arc-20160816; b=MhNPywcv80X5ZAHTGGvUsCX9kw1DvDVWLgXluKG7KbN+ZkWvT/b3ttscJ+uCmq215h 3ThVjqpzhjpbA48pJCc01Ts7/XDCiQcAjU+fpLyaSo5MNUGRLaod/DTio+1UIoQjpJ27 FKHcic8gLOh7T40LkSRwzRnpZ9uVJhS9W6c0YxkYmmJV8Q4Wv9g++Aa0JtX6eQVp//LX /OKS6OhQiU7nLhEUW2AuacFEHZcDJf0XH+0Zv5gm8juc3WXkWwtVJMx5Bx/+ypy+aL9C MUAi2iSfIcPYy+Esgu117YPa1+HPGNB66TX458SBP7aW50GZjH8AMb3jwJIByFFeYvMO 7zJA== 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=xjMvFL2z2wpGvo2uheuj7+QVB72Kx7UDQCtbmE9m1I0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=r6ti9nVOobDeamFsYMulBpNHnovOXaJY+oVuyLn9A27iusiAcICDXGXVs34UBwyBgk KQ4+M2z8U9c0TrnK1NoYBlMThNHvJTICcvfDxeveIkgHTUzrfD+7tX4Dffx3Z9SkbDRg agbrAi2gXrsZF3oONr7CcgpfC9t/phVRTrm2m6Lw9FggBgZBOhip8VmYHjM38tXO9PlJ y/KjizzXSwMoGWDJQ1oG8IGecKUCK0OX0JUXm9imrpcNMl9eluC8P6dw/284xWKdKXMS VtPVt/sYsrxzOPkfK+vMTrjj4fQSO1DT7vBz3JINC4j5z6qld5sqbHAaeqlXIKQU9KfB Lyxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="XcJ6O+/4"; 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 v7-20020a0cf907000000b0066d6afd0beesi3597757qvn.45.2023.11.01.18.35.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:35:57 -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="XcJ6O+/4"; 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 1qyMYL-0005t5-EO; Wed, 01 Nov 2023 21:31:21 -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 1qyMXh-0005i9-IA for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:41 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXe-0001ZF-Kw for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:41 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-692c02adeefso466060b3a.3 for ; Wed, 01 Nov 2023 18:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888637; x=1699493437; 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=xjMvFL2z2wpGvo2uheuj7+QVB72Kx7UDQCtbmE9m1I0=; b=XcJ6O+/4CKBcEIm8XHkAJS86qRzJS6af1z+nwaFNB6+5wyZssVb49op/qUUyIYlerq uOHaUQIIf1N/TfuXrEqERV5dMOMr/cGeO1n5YvJKDSDeXImDB1ehuInyYKNMF6rCA/9M 55m2RcbrfQXH4+MmkEBWXO8gdoNxX7wrKm2G0CzkE1WpKcIR1XAQOQGeUhpvtCp7FF92 X68uACewmCEx0CbOwC5AO5/Gy6JiP9chb3ETxpOvY71Nm8eenzJVkJdbeZAQ92GgIx3u 5+O3AU/OdAQhu0Q4kgGdy+iOK3HweiDNd88+IN5xLtMnGvD0xekiMVwwjTCezxG2Gszt FdkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888637; x=1699493437; 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=xjMvFL2z2wpGvo2uheuj7+QVB72Kx7UDQCtbmE9m1I0=; b=K07cTQkeFjD/lMOcFs3lQC25stdDd/EdvXLWTW4mrk2uZkdU0MhyexMQrYOxwmJbEu 3rmL1h1eTzjgHj9iwxl7+hZCP6Ujy5Rt/8J8ukbccEeN5PXaV36w9k51d5uutSi1xZB9 u1jvoIILBFqmJw2dxgfRpRCNQzoYan0wVk0zw1aY59hyceQ1nNkD1vtYqNgggj+zQ05m JmE4SYQyxvimk2Khxjaoaiz2Uu63l6ANUIgt2JAKW+WW2oG7lUezLWVURaQk1AzJdmx3 fH45yAeKpBJa+cNbgO4H+YrIulF30JNYLKe4lG+JNecTXYDYXA2OY8yOLiSewOZMCyMv 71dg== X-Gm-Message-State: AOJu0YzuytMEnjoEVSZ6EzUzKwY2vbOiXenenJCaubjeuHBAxAM7XonL RlAfTOkrmE781em6aiBErqAtGb4fpjDy0cjPt1A= X-Received: by 2002:aa7:88cb:0:b0:6be:308:e61b with SMTP id k11-20020aa788cb000000b006be0308e61bmr18434471pff.10.1698888631060; Wed, 01 Nov 2023 18:30:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 16/88] target/hppa: Fix do_add, do_sub for hppa64 Date: Wed, 1 Nov 2023 18:29:04 -0700 Message-Id: <20231102013016.369010-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Select the proper carry bit for input to the arithmetic and for output for the condition. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 50 ++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 8ba95ae320..b0cd12a2d0 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1094,13 +1094,15 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg in2, unsigned shift, bool is_l, bool is_tsv, bool is_tc, bool is_c, unsigned cf) { - TCGv_reg dest, cb, cb_msb, sv, tmp; + TCGv_reg dest, cb, cb_msb, cb_cond, sv, tmp; unsigned c = cf >> 1; DisasCond cond; + bool d = false; dest = tcg_temp_new(); cb = NULL; cb_msb = NULL; + cb_cond = NULL; if (shift) { tmp = tcg_temp_new(); @@ -1111,19 +1113,22 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (!is_l || cond_need_cb(c)) { TCGv_reg zero = tcg_constant_reg(0); cb_msb = tcg_temp_new(); + cb = tcg_temp_new(); + tcg_gen_add2_reg(dest, cb_msb, in1, zero, in2, zero); if (is_c) { - tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cpu_psw_cb_msb, zero); + tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, + get_psw_carry(ctx, d), zero); } - if (!is_l) { - cb = tcg_temp_new(); - tcg_gen_xor_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_xor_reg(cb, in1, in2); + tcg_gen_xor_reg(cb, cb, dest); + if (cond_need_cb(c)) { + cb_cond = get_carry(ctx, d, cb, cb_msb); } } else { tcg_gen_add_reg(dest, in1, in2); if (is_c) { - tcg_gen_add_reg(dest, dest, cpu_psw_cb_msb); + tcg_gen_add_reg(dest, dest, get_psw_carry(ctx, d)); } } @@ -1138,7 +1143,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Emit any conditional trap before any writeback. */ - cond = do_cond(cf, dest, cb_msb, sv); + cond = do_cond(cf, dest, cb_cond, sv); if (is_tc) { tmp = tcg_temp_new(); tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); @@ -1192,6 +1197,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg dest, sv, cb, cb_msb, zero, tmp; unsigned c = cf >> 1; DisasCond cond; + bool d = false; dest = tcg_temp_new(); cb = tcg_temp_new(); @@ -1201,15 +1207,17 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (is_b) { /* DEST,C = IN1 + ~IN2 + C. */ tcg_gen_not_reg(cb, in2); - tcg_gen_add2_reg(dest, cb_msb, in1, zero, cpu_psw_cb_msb, zero); + tcg_gen_add2_reg(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cb, zero); tcg_gen_xor_reg(cb, cb, in1); tcg_gen_xor_reg(cb, cb, dest); } else { - /* DEST,C = IN1 + ~IN2 + 1. We can produce the same result in fewer - operations by seeding the high word with 1 and subtracting. */ - tcg_gen_movi_reg(cb_msb, 1); - tcg_gen_sub2_reg(dest, cb_msb, in1, cb_msb, in2, zero); + /* + * DEST,C = IN1 + ~IN2 + 1. We can produce the same result in fewer + * operations by seeding the high word with 1 and subtracting. + */ + TCGv_reg one = tcg_constant_reg(1); + tcg_gen_sub2_reg(dest, cb_msb, in1, one, in2, zero); tcg_gen_eqv_reg(cb, in1, in2); tcg_gen_xor_reg(cb, cb, dest); } @@ -1227,7 +1235,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (!is_b) { cond = do_sub_cond(cf, dest, in1, in2, sv); } else { - cond = do_cond(cf, dest, cb_msb, sv); + cond = do_cond(cf, dest, get_carry(ctx, d, cb, cb_msb), sv); } /* Emit any conditional trap before any writeback. */ @@ -3019,18 +3027,24 @@ static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, unsigned c, unsigned f, unsigned n, int disp) { - TCGv_reg dest, in2, sv, cb_msb; + TCGv_reg dest, in2, sv, cb_cond; DisasCond cond; + bool d = false; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); sv = NULL; - cb_msb = NULL; + cb_cond = NULL; if (cond_need_cb(c)) { - cb_msb = tcg_temp_new(); + TCGv_reg cb = tcg_temp_new(); + TCGv_reg cb_msb = tcg_temp_new(); + tcg_gen_movi_reg(cb_msb, 0); tcg_gen_add2_reg(dest, cb_msb, in1, cb_msb, in2, cb_msb); + tcg_gen_xor_reg(cb, in1, in2); + tcg_gen_xor_reg(cb, cb, dest); + cb_cond = get_carry(ctx, d, cb, cb_msb); } else { tcg_gen_add_reg(dest, in1, in2); } @@ -3038,7 +3052,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_add_sv(ctx, dest, in1, in2); } - cond = do_cond(c * 2 + f, dest, cb_msb, sv); + cond = do_cond(c * 2 + f, dest, cb_cond, sv); save_gpr(ctx, r, dest); return do_cbranch(ctx, disp, n, &cond); } From patchwork Thu Nov 2 01:29:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740371 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595089wrv; Wed, 1 Nov 2023 18:37:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWynsuIIQUBaROTqWLSjl1yxQtLoqONShxW5da4poQib9f/2NJlJuT9agaImPeHpEx8/7o X-Received: by 2002:a05:620a:4247:b0:76c:a952:c70f with SMTP id w7-20020a05620a424700b0076ca952c70fmr11307168qko.35.1698889065939; Wed, 01 Nov 2023 18:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889065; cv=none; d=google.com; s=arc-20160816; b=V8Vjf1wQ0G5MQjhYIGkCcdQR22iVrRxfP6z/uMF+vd+s/5rIk1bds7AxDYpwZbqa2a enS6mEbOp1oiWvF16GRVqiN5RR1g4WTG24U/Vvt7L7xWhWPsd8Sa2c4rlecT7yj8DJF1 7v3jA05c+4uDA+CSJjElTXAO8zZ0/McJQVF00w7JsmCpNiyl+/Or3L226b6but5/Tfa4 yVJ/JlXgv+mwhnq/Jiyba2hf4FCuI3+J9L6Y+dh9ZDchMbpAVaQjfcD+GSuO8ORoEync i5TieAhBR1Je05yExF91z3BSdZgW5N148gPmoMwplaZe8H/ExLe1ZRbI6tVKr+rC0wmD Q3vQ== 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=XBkHVGjqIu3LTEV2zzgvwaws1GKhji4cesKfRpz1I/k=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=QWnNUHhH1gp6a2m7IeVTj7rSE2m8R16DEsIWAKpf7cNKGshg9+nyJANMDSoDEtdrox g2DzhbHTI3J2sikxY5PJVqLI/AcrOfsJ3NtNYhREt9kXoCfzA6G9meWhSnxD6+eoZkmh KHKi2CVMRCxMwY04145Fz8VfbqQMRMxXg9LHGvHNEZdSeg4uE4+tweNfrsOjKGmzrSnH nT9PxMA0l1kiXy3/hvcEIM9TEwNaFskFz1L5N/+p3HZzlg/MVHJVQVKgap+BOhU4bFNa whEAb6dtGYVoT03jWJs2hKdqS3T96n1L+YD6Qb/S4l3/i1P9kdSPDDavLV3wcNSNwGRp FMow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ua+mQrmm; 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 bl15-20020a05620a1a8f00b0077a02a27b8fsi3735131qkb.354.2023.11.01.18.37.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37:45 -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=ua+mQrmm; 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 1qyMXi-0005iP-Gm; Wed, 01 Nov 2023 21:30: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 1qyMXh-0005hs-7r for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:41 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXe-0001ZC-6d for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:40 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso382112b3a.1 for ; Wed, 01 Nov 2023 18:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888636; x=1699493436; 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=XBkHVGjqIu3LTEV2zzgvwaws1GKhji4cesKfRpz1I/k=; b=ua+mQrmmJjck9B4ZG64z/Bxmt97A3n6uyO8u/0jvXU4sR1HNQ/UtWz9LC6ZYYcpaGE s7XM4F8EJ75dRB/ahrIEk93VOx7LJpv+D/3cVXgi59cH9p3Z/NJzc7TNPSvbT22zwKp4 tzS3ZIp0+GaiB4r3AfTV68fm82en0r61XZDxTRx7+jjmc838a4xu9zSI5/1UCEAYwtQ2 7DHma6C+3UmJKuHUvrjdFPKxueSOezO2IyLTBQ+nmjHgTyx1VBhEw+9nzknqaoD1cENv jkOjfcQmpbGcJmHyN4Ur+taP3aSSGMFJ5lUb8gojRXgxnqyEMgqYkALLknm7JJ/DHiei ++Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888636; x=1699493436; 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=XBkHVGjqIu3LTEV2zzgvwaws1GKhji4cesKfRpz1I/k=; b=u4Z2TOErNK469fu4ILyfuKC6hf5udkFu75rcNi5pQo2/VdO6baIuUlp1Nb+sKnPW9P yOY/CRrDcxYQabmE+7CrlzwazWrj/XyPIJh0JtTFiE+o//qhDUsDdzwcszoQ6Wj+mF6b nONiSMZuXbAYyRp5hNltbTkEzqOx//ZF77ZO8rcIwBzNV/gAW0BsWMsv7zub34t+OxzB uamiw7aOKzTknwGu2hJrRy/87JjFbcSmIKyUT+I96Ed86TvOpm5ZGjPqi4ZrrEr5Kt9W Au6MjwB9BGwqMyLRvogb/nV+Yd6sA9kq1FEAZ1kaUbsdqzpOb2z86ZyFS3tnqPbutt6N KBxg== X-Gm-Message-State: AOJu0YybLgNEjMi1tDexa/Fdre4mqnw3Y58vEZMUxeyXqH5VlMNn3jLz xsdH5i0XMHpjU6KBDB+5cGWZZlptU55j8HnyGcI= X-Received: by 2002:a05:6a00:1f13:b0:68a:48e7:9deb with SMTP id be19-20020a056a001f1300b0068a48e79debmr6582000pfb.2.1698888631779; Wed, 01 Nov 2023 18:30:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 17/88] target/hppa: Fix bb_sar for hppa64 Date: Wed, 1 Nov 2023 18:29:05 -0700 Message-Id: <20231102013016.369010-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/translate.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index b0cd12a2d0..ffa367b91f 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3073,14 +3073,21 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) { TCGv_reg tmp, tcg_r; DisasCond cond; + bool d = false; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + if (cond_need_ext(ctx, d)) { + /* Force shift into [32,63] */ + tcg_gen_ori_reg(tmp, cpu_sar, 32); + tcg_gen_shl_reg(tmp, tcg_r, tmp); + } else { + tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + } - cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); + cond = cond_make_0_tmp(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3088,12 +3095,15 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) { TCGv_reg tmp, tcg_r; DisasCond cond; + bool d = false; + int p; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - tcg_gen_shli_reg(tmp, tcg_r, a->p); + p = a->p | (cond_need_ext(ctx, d) ? 32 : 0); + tcg_gen_shli_reg(tmp, tcg_r, p); cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond); From patchwork Thu Nov 2 01:29:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740357 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594575wrv; Wed, 1 Nov 2023 18:35:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGi1zNVfQdK2nkwU+efK+qMeSRZDsSYag+Z4eIU0egmxftWeFLlj9B8fyNyjdXlozSvQEUp X-Received: by 2002:a05:620a:1337:b0:777:fec:5741 with SMTP id p23-20020a05620a133700b007770fec5741mr16724625qkj.33.1698888944460; Wed, 01 Nov 2023 18:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888944; cv=none; d=google.com; s=arc-20160816; b=rdyHODiwX0uh3iguhR4V/4J3ER0T3T9GWcQIjWp4oCeds9tSjd/u0YddRGYdlGKHJz kKcJi5A2fJ5b7hp4OJAcDxAgLaxRfWH4wMIPSilcdzET/TxlKY43RfvGtW03jmpIpMQg P4oKv3tczwAFGUrHDVCrCRVb6/95Z7dP4tT+aN2ks0KKsyewMJCTrKV2Y9eth0NyTfr0 S7+uE8OKS3tlsSSLXQ5Sysvk3s/i5Uj078s3YNzkC4iqxYaEypHCBDpNwPYtR8Xo+UER JangER1qZtNZ1TNnIjMRIpR2j0xgU+yRnrvfREN082qdizqJNFLlBuMLkCioFsYOQw+k 8N8w== 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=bq1ZlMGsY4e8Iwr9tgGW/hU3fTtznVC7sHTWJluQEek=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=wbzBV8SZTqgjLZjyoO3vmqhUfYY8aaOuln8qn2xkENgfAXgnZxbMMXpYIDb+quh2Nl YgiMMWY8x1l0E0F13HMAboK3nReqDpp1nUvdZW83zbUn9EOTYkF/ONtCZ9s9pj1VH9x2 YVuQYmyXdb++bTxsds/Dq85McOoaIrco2LHTRZBh2SAdWRQJTj8q1MhnfbT09/F00Rrb i79Utu2bJ96OAwpGhz+Sg38LWVea8yn8W55HuU1cKlXsqnuwO4MYv8l8MJ/iFAh5fpSf nLj/tKBE1XZhaLxy9gx5SYbZCoKsWDPBMEtzwFVGZXq3tocCdBCVdROmVoaxuNtkf/uQ PYwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zRKNjGcl; 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 a18-20020a05620a103200b007758e5dba35si3436049qkk.484.2023.11.01.18.35.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:35:44 -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=zRKNjGcl; 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 1qyMXj-0005iw-8i; Wed, 01 Nov 2023 21:30:43 -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 1qyMXh-0005ho-83 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:41 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXe-0001YY-6O for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:40 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6c115026985so501050b3a.1 for ; Wed, 01 Nov 2023 18:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888634; x=1699493434; 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=bq1ZlMGsY4e8Iwr9tgGW/hU3fTtznVC7sHTWJluQEek=; b=zRKNjGclXuliehOyt41evrM3gOhaQF2dscDPsnU5kwgAL02xs6Gmyoafy/Xan4Qj5e 99Z7Yy+4vrvMzbgEcvb3BLaN2vT0eo06YF4rFZtqLE0UtwgdN74MnyujkyiHuqqAGXq+ eYDnvcPBtUta35nN5aQg4TTPd/OrStgRMojdjLl+ujVzIylj9XYnULqcPi8D7g8WXU4C BNBKMAzBIK42P4EXziWxK5uuHCO8tns++JSh+oQuXTetPsWg8GyE5gei85qwu4Gd45Af arb2BNUH+GcO8iUV+GMj+MhOIfoIi67az3OMW7dBqZbJYf5W+4X0onCmt8BBYX6T56U5 lX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888634; x=1699493434; 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=bq1ZlMGsY4e8Iwr9tgGW/hU3fTtznVC7sHTWJluQEek=; b=Himaaw2YDK4o/HPbwQrfBPoZTDjWG9NbBOURgwl4+DRbNDTceiRE/+MDeCDO6MY1fx C8so/q//hC/0Se5IZZDCvWiPlTV2KQJbye5isCeobcUjr/8JPV3EMdG8f0bfvZLQ/ckT 9H/hTDNZFv6pNC+4+fP+K7RX/aAOdxG0aGuUyk5gYRAkLkF2fvWDS32q6DdwPQ/GF+wr JOpHYQSyl0CBNIrwRlZy6nvTuvDMoNZiAxSIgIwvMWfLQCxZepYd96/psXKFqM2pe4v/ V0aePdknXxDFIfm5GZaE/TA02HHh0ErT1ZR7rV3WZCfDW7+3CRRavvEqIvipRGFifHiR lZiQ== X-Gm-Message-State: AOJu0YyDd2UtRNjVF2W5+JVaye1WKJAqLKWttNb5i7MXoUWOklqgRm+9 LpRUQVymLjnj4jRznu8mERbPaLI8R3ScGwnMh6I= X-Received: by 2002:a05:6a20:8428:b0:181:16dc:d1ae with SMTP id c40-20020a056a20842800b0018116dcd1aemr7665852pzd.48.1698888632558; Wed, 01 Nov 2023 18:30:32 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 18/88] target/hppa: Fix extrw and depw with sar for hppa64 Date: Wed, 1 Nov 2023 18:29:06 -0700 Message-Id: <20231102013016.369010-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 These are 32-bit operations regardless of processor. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ffa367b91f..ed88f724ce 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3230,7 +3230,9 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) tmp = tcg_temp_new(); /* Recall that SAR is using big-endian bit numbering. */ - tcg_gen_xori_reg(tmp, cpu_sar, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, cpu_sar, 31); + tcg_gen_xori_reg(tmp, tmp, 31); + if (a->se) { tcg_gen_sar_reg(dest, src, tmp); tcg_gen_sextract_reg(dest, dest, 0, len); @@ -3355,7 +3357,8 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, tmp = tcg_temp_new(); /* Convert big-endian bit numbering in SAR to left-shift. */ - tcg_gen_xori_reg(shift, cpu_sar, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(shift, cpu_sar, 31); + tcg_gen_xori_reg(shift, shift, 31); mask = tcg_temp_new(); tcg_gen_movi_reg(mask, msb + (msb - 1)); From patchwork Thu Nov 2 01:29:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740345 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593697wrv; Wed, 1 Nov 2023 18:32:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpI6fVMvmiWgILGjl2jo7iIVSIQqEPKAVpcKEvXUhceXc9ArGAFYuaifZq8VWQWWSzIXOn X-Received: by 2002:a05:620a:4b4c:b0:76e:e352:667a with SMTP id su12-20020a05620a4b4c00b0076ee352667amr15882931qkn.35.1698888760218; Wed, 01 Nov 2023 18:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888760; cv=none; d=google.com; s=arc-20160816; b=xrU0AwWerfzVIAZcYWLhmJWXNAIRdl/w0i40ESjReGR/aMLcf7Ms38wIgW5E4gDRO2 VhdGWszyYim6MePVIEe0kM7GCss2CkmgZbLn/0A0pkU6T1ZwXAOkrah5YoTjN91Frj2a QDPJfBAG+PcZbamxNtDHOrSRyDhQ9cRJ0R79GC8LzA3SHZhQ6ZKBYb4vMcq3YF3OOSgu LZg6IpOs/ACsFqsr1qQFn3CHFHdfMypcXAb+TAz4Jo8PnQBVC1dexo4xvOalmlh2rpKw MlMgPM9N2pdIk6h407kcbHG49Blexp0TWm7N3Pz9R9yuQBdERXZ1S7URDDQHXpRjguu1 xhvg== 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=U8V0B4qGaX44SCne6/GgXw2vrmkaH/ySdpZ5z2aNKfw=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=xlbUSqhmkR0KczlzPOz3eWI/VvtrFIdWQzbVl1ugdsLcN8kOX0cxor8vEvg/bUfgPK ginGEeq2LYy19Vax+kIeEEhT7vD052OFrYfqADPhTge2Xo6MH/8Ooy+Ain1kaPbVnqB4 t/Zk3b+YZWdjyo0QKLFNGwneyMJYA3AB51CNPgZOU9Wifwpeft1vfV86+j1nGBTm5a+T /RoHR9bKbc4TGKMJyvivx+1xRLTFDLISTk2KHlJZx+gzIXj2MOWl3IwyOdg8t5wJWDir WIRTBshaPH7X+5P3NZvWSxJMhNzUDayagr2vcEBQlpuRsHP+DoV/ANZVIN/lYWvZA587 dxlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=skqsTeK+; 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 pb27-20020a05620a839b00b0076da127884csi3838291qkn.223.2023.11.01.18.32.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:40 -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=skqsTeK+; 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 1qyMYK-0005qK-6O; Wed, 01 Nov 2023 21:31:20 -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 1qyMXf-0005f3-Tr for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:40 -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 1qyMXc-0001YE-1T for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:39 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b2df2fb611so299494b6e.0 for ; Wed, 01 Nov 2023 18:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888633; x=1699493433; 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=U8V0B4qGaX44SCne6/GgXw2vrmkaH/ySdpZ5z2aNKfw=; b=skqsTeK+mlne45DhxWQv1A18XpO25pScBJnTh9sD54UZTnX1gLeba1VQZDdcstaYtF NNQayOvtCxgpWiGX7S8FxxPvspRCo3G0ulIjQt550gLXYtMMuBoj1lquS+uUHDTtsBfs Jeb/YHYaxIcw4fdooQLB4sAq6/goc3NKN8n6caJe8wxWoNNNE94LWE7iPwH3MzDKrMiH qrmbCRaOD3W+MrE972ccsWJJ7//NCBN9nT/wW/z8weKkqN+mmqQKpRcvSf5FlnoYJPlg w+vf0Tb3aX/lGZrzBvTHlzY4qs2YZb57lBMikaLcFTkdE8OAJetELSlc/GzOhEgvd6+o e4QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888633; x=1699493433; 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=U8V0B4qGaX44SCne6/GgXw2vrmkaH/ySdpZ5z2aNKfw=; b=k9b4vEz/TY1g65BqabvxeL4xESrJsdqVu2jYS8f7Le/3lzwr9qjHKfSeyaG0EHGM1T QPE8PjzcX+67+2Q5x683E8So64EH/XnLgVk7OcQeXqxZIEI1fkdT2UXwlYb4Z3rd4Wt/ vW06MHcNU0pHpyBeyAZ2Lv9hheSCkFRgPEQOATtgcUC4RbwonzSgDRPglr9pPWLFmPis cPI1gZo07r8/4OBtRjvXkipuGpXgR+TdgJ/NEU7ZmjKmbv+N4MXIMN+6/MXHmLHxWDMk uM5pcH/4Z+xgPtcMIX3vE8f4sKjXxi4GdYy8esRnCrSjhpQUe8MMci3hxzQdmMy07kp3 4KJA== X-Gm-Message-State: AOJu0Yxuhkq/MHxtGmxdqDK26TRXC03YyG8eYxn3l24A6IvmZ0+BiioV 0fl7WKuWjLTCoryU1UfVnCdNp72xwGabN8yK2M4= X-Received: by 2002:aca:d16:0:b0:3a6:fbe3:45cf with SMTP id 22-20020aca0d16000000b003a6fbe345cfmr19045412oin.35.1698888633444; Wed, 01 Nov 2023 18:30:33 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 19/88] target/hppa: Introduce TYPE_HPPA64_CPU Date: Wed, 1 Nov 2023 18:29:07 -0700 Message-Id: <20231102013016.369010-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Prepare for the qemu binary supporting both pa10 and pa20 at the same time. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/cpu-qom.h | 1 + target/hppa/cpu.h | 5 +++++ target/hppa/cpu.c | 33 ++++++++++++++++++--------------- target/hppa/translate.c | 2 ++ 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index b96e0318c7..4a85ebf5e0 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -24,6 +24,7 @@ #include "qom/object.h" #define TYPE_HPPA_CPU "hppa-cpu" +#define TYPE_HPPA64_CPU "hppa64-cpu" OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 08de894393..0ac307e0e9 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -272,6 +272,11 @@ struct ArchCPU { #include "exec/cpu-all.h" +static inline bool hppa_is_pa20(CPUHPPAState *env) +{ + return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) != NULL; +} + static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch) { #ifdef CONFIG_USER_ONLY diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 5e1240c631..07fae42bb8 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -209,20 +209,23 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops = &hppa_tcg_ops; } -static const TypeInfo hppa_cpu_type_info = { - .name = TYPE_HPPA_CPU, - .parent = TYPE_CPU, - .instance_size = sizeof(HPPACPU), - .instance_align = __alignof(HPPACPU), - .instance_init = hppa_cpu_initfn, - .abstract = false, - .class_size = sizeof(HPPACPUClass), - .class_init = hppa_cpu_class_init, +static const TypeInfo hppa_cpu_type_infos[] = { + { + .name = TYPE_HPPA_CPU, + .parent = TYPE_CPU, + .instance_size = sizeof(HPPACPU), + .instance_align = __alignof(HPPACPU), + .instance_init = hppa_cpu_initfn, + .abstract = false, + .class_size = sizeof(HPPACPUClass), + .class_init = hppa_cpu_class_init, + }, +#ifdef TARGET_HPPA64 + { + .name = TYPE_HPPA64_CPU, + .parent = TYPE_HPPA_CPU, + }, +#endif }; -static void hppa_cpu_register_types(void) -{ - type_register_static(&hppa_cpu_type_info); -} - -type_init(hppa_cpu_register_types) +DEFINE_TYPES(hppa_cpu_type_infos) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ed88f724ce..44c9911720 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -262,6 +262,7 @@ typedef struct DisasContext { int mmu_idx; int privilege; bool psw_n_nonzero; + bool is_pa20; #ifdef CONFIG_USER_ONLY MemOp unalign; @@ -4091,6 +4092,7 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->cs = cs; ctx->tb_flags = ctx->base.tb->flags; + ctx->is_pa20 = hppa_is_pa20(cpu_env(cs)); #ifdef CONFIG_USER_ONLY ctx->privilege = MMU_IDX_TO_PRIV(MMU_USER_IDX); From patchwork Thu Nov 2 01:29:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740355 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594377wrv; Wed, 1 Nov 2023 18:35:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHqXTWwbz/y86A03y2zdk/iHz0qnANT0Nz5Uxf8jK61ZBZzpV5G85XdAj3geia+q3u2l1x X-Received: by 2002:a05:6122:739:b0:4ab:cf7b:5b31 with SMTP id 57-20020a056122073900b004abcf7b5b31mr1033640vki.6.1698888909023; Wed, 01 Nov 2023 18:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888909; cv=none; d=google.com; s=arc-20160816; b=uIFu8rlxhfVzRKzOgdg0RxmTe5vksc+s74YS/3UqEDuMKUo9H75XBksi7eO9Vfmd7v 5mHWCGKAeQyewfMrcISoZ+nm9QIQk56fIiQ9a5u2sZTyTKB+qv7Kk4t4R7qX8cQ5a3sg 59cj0BQkFumCi1XXNxhfVA2CHr2OGJDVuASuui6PMRm9aMdUrLHU+uutURXH4+AwrcAU 9/GCkkPFo1joS99XjG+iYmdhBYnanWcI/z1i8oAzgpvtljkFOBbk4M1T0qegzT6PaYO0 kW3UJ//o0CiQlVGtmnCczAGfgT62Prr9YqBtrUXX1BsACvbVRu7fIryznVpSF8VzIjkH NHLA== 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=sXBKF6uHHMihJPl4uhe8/3+lsxd/tpaCJO/Jxdl9png=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=SFs0GYLzEv5txz4b4D8/3mT5QwpJ7JhuVlv2f14rRICm9dmzMPadoE01ACuTKkBTKW pRbOh1ebxYApZl0+6y/rxccHOiRFqM5b/99BmNi+xWvQSiY17Z9XbB+ZZuxQjmXHtpao ge49zYSPh8OUo1WiwWKF3isaXgbnXi56O9xs1KH79loDdkynI+oKA++ySKKV0CRMw/Ms VAKIhTSMfdwHjT9G5PWQKO4Sz35ZP179oHrRXAvkU9h0SEZCJr0/vcKo9afQVddOHqtT oZOANVhnayRDlpzAvvnq6Xx0LTtwwqSdhEZ4wqyjGt78+SD7NQ/aPNkZYzDT6QBVCX2j ovOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sd+ipVax; 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 w20-20020a0562140b3400b0066d17fa0648si3602800qvj.198.2023.11.01.18.35.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:35:08 -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=Sd+ipVax; 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 1qyMYK-0005qI-0S; Wed, 01 Nov 2023 21:31:20 -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 1qyMXj-0005jC-Bg for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:43 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXh-0001aW-Bn for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:43 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5ac865d1358so316495a12.3 for ; Wed, 01 Nov 2023 18:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888640; x=1699493440; 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=sXBKF6uHHMihJPl4uhe8/3+lsxd/tpaCJO/Jxdl9png=; b=Sd+ipVaxB94r3gN0IVYaavF3XBkPgBcnrHfhzHbHePKqz/QDHEeNmsP/Gxl41uFG/p x3JyO1VVW+TRYWks0zWEBRxalGRdGsPwNIzhtPmC+m5EGXc57bkJLGxzpcTXhav++A8r /CsyClZ2xIlf7NrY4vcDq4m+nlqLecVW9/ZrM00gLW5iHnrvKVVQ8WZVQdMxN/iyOEHp SdsM4CAVRXMNGnWwsSMkn2R1ta67LmZgccTYxsPOrSLH5pTSj0qXXUAUafzl0I3YCVaq RaOe9s/VtMRw3/SKdZRSTBgMRyAET7EwpPitoxAQTMcAiMvHKmzrcdqcOvyDWGf1TOE+ 6b5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888640; x=1699493440; 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=sXBKF6uHHMihJPl4uhe8/3+lsxd/tpaCJO/Jxdl9png=; b=mmoPyBE0nGBnHR0KBYvKI6L410cg2oiunAQivMAOAIkvhk73rU7N6+8wPHeoGY7/nr Z9cMmTyQ4GiLuhS3vone438Wim18e6BBu65OXlGH73+Z8D2iJjAndlu+qk33HoqH1YXN ENShV5HBwuPLiyXmIAMGSy7l5NQmWYJyAoI5fWOX3CwKgLPAHSyRMsGF6AE4arKytGiX qQTzHlucyuH/4ugiPmhwejzsoEH8Ey7h5L+POO6CPB6/45eG3t5htlhRgI+l4QztR9Xg QNhwpS76UM9zt4F/Pc0lYrDWrR+ko3TgTevgQ8522d4W+QcB7wcdGL0mwCyorYe9+xzM 3xsA== X-Gm-Message-State: AOJu0YyodrVCW5kWmReRVXc0n/twzPHBoidFRWIacs/7cSl3K3KJVvt+ 203XfYch2QoUkJalSyzsvnUzeSu7CSNWRkQ+i04= X-Received: by 2002:a05:6a21:328c:b0:159:b4ba:a5bf with SMTP id yt12-20020a056a21328c00b00159b4baa5bfmr17848675pzb.13.1698888634246; Wed, 01 Nov 2023 18:30:34 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 20/88] target/hppa: Make HPPA_BTLB_ENTRIES variable Date: Wed, 1 Nov 2023 18:29:08 -0700 Message-Id: <20231102013016.369010-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Depend on hppa_is_pa20. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 19 +++++++++++-------- hw/hppa/machine.c | 9 +++------ target/hppa/machine.c | 3 ++- target/hppa/mem_helper.c | 40 ++++++++++++++++++++++------------------ 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 0ac307e0e9..48ddcffb8a 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -227,15 +227,13 @@ typedef struct CPUArchState { target_ureg cr_back[2]; /* back of cr17/cr18 */ target_ureg shadow[7]; /* shadow registers */ - /* ??? The number of entries isn't specified by the architecture. */ -#ifdef TARGET_HPPA64 -#define HPPA_BTLB_FIXED 0 /* BTLBs are not supported in 64-bit machines */ -#else -#define HPPA_BTLB_FIXED 16 -#endif -#define HPPA_BTLB_VARIABLE 0 + /* + * ??? The number of entries isn't specified by the architecture. + * BTLBs are not supported in 64-bit machines. + */ +#define PA10_BTLB_FIXED 16 +#define PA10_BTLB_VARIABLE 0 #define HPPA_TLB_ENTRIES 256 -#define HPPA_BTLB_ENTRIES (HPPA_BTLB_FIXED + HPPA_BTLB_VARIABLE) /* Index for round-robin tlb eviction. */ uint32_t tlb_last; @@ -277,6 +275,11 @@ static inline bool hppa_is_pa20(CPUHPPAState *env) return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) != NULL; } +static inline int HPPA_BTLB_ENTRIES(CPUHPPAState *env) +{ + return hppa_is_pa20(env) ? 0 : PA10_BTLB_FIXED + PA10_BTLB_VARIABLE; +} + static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch) { #ifdef CONFIG_USER_ONLY diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 67d4d1b5e0..85682e6bab 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -185,6 +185,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) uint64_t val; const char qemu_version[] = QEMU_VERSION; MachineClass *mc = MACHINE_GET_CLASS(ms); + int btlb_entries = HPPA_BTLB_ENTRIES(&cpu[0]->env); int len; fw_cfg = fw_cfg_init_mem(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4); @@ -196,11 +197,11 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version", g_memdup(&val, sizeof(val)), sizeof(val)); - val = cpu_to_le64(HPPA_TLB_ENTRIES - HPPA_BTLB_ENTRIES); + val = cpu_to_le64(HPPA_TLB_ENTRIES - btlb_entries); fw_cfg_add_file(fw_cfg, "/etc/cpu/tlb_entries", g_memdup(&val, sizeof(val)), sizeof(val)); - val = cpu_to_le64(HPPA_BTLB_ENTRIES); + val = cpu_to_le64(btlb_entries); fw_cfg_add_file(fw_cfg, "/etc/cpu/btlb_entries", g_memdup(&val, sizeof(val)), sizeof(val)); @@ -608,10 +609,6 @@ static void hppa_machine_reset(MachineState *ms, ShutdownCause reason) cs->exception_index = -1; cs->halted = 0; - - /* clear any existing TLB and BTLB entries */ - memset(cpu[i]->env.tlb, 0, sizeof(cpu[i]->env.tlb)); - cpu[i]->env.tlb_last = HPPA_BTLB_ENTRIES; } /* already initialized by machine_hppa_init()? */ diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 61ae942ff1..473305ffea 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -139,6 +139,7 @@ static int tlb_pre_load(void *opaque) static int tlb_post_load(void *opaque, int version_id) { CPUHPPAState *env = opaque; + uint32_t btlb_entries = HPPA_BTLB_ENTRIES(env); HPPATLBEntry **unused = &env->tlb_unused; HPPATLBEntry *partial = NULL; @@ -152,7 +153,7 @@ static int tlb_post_load(void *opaque, int version_id) if (e->entry_valid) { interval_tree_insert(&e->itree, &env->tlb_root); - } else if (i < HPPA_BTLB_ENTRIES) { + } else if (i < btlb_entries) { /* btlb not in unused list */ } else if (partial == NULL && e->itree.start < e->itree.last) { partial = e; diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index b1773ece61..327fb20c17 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -57,7 +57,7 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPATLBEntry *ent, HPPA_MMU_FLUSH_MASK, TARGET_LONG_BITS); /* Never clear BTLBs, unless forced to do so. */ - is_btlb = ent < &env->tlb[HPPA_BTLB_ENTRIES]; + is_btlb = ent < &env->tlb[HPPA_BTLB_ENTRIES(env)]; if (is_btlb && !force_flush_btlb) { return; } @@ -93,10 +93,11 @@ static HPPATLBEntry *hppa_alloc_tlb_ent(CPUHPPAState *env) HPPATLBEntry *ent = env->tlb_unused; if (ent == NULL) { + uint32_t btlb_entries = HPPA_BTLB_ENTRIES(env); uint32_t i = env->tlb_last; - if (i < HPPA_BTLB_ENTRIES || i >= ARRAY_SIZE(env->tlb)) { - i = HPPA_BTLB_ENTRIES; + if (i < btlb_entries || i >= ARRAY_SIZE(env->tlb)) { + i = btlb_entries; } env->tlb_last = i + 1; @@ -385,23 +386,24 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) void hppa_ptlbe(CPUHPPAState *env) { + uint32_t btlb_entries = HPPA_BTLB_ENTRIES(env); uint32_t i; /* Zap the (non-btlb) tlb entries themselves. */ - memset(&env->tlb[HPPA_BTLB_ENTRIES], 0, - sizeof(env->tlb) - HPPA_BTLB_ENTRIES * sizeof(env->tlb[0])); - env->tlb_last = HPPA_BTLB_ENTRIES; + memset(&env->tlb[btlb_entries], 0, + sizeof(env->tlb) - btlb_entries * sizeof(env->tlb[0])); + env->tlb_last = btlb_entries; env->tlb_partial = NULL; /* Put them all onto the unused list. */ - env->tlb_unused = &env->tlb[HPPA_BTLB_ENTRIES]; - for (i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb) - 1; ++i) { + env->tlb_unused = &env->tlb[btlb_entries]; + for (i = btlb_entries; i < ARRAY_SIZE(env->tlb) - 1; ++i) { env->tlb[i].unused_next = &env->tlb[i + 1]; } /* Re-initialize the interval tree with only the btlb entries. */ memset(&env->tlb_root, 0, sizeof(env->tlb_root)); - for (i = 0; i < HPPA_BTLB_ENTRIES; ++i) { + for (i = 0; i < btlb_entries; ++i) { if (env->tlb[i].entry_valid) { interval_tree_insert(&env->tlb[i].itree, &env->tlb_root); } @@ -473,12 +475,14 @@ void HELPER(diag_btlb)(CPUHPPAState *env) HPPATLBEntry *btlb; uint64_t virt_page; uint32_t *vaddr; + uint32_t btlb_entries = HPPA_BTLB_ENTRIES(env); -#ifdef TARGET_HPPA64 /* BTLBs are not supported on 64-bit CPUs */ - env->gr[28] = -1; /* nonexistent procedure */ - return; -#endif + if (btlb_entries == 0) { + env->gr[28] = -1; /* nonexistent procedure */ + return; + } + env->gr[28] = 0; /* PDC_OK */ switch (env->gr[25]) { @@ -492,8 +496,8 @@ void HELPER(diag_btlb)(CPUHPPAState *env) } else { vaddr[0] = cpu_to_be32(1); vaddr[1] = cpu_to_be32(16 * 1024); - vaddr[2] = cpu_to_be32(HPPA_BTLB_FIXED); - vaddr[3] = cpu_to_be32(HPPA_BTLB_VARIABLE); + vaddr[2] = cpu_to_be32(PA10_BTLB_FIXED); + vaddr[3] = cpu_to_be32(PA10_BTLB_VARIABLE); } break; case 1: @@ -510,7 +514,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) (long long) virt_page << TARGET_PAGE_BITS, (long long) (virt_page + len) << TARGET_PAGE_BITS, (long long) virt_page, phys_page, len, slot); - if (slot < HPPA_BTLB_ENTRIES) { + if (slot < btlb_entries) { btlb = &env->tlb[slot]; /* Force flush of possibly existing BTLB entry. */ @@ -532,7 +536,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) slot = env->gr[22]; qemu_log_mask(CPU_LOG_MMU, "PDC_BLOCK_TLB: PDC_BTLB_PURGE slot %d\n", slot); - if (slot < HPPA_BTLB_ENTRIES) { + if (slot < btlb_entries) { btlb = &env->tlb[slot]; hppa_flush_tlb_ent(env, btlb, true); } else { @@ -542,7 +546,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) case 3: /* Purge all BTLB entries */ qemu_log_mask(CPU_LOG_MMU, "PDC_BLOCK_TLB: PDC_BTLB_PURGE_ALL\n"); - for (slot = 0; slot < HPPA_BTLB_ENTRIES; slot++) { + for (slot = 0; slot < btlb_entries; slot++) { btlb = &env->tlb[slot]; hppa_flush_tlb_ent(env, btlb, true); } From patchwork Thu Nov 2 01:29:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740348 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593778wrv; Wed, 1 Nov 2023 18:32:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFl9YSM7XwD/YfZiZfTSwxv65moDOIxkGBDFDrVU4/WUaareHjoFPTEqUTHgiTBKM76aCVT X-Received: by 2002:ae9:e10b:0:b0:778:910f:3401 with SMTP id g11-20020ae9e10b000000b00778910f3401mr15680890qkm.78.1698888776588; Wed, 01 Nov 2023 18:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888776; cv=none; d=google.com; s=arc-20160816; b=r2dWcWrLk5HEvv2ihUf0/CNtGSpcz3hAfk1gYpDh+AYQ8VX6j+Jd8QSqbXZZnsXjt9 At9I5ZxhA+zi2lBKfS6nuXYqyCqR8SbBp7rWJyKrBd7FWfeoo/2Um1oklEBuWcveO2TE +jyfog+xdTPqlR6Lw52enU4C5HFsJGYw2+XqLtr6NLgQ9O5qMlYEHJv4FarAwBU1C4uI OW2ghuSGDMUnK6bbTz/6t+vYq2zkioz1uirrygErU6AqUIJtC755P36hdZCwBExmddSq envDLNikDde3q1ceHJ3K7YoA5JmsM4c9nIWSYtk68OS1OM72iBbuuGgFqgNbAQb8EstU 9juw== 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=kCzE9vIK3Nn7Qq8eXaj04fpM94BoNvhV6PxkUb5Tir4=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=zgFHKlSyvyPax06nxZUv58Sh/0dqosgcCvAnguikOpIDkTSpiNc+uPVXWP3Y9G7t+2 0qVJJ2DT34MY4X5sM7pp3Q9bt5nVnkLiRXk3sWYC9sZ5pdqe0I2FFonFeIiNyFn/a0i4 6ClRVAaR/+Ztfg5fDlcAQpETNGWgWBr42mhycndi9K8ekQiBRj0ulwCCLIHlaY3mRMwJ ILbJC4VrDUdTiwTd5fMXfw9ICSstyd9SBkwDT8SfYLFEvZou3Muz2nQOYp+0km70eFcm O20cm7SP9RXwJZW7aiNKPv2GOQfoROZitdUvUFL/Qmoo6qKMDrZdXXwQqIR/JmimuWUA 9epw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p75C7dVN; 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 b2-20020a05620a04e200b007758ed711d1si3519712qkh.55.2023.11.01.18.32.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:56 -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=p75C7dVN; 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 1qyMYJ-0005q3-IU; Wed, 01 Nov 2023 21:31:19 -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 1qyMXl-0005kX-2m for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:45 -0400 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXe-0001Yp-6r for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:44 -0400 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-d9a398f411fso398504276.3 for ; Wed, 01 Nov 2023 18:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888635; x=1699493435; 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=kCzE9vIK3Nn7Qq8eXaj04fpM94BoNvhV6PxkUb5Tir4=; b=p75C7dVNmLwWrgC8uSEzYc5VXZKrvjZWZxSlzBaw7mTb8Xc5wNYJguBlKK+fyIaKgw BeuOfzi0Db+SBrgXsl2jX/HzLF4Oa6jI9vn2PNjR89jHM6Uglz+XuxzCiRI5P3yL5kji UQRCObYAeGMZGZfdsD9SX4sb6TZBoszrcTmF6B/wdzJpPM8tc1PKUoSoMoupcyjEE/jd E3lNHyQP+HMLN7KGcUxDjMws93BFr6NiSkKL8xaN/RhQHYrMK5oTcGV2PCWA2m+zGa3r xd5Cq+2cI2WmECSaI6gZWCzCX0nH55G32ni3cwoHE7mC3zWhAWScD+nD/jR6tiwMXg7g xGGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888635; x=1699493435; 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=kCzE9vIK3Nn7Qq8eXaj04fpM94BoNvhV6PxkUb5Tir4=; b=cZW1Sy+YCAPYShTy6zaPtpBst3O6R/hevwBOivtLDhEaUq3riXjiKvZfXWWBFoblrv IYtvDn2kRZ522pcQzP2wa6kzqbt0jeE7qFjEhgDF9cAo1xzDILKzau+J1Zsefadd7g5m e0Rw1sSrQWD4uJm13h1ZYTGhwIMKZmXnK85eGBIsjW/oKDWIy1P9DvRAb6pAQlX145/i ejPLgPAoKj3wf6e+drHCl1FHTbFeTfd5D8jQ8MXd39jqmHrirPHnW2ZMys6rYWS9oKJc ZRGanDfpShwOs1JGOo1oq1Xk81PPy9MXjqmUIF9hTy2EshLPeZfsf1K+IvwDfSnLgtX8 OIlQ== X-Gm-Message-State: AOJu0Yx2HsbvDI78VA8Fts4u6fAZbUnjbEIPB6LtYBaZXTB0nQX/M17U MqjAZ9aeTEj+gDCHzV6Ab0+9UDUd/zP27I66QIk= X-Received: by 2002:a25:d113:0:b0:da0:3938:7ac6 with SMTP id i19-20020a25d113000000b00da039387ac6mr14799693ybg.15.1698888634975; Wed, 01 Nov 2023 18:30:34 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 21/88] target/hppa: Implement cpu_list Date: Wed, 1 Nov 2023 18:29:09 -0700 Message-Id: <20231102013016.369010-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::b2a; envelope-from=richard.henderson@linaro.org; helo=mail-yb1-xb2a.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/cpu.h | 5 +++++ target/hppa/cpu.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 48ddcffb8a..301c82114a 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -396,4 +396,9 @@ int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr); #endif G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t ra); +#define CPU_RESOLVING_TYPE TYPE_HPPA_CPU + +#define cpu_list hppa_cpu_list +void hppa_cpu_list(void); + #endif /* HPPA_CPU_H */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 07fae42bb8..27c74f0d27 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -161,6 +161,30 @@ static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) return object_class_by_name(TYPE_HPPA_CPU); } +static void hppa_cpu_list_entry(gpointer data, gpointer user_data) +{ + ObjectClass *oc = data; + CPUClass *cc = CPU_CLASS(oc); + const char *tname = object_class_get_name(oc); + g_autofree char *name = g_strndup(tname, strchr(tname, '-') - tname); + + if (cc->deprecation_note) { + qemu_printf(" %s (deprecated)\n", name); + } else { + qemu_printf(" %s\n", name); + } +} + +void hppa_cpu_list(void) +{ + GSList *list; + + list = object_class_get_list_sorted(TYPE_HPPA_CPU, false); + qemu_printf("Available CPUs:\n"); + g_slist_foreach(list, hppa_cpu_list_entry, NULL); + g_slist_free(list); +} + #ifndef CONFIG_USER_ONLY #include "hw/core/sysemu-cpu-ops.h" From patchwork Thu Nov 2 01:29:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740347 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593772wrv; Wed, 1 Nov 2023 18:32:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvBy3tqgtDemvrQOFEEnG9noHSDsFBjZhUW2lzv7QxRyJ2l3H+6Sjh1VqOzqCHPQ4GNzDT X-Received: by 2002:a05:6214:f0b:b0:66d:949d:717e with SMTP id gw11-20020a0562140f0b00b0066d949d717emr18955167qvb.42.1698888774449; Wed, 01 Nov 2023 18:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888774; cv=none; d=google.com; s=arc-20160816; b=XC8SDIVvBZZe4v/ldvo+Jj85qvebjw0jzMYL0cxavWXjfzMdqhA98ReAlZCmS4usNn 8u//1mVfkxBIamgtGrRxjoXprVWGxWt/PFMOLe4BEZNVKjPJXKjvWZfx64RPYCyyiTe+ 0WN2EmvV0qB0sroUd36bfbqlRX8YnqbNZEWhqIcWfnDn1rtQXJKEZeXaXeDQQ5hlvf4r tWYv1h6mVXkdFRTilV9cE4be7wXqOnsFloIzkxtt7PCIxoScOeyyVdN6og81HFGXP/oo AlNSzFJmUbNoKgTCTY3LBiI8nCUfaQle1jxVZEBINBsqaOgyDxrFdGboDKutHI/ApGxE ey4w== 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=/Exykv+xKuErtsZmUvO9DLpku6Bz9Jw3PAqZ735n9fU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=JQLckfX+XfAJcJZx1liTj6t3MR1a6YRcu5qKNZxnQjOrqW1v/IrnHMEavnFqsanN4S OUrz333SV8v/b9006CKmKeYvqaCZP4J72yI3c0KaipVMMQ96NbEpK9vpA7MpbEz1EPcH gUUGgR0MFTylORQzNWmVTQeZyeT7sQRI727rb847qZ+mzyYTidnQqZ5BfHp/9MzyJp0M PwqHIiL8ExnmDl5BgHbsNEkR+MMjmqcmecpLpDVybdOWqJJe9LpN15qdfUng4sgsz9H0 0K1zTyUIzc6aYhckTLG6CYsaWPtiYPxU6YJC+eCrPL5sODteGu0O+d3DHrGqS/n4NLlE X84w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C+1pZnEQ; 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 k15-20020a0cfa4f000000b0065b17bc10b7si3553423qvo.239.2023.11.01.18.32.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:54 -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=C+1pZnEQ; 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 1qyMXm-0005kx-Eq; Wed, 01 Nov 2023 21:30:46 -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 1qyMXi-0005ij-Mp for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:42 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXh-0001a8-87 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:42 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6b201a93c9cso456202b3a.0 for ; Wed, 01 Nov 2023 18:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888639; x=1699493439; 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=/Exykv+xKuErtsZmUvO9DLpku6Bz9Jw3PAqZ735n9fU=; b=C+1pZnEQK2LLMu7qmDJ6UUNMUqCcnjXLk53F9sALIWf1l80KGdluEQXTiteqSKmewb ga3MS3sSY/FJV+uSHlOeSvX+SD3XcAfqhvbSRTxM1mpb12j8dVE2VcGx0HvJ/+qoRDwa C9GN3Jbzo4Qta4lqt7m7JzpdAsXFbjBNAYgUjeuJGjBJfMl0SENQsF5aKxaLfnP5zIDH jeRiI40li15oSx6i2eP8H4QWSCPwJf5TLzuEVPTql677pm0Gp74C7Vfke1/zknzxir0l xIBdpli+P94ga2Pw9bnhPvnef9fwcxjk7bVtDzRadxJ0FjH/OvqPk7Nvz3cbRPMuT5ao Xb1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888639; x=1699493439; 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=/Exykv+xKuErtsZmUvO9DLpku6Bz9Jw3PAqZ735n9fU=; b=mTReqgIDFtfwup+orDU5a+VmywQYsRHT/nrzlow/FXNbgsaqvKRa0fetJY0ypr9wlI QpAUZpNGqABk2pXVrp5XUB9wpXANNJtr6dKVEHuJpCX5QnIS2guJEYKqFF/dbFi5QggF TVRjThzLrvDeqQgjbHsX4+OZx0CRQV0WMDVVc/dKZJ8oK4ueP6Dmh6oi5RD93h6gfRl1 +Vvks+NS/k0Rigi1THQdn5zsW+iaBZCzcxyeMNel6fV0AffDQtm84+g6xZnwrI2T8lxy 9WhH9fFcZa6SFl97bSfqFjuoupaYXOwNwV6gxqk9Ho1VAmUZ8zCysmL5DFn8+UoZgm3G r/Ag== X-Gm-Message-State: AOJu0YxyvKYZrYAp81vAYKfVHB0ZNRFIty45Wc5BOCLLHCuhMw/qEhKU 8G+P5jdfSvt2Cpi7XmD+QR9XlfFhhXHdcAucRS8= X-Received: by 2002:a05:6a20:8e2a:b0:174:63a9:293 with SMTP id y42-20020a056a208e2a00b0017463a90293mr17273056pzj.48.1698888635809; Wed, 01 Nov 2023 18:30:35 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 22/88] target/hppa: Implement hppa_cpu_class_by_name Date: Wed, 1 Nov 2023 18:29:10 -0700 Message-Id: <20231102013016.369010-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 --- linux-user/hppa/target_elf.h | 2 +- target/hppa/cpu.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h index 82b4e9535e..19cae8bd65 100644 --- a/linux-user/hppa/target_elf.h +++ b/linux-user/hppa/target_elf.h @@ -9,6 +9,6 @@ #define HPPA_TARGET_ELF_H static inline const char *cpu_get_model(uint32_t eflags) { - return "any"; + return "hppa"; } #endif diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 27c74f0d27..70ce0c3b99 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -158,7 +158,15 @@ static void hppa_cpu_initfn(Object *obj) static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) { - return object_class_by_name(TYPE_HPPA_CPU); + g_autofree char *typename = g_strconcat(cpu_model, "-cpu", NULL); + ObjectClass *oc = object_class_by_name(typename); + + if (oc && + !object_class_is_abstract(oc) && + object_class_dynamic_cast(oc, TYPE_HPPA_CPU)) { + return oc; + } + return NULL; } static void hppa_cpu_list_entry(gpointer data, gpointer user_data) From patchwork Thu Nov 2 01:29:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740340 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593533wrv; Wed, 1 Nov 2023 18:32:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDrkHvU8oslEmmnzNMkyPZRsBPBhRir17tBfnPi2AaVf0fpkLS7m2FMobVbq9RPX/p83QT X-Received: by 2002:ad4:5bc7:0:b0:672:4e8c:9ab1 with SMTP id t7-20020ad45bc7000000b006724e8c9ab1mr11754231qvt.53.1698888725201; Wed, 01 Nov 2023 18:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888725; cv=none; d=google.com; s=arc-20160816; b=Z1PhvRzuf2XcFaYBTp5s53KL2J2dqhfNT3pipHzTv3XwAb667J7po2xh/2xKUfob8q schEUkg7I/fCfM6xifBg7Mh4HXu1R0mpN2nkJHODH73uLolqb5oXNZoI6dwqEmwZK7oY hcY51Nlasx/hgAGJsVCw0oQni+TuBi+nhGdyxCVLlvhYzLghYetjaBksMwcOmcvwUfYh 6Sml8E2voZwV7LV07lbxuz7rbwSr3E1QzS8kdvVrItG0xAZ34JUsU63Mkq3iVW2/hB2f ARVqX70I1QT0MTCe6Ukdbw4Yi9LyK4d+3YhDYxTlVPOACBlQH2+ry8NOwipe5zD8CVjw mjYA== 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=BGX0hLDU7mlzZf7pxJoVlwonVpBOzxX6m78i0jjhfjQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=QtWGXCbNslx1zhx4wef0M0zRr42HbNHwW4eoectYVRGqhEYOwvRyhujLMRCgMzWr8I utGacYoTxuzXZmmBhXcHJG/UhhnorVjW7+OyAO7XSG4xzTBiVadPD8P/4RvmxMuOsy/V /qRI1/fWFG46t/971iP6vudE8xSXBWkeV5poT5PCKx8vA2v3oNnXs+j86IfmJsiqflAq zTayzNTA0LC+BWvB7jM/K1+zPs10toUxqNd0kWORxmEFlsvBd8v6kEW9kJcZQvL7s3cf QFLaiYGumOsIT0Ekm9fNvlKe+NzwIQidtl7SkiMxwTPj/xn1f1kFMRta3hCRBOszTh1r QZZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SeiyBbQC; 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 eh6-20020a056214186600b0066d16ed048asi3524010qvb.29.2023.11.01.18.32.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:05 -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=SeiyBbQC; 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 1qyMXr-0005nW-G1; Wed, 01 Nov 2023 21:30:51 -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 1qyMXp-0005lV-4X for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:49 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXn-0001dG-1X for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:48 -0400 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-5b94489e82eso309372a12.2 for ; Wed, 01 Nov 2023 18:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888646; x=1699493446; 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=BGX0hLDU7mlzZf7pxJoVlwonVpBOzxX6m78i0jjhfjQ=; b=SeiyBbQCbKFY0xJHW3r6rfXbwDCKc7DKlBh+6w+Nyhcnf7r/0GN5GPdU6dGSzckylw 9nKj4NJY4CNt3NJPGSRyztfeCatGxzSMT1CBerOwlgpZC/0858rXVIcRt2wpf4T5hgTq 0QlfHJlOe/tis8hrLnTBBY2AmpNtpmpSy+hUO8r6nqErVaIdsdI6qjvlvwl/G/Eb+hvw KooajPsqs1o54T0TFh1tvMXSEyRR1hgvzBbaEBvQZsSi5FB5uztWwBZQwwIRonxxdVn9 nBj2N+H1j1RSTkncYoaLx1hz7jdFVpO2pA5d5ax3Qb6UuO6PLGQ/719w8XAsHNuzqKJL ZUnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888646; x=1699493446; 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=BGX0hLDU7mlzZf7pxJoVlwonVpBOzxX6m78i0jjhfjQ=; b=kq7tNULXcxHsZFhFVAcfrlEWvUGA714GYw5V0baTxhzvXjyDUZatpmmYEDK+cfIlBA x5dP9w+iIDaxMFEjKR6EMW8fKZhvqMSzyNPPIi/Ut0T2DW27xir6mom+a4mBb4PvVs9L lRcuFMBl0tv0vgD+mxPwLWSZMUBET5TfpWC5qQWWVO9VYCfN+hi+/An2+vbeYCvoKW+5 GKklly7+57qB9d7bL0Vr/R8qwQkDTk8sJxFFTR9fs1LH8Q1wZhh/uIxlbPUzM6KLvmhu B1Lbo4x2FGYJN4JGpa7XmoDRmCpE+SgI6ICwUnP8Ay3xKWXyEBE8NRssuOYF5los2o1Y 2IKg== X-Gm-Message-State: AOJu0YyOW+h64dtHdJKrrVLTrvrJv50cLDcB3iWgCZkMfEcKjONwhPj+ FhDASPXVbVMjvm7Sb46Pt/sCy1aqwG9PrlDmh3w= X-Received: by 2002:a05:6a20:431c:b0:181:99d4:8fe9 with SMTP id h28-20020a056a20431c00b0018199d48fe9mr668500pzk.58.1698888639875; Wed, 01 Nov 2023 18:30:39 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 23/88] target/hppa: Update cpu_hppa_get/put_psw for hppa64 Date: Wed, 1 Nov 2023 18:29:11 -0700 Message-Id: <20231102013016.369010-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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, T_SCC_BODY_TEXT_LINE=-0.01 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 With 64-bit registers, there are 16 carry bits in the PSW. Clear reserved bits based on cpu revision. Signed-off-by: Richard Henderson --- target/hppa/helper.c | 63 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index cba8160b3d..fa17fe6931 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -28,19 +28,35 @@ target_ureg cpu_hppa_get_psw(CPUHPPAState *env) { target_ureg psw; + target_ureg mask1 = (target_ureg)-1 / 0xf; + target_ureg maskf = (target_ureg)-1 / 0xffff * 0xf; /* Fold carry bits down to 8 consecutive bits. */ - /* ??? Needs tweaking for hppa64. */ - /* .......b...c...d...e...f...g...h */ - psw = (env->psw_cb >> 4) & 0x01111111; - /* .......b..bc..cd..de..ef..fg..gh */ + /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^i^^^j^^^k^^^l^^^m^^^n^^^o^^^p^^^^ */ + /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^^ */ + psw = (env->psw_cb >> 4) & mask1; + /* .......b...c...d...e...f...g...h...i...j...k...l...m...n...o...p */ + /* .......b...c...d...e...f...g...h */ psw |= psw >> 3; - /* .............bcd............efgh */ - psw |= (psw >> 6) & 0x000f000f; - /* .........................bcdefgh */ - psw |= (psw >> 12) & 0xf; - psw |= env->psw_cb_msb << 7; - psw = (psw & 0xff) << 8; + /* .......b..bc..cd..de..ef..fg..gh..hi..ij..jk..kl..lm..mn..no..op */ + /* .......b..bc..cd..de..ef..fg..gh */ + psw |= psw >> 6; + psw &= maskf; + /* .............bcd............efgh............ijkl............mnop */ + /* .............bcd............efgh */ + psw |= psw >> 12; + /* .............bcd.........bcdefgh........efghijkl........ijklmnop */ + /* .............bcd.........bcdefgh */ + psw |= env->psw_cb_msb << (TARGET_REGISTER_BITS == 64 ? 39 : 7); + /* .............bcd........abcdefgh........efghijkl........ijklmnop */ + /* .............bcd........abcdefgh */ + + /* For hppa64, the two 8-bit fields are discontiguous. */ + if (hppa_is_pa20(env)) { + psw = (psw & 0xff00000000ull) | ((psw & 0xff) << 8); + } else { + psw = (psw & 0xff) << 8; + } psw |= env->psw_n * PSW_N; psw |= (env->psw_v < 0) * PSW_V; @@ -51,13 +67,38 @@ target_ureg cpu_hppa_get_psw(CPUHPPAState *env) void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) { + uint64_t reserved; target_ureg cb = 0; + /* Do not allow reserved bits to be set. */ + if (hppa_is_pa20(env)) { + reserved = MAKE_64BIT_MASK(40, 24) | MAKE_64BIT_MASK(28, 4); + reserved |= PSW_G; /* PA1.x only */ + reserved |= PSW_E; /* not implemented */ + } else { + reserved = MAKE_64BIT_MASK(32, 32) | MAKE_64BIT_MASK(28, 2); + reserved |= PSW_O | PSW_W; /* PA2.0 only */ + reserved |= PSW_E | PSW_Y | PSW_Z; /* not implemented */ + } + psw &= ~reserved; + env->psw = psw & ~(PSW_N | PSW_V | PSW_CB); env->psw_n = (psw / PSW_N) & 1; env->psw_v = -((psw / PSW_V) & 1); - env->psw_cb_msb = (psw >> 15) & 1; +#if TARGET_REGISTER_BITS == 32 + env->psw_cb_msb = (psw >> 15) & 1; +#else + env->psw_cb_msb = (psw >> 39) & 1; + cb |= ((psw >> 38) & 1) << 60; + cb |= ((psw >> 37) & 1) << 56; + cb |= ((psw >> 36) & 1) << 52; + cb |= ((psw >> 35) & 1) << 48; + cb |= ((psw >> 34) & 1) << 44; + cb |= ((psw >> 33) & 1) << 40; + cb |= ((psw >> 32) & 1) << 36; + cb |= ((psw >> 15) & 1) << 32; +#endif cb |= ((psw >> 14) & 1) << 28; cb |= ((psw >> 13) & 1) << 24; cb |= ((psw >> 12) & 1) << 20; From patchwork Thu Nov 2 01:29:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740366 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594800wrv; Wed, 1 Nov 2023 18:36:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLpxXJdUKbD/3SlU4YW+3RY2FG/pfVR1rVVM2YDTJ8RdbCL8sIoxkLELDU4tVnmNlK/LDN X-Received: by 2002:a1f:adce:0:b0:49c:37a1:235b with SMTP id w197-20020a1fadce000000b0049c37a1235bmr12318419vke.7.1698888989809; Wed, 01 Nov 2023 18:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888989; cv=none; d=google.com; s=arc-20160816; b=xmSPtJFzz5cEuy9cmjmPLlFOWDiEZ2TjI+eq9H6HfKyeLxExRD98URufIWnnib/hB/ QHfyCCm/QHSagcwrq1+XGJ0UazyaI/dnNjU3w5q5NwB4BxwXlSCzxpuWdebe7cWVxnc5 rSo9RGEP03Yuwcak5EG/K60AVfqtZW44zcE5T59BUOegi2lFRBgkTpMYh8ONkdKQEyIl NFIBoIVtchjJpTz+NN5hNjue4YM5obcUgR2O96175UmO6BKsL4uQWGLRLDUDxeie82tg I9Cs6McCxt2/gmqjeGdHW0GBUQaNC7gNLVxlnOzb4ygM48O9iDz+5LI6AXlbuybAjikt lBTQ== 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=LHnqcTd2zYy6MQLA9+Bgtzlrc46QZUrJeWNi/+sdBfc=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=pxMGfrtH2QVDBxlAahK8UyKh2j9ITpHE65g40GGcl9jN9RlT5K7I+YrywA5hjWe/2B g3ZrwZYHbHNGJ9enbXEAva1UgaioAARTtDTRYZaJKSYqxjt2e/6uGkaF3iJcla5QSN75 5MFahh0JCvbuRE9ISKWxYidDgK+/RWikUu7TJ5+FwVSBUHHFs7WMDRXx7/1W1QSN3w7C EzbEt0n/2nBz/DZfyVy/XfCQdPc2av4YPKCF83PccXEovyv0q8Jt3x7uEp8IbmPVCJH5 7eqOQwqTNi/BeV9SblfPuwQ1HbGATV2URtm7jio6EpsFnsQ6MzsXfxK2InP2WAdTBFTs q3xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GBCcEeLb; 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 po1-20020a05620a384100b0077586a3f948si3309440qkn.394.2023.11.01.18.36.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:36:29 -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=GBCcEeLb; 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 1qyMXr-0005nM-6f; Wed, 01 Nov 2023 21:30:51 -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 1qyMXk-0005kN-J8 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:44 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXi-0001c3-Rt for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:44 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6be1bc5aa1cso487467b3a.3 for ; Wed, 01 Nov 2023 18:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888641; x=1699493441; 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=LHnqcTd2zYy6MQLA9+Bgtzlrc46QZUrJeWNi/+sdBfc=; b=GBCcEeLbe0ymr0cQrB2N7RtHXOdjy/BbTKMa6UAhh4XtQb46Z9tavYfjW1hpaa3jAx XSTXdy2KPltg51tat39vtrKXE+OMxpZzByJf+7dQ9FceFpyb2ZEs8DgT1JjRmUAWMDVd Wnz8N1HliVZ5XuuRQaENyhgYR6LZzoQXZsYCfiqpMKmur3oQyHOdmE6WzRs3eLEuZwJS LNVwCCR3j5LBbQz1K9DEZZ4hUcljmn8yyPbj6JANiEQbXgCEND/9VEfgedEOajpAvBpp 77B06cFuNG9+Xa5f5z4Ulxr/yjGHftGAt+KGscDZNKI8WYoSB2De+18fgtiUZCgzQPRT aTTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888641; x=1699493441; 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=LHnqcTd2zYy6MQLA9+Bgtzlrc46QZUrJeWNi/+sdBfc=; b=XoYhBtS8hRN/fg/Xplghijh5UDoEdmwo6YsrAJoaaukJtiBpoi4ZbgdH2B87PRboZc xbQOpmn+EagwL3DtyZgBWBqg2s3O2fJmfI34ss/KaAGwLHpg4k7DxgVIu9vIo2MEt42K U8p5iJMG4TW4JnwAAflzwJNJLz3mGcWeSAUDA3zEfDEoulC/cdUWBa/Y/uEPFs6r+D/O eOyF06ud0OAvUJfyUXn5PYjVkk5h+gU+X5m3WpausDymY8+UH6Wh7VZP9s2lk6zHkqRV 7kjblnOt6hQUDSCf4llyBp2zfUgkq32yJgvZzXJQVqyyVs5BKo4D2N4T8EvsPMFj7Xr4 550w== X-Gm-Message-State: AOJu0YzE9BU11IPBD8y2m0SO5E3lEpFBCdmrcRkRcYrJxZPp7gTchwZW tL8dmld6hYKZb3VK5176TUfu5qFGKrc0yyiKJe4= X-Received: by 2002:a05:6a00:1488:b0:6be:b79:eca with SMTP id v8-20020a056a00148800b006be0b790ecamr21174106pfu.32.1698888640583; Wed, 01 Nov 2023 18:30:40 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 24/88] target/hppa: Handle absolute addresses for pa2.0 Date: Wed, 1 Nov 2023 18:29:12 -0700 Message-Id: <20231102013016.369010-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 With pa2.0, absolute addresses are not the same as physical addresses, and undergo a transformation based on PSW_W. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 3 +++ target/hppa/mem_helper.c | 43 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 301c82114a..2999df9ff9 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -313,6 +313,9 @@ static inline target_ulong hppa_form_gva(CPUHPPAState *env, uint64_t spc, return hppa_form_gva_psw(env->psw, spc, off); } +hwaddr hppa_abs_to_phys_pa2_w0(vaddr addr); +hwaddr hppa_abs_to_phys_pa2_w1(vaddr addr); + /* * Since PSW_{I,CB} will never need to be in tb->flags, reuse them. * TB_FLAG_SR_SAME indicates that SR4 through SR7 all contain the diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 327fb20c17..420b43a0f6 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -25,6 +25,45 @@ #include "hw/core/cpu.h" #include "trace.h" +hwaddr hppa_abs_to_phys_pa2_w1(vaddr addr) +{ + if (likely(extract64(addr, 58, 4) != 0xf)) { + /* Memory address space */ + return addr & MAKE_64BIT_MASK(0, 62); + } + if (extract64(addr, 54, 4) != 0) { + /* I/O address space */ + return addr | MAKE_64BIT_MASK(62, 2); + } + /* PDC address space */ + return (addr & MAKE_64BIT_MASK(0, 54)) | MAKE_64BIT_MASK(60, 4); +} + +hwaddr hppa_abs_to_phys_pa2_w0(vaddr addr) +{ + if (likely(extract32(addr, 28, 4) != 0xf)) { + /* Memory address space */ + return addr & MAKE_64BIT_MASK(0, 32); + } + if (extract32(addr, 24, 4) != 0) { + /* I/O address space */ + return addr | MAKE_64BIT_MASK(32, 32); + } + /* PDC address space */ + return (addr & MAKE_64BIT_MASK(0, 24)) | MAKE_64BIT_MASK(60, 4); +} + +static hwaddr hppa_abs_to_phys(CPUHPPAState *env, vaddr addr) +{ + if (!hppa_is_pa20(env)) { + return addr; + } else if (env->psw & PSW_W) { + return hppa_abs_to_phys_pa2_w1(addr); + } else { + return hppa_abs_to_phys_pa2_w0(addr); + } +} + static HPPATLBEntry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) { IntervalTreeNode *i = interval_tree_iter_first(&env->tlb_root, addr, addr); @@ -222,7 +261,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, } egress: - *pphys = phys; + *pphys = phys = hppa_abs_to_phys(env, phys); *pprot = prot; trace_hppa_tlb_get_physical_address(env, ret, prot, addr, phys); return ret; @@ -238,7 +277,7 @@ hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) /* ??? We really ought to know if the code mmu is disabled too, in order to get the correct debugging dumps. */ if (!(cpu->env.psw & PSW_D)) { - return addr; + return hppa_abs_to_phys(&cpu->env, addr); } excp = hppa_get_physical_address(&cpu->env, addr, MMU_KERNEL_IDX, 0, From patchwork Thu Nov 2 01:29:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740362 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594711wrv; Wed, 1 Nov 2023 18:36:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAu1hsBdOHJWmoTOI6MtyF0sxxTODKpQ5VaHkeSexm1aBvDKZasC0U5sol5StY0q8sH9d3 X-Received: by 2002:a05:620a:40c4:b0:775:c2a1:1f1e with SMTP id g4-20020a05620a40c400b00775c2a11f1emr20299444qko.50.1698888970187; Wed, 01 Nov 2023 18:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888970; cv=none; d=google.com; s=arc-20160816; b=LupsLWqJsBtwn2oS9A0VQceN2z9G2PLSJKLfqxTblLE3QeVCOQhMFDrA9Lx/jMPrEn 7P/V8ZYwR5gDhwKfW2CLjX+9k2+aC8aK8v4ioX+9lCDhkIiXHlId9U3yTzp0SvX0GtZq J2X+3hiOtI59PDjc02W57uP2d7QNUVI2sdGdYIinj0HJ2mBY2Nygnwzg34HYHM66NgIh ANGs5kuCuAQ30gnDVHuzZ/MTKMDkQVhf7Gb7yDEPGFWIQ8fvHMQinWqrYmNaF431oR/s NBVGBA6Ps7xdGRaInJLwIyDNwF7mrTeADhPMxTfKGPOWunQoqoYo1Yu1KiJn8XOv5n8y Ghlg== 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=bwAWQA8/GuVM2/E4PyfEdsUUm5Pmb1ysDSj4ZwY6m/s=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=PpNslBAYQJw55kN3ZR5/tehfsJdDo6ds3R9WOAs07CpW2/At7K2kKn4uBYaVzmFzVX OoEnDZjADfR1qJo08eWq/W8tJ0TBW/9qXiV5hFhhWnI8QLhCNrQ+lwnCzNMC/GvU6QHH VVBPFqPDDX2ZKR9uWzsgDPM9/dXH/sClhRO66TYNQ+U12cgqEKVhoIUrL9VzrvKsG4M4 L02NJGHC3wUGWFjstMmfuH25baA5g+VwlLKTLaIxL+EGbdeORrxTexmZPsygJ8gBxlb/ /IN15cMv/enu3H14e0eIox1D8iKbdupIclcsnO+o5wgHD+qgj6dgIyKBFFINYyAIwW8u 3Akg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=siZFd8if; 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 qz10-20020a05620a8c0a00b007788ccf40f3si3408719qkn.510.2023.11.01.18.36.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:36:10 -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=siZFd8if; 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 1qyMXq-0005lp-3v; Wed, 01 Nov 2023 21:30:50 -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 1qyMXk-0005k3-8Z for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:44 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXi-0001c0-Hj for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:44 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6ce2d4567caso204624a34.2 for ; Wed, 01 Nov 2023 18:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888641; x=1699493441; 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=bwAWQA8/GuVM2/E4PyfEdsUUm5Pmb1ysDSj4ZwY6m/s=; b=siZFd8ifGkwsIzkNPa9LFxAap4VFNal5ML7JviLRKt96DSXbjN3svnYVL4FGgS0Nmq bLdkNJ92NIjUlXrINJm4b1Gu+aiy2PT5zyiX8rpbcywwM3e9eIJ32NJAqmHgjBZikw7j N3K4nJbioH2WSbj7ITpIZUqI0xQsoC4uCsBDw9sE6uakFz7lipb2ldOitisL2nIa6Vvi dF1gzYR+r7X7MRa7ES/4GLCcMsEFm2BlJYyNIxC6A4KazgriTCoZ/BI72sAJQHiwRwiT xbYcfCS12j0dDyQJCLzo4l1UogwzzDhX0DyF0DxibqS/qwQJ5TMkrj19DUO2YwGge2Ui K1Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888641; x=1699493441; 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=bwAWQA8/GuVM2/E4PyfEdsUUm5Pmb1ysDSj4ZwY6m/s=; b=SPPcWD4+UhD/hKU3JBm4OtP/QUZ7Fj/hykqtPzJoC0W/WWHTZ6n6+sc0CoT1VASViv C3NB9HXK0VZzQ1l5ebCb3HRLrARGKA1E4yGCIIl4bAkXdLe9p+34Wrk4lKhQ0gxLWj0M V0egrDLgLosx+x/raM98YC+XMTQjwRjUObJfTmF2bD0BlCsPIzPPN6IyEWSFFZG3m2wa W4Q7yZKDAmqI/+IjyWRBhJbId5n0W4a/mJKZWEiTjqc4Hm/PvUL0Pw04dxOD/Us8QxSk U/77+zLHf2Q6pnqou4Jz6V6bTM2p2fzqmmRcIxSl4Px0FsFkUkwAZ1yRw/HGDer97h5J rx0g== X-Gm-Message-State: AOJu0YxxKP0c7HGZARjJGTFHvs7opKicwwptdRj3/lYRDhbvO16qnVDS fruqpCa7bwLnGohorDyVIet5sHUxmURyMDnAV8g= X-Received: by 2002:a9d:62c3:0:b0:6c4:cda6:ff3e with SMTP id z3-20020a9d62c3000000b006c4cda6ff3emr17414912otk.18.1698888641431; Wed, 01 Nov 2023 18:30:41 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 25/88] target/hppa: Adjust hppa_cpu_dump_state for hppa64 Date: Wed, 1 Nov 2023 18:29:13 -0700 Message-Id: <20231102013016.369010-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Dump all 64 bits for pa2.0 and low 32 bits for pa1.x. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/helper.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index fa17fe6931..c973b65bea 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -111,18 +111,26 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) { - HPPACPU *cpu = HPPA_CPU(cs); - CPUHPPAState *env = &cpu->env; + CPUHPPAState *env = cpu_env(cs); target_ureg psw = cpu_hppa_get_psw(env); target_ureg psw_cb; char psw_c[20]; - int i; + int i, w; + uint64_t m; + + if (hppa_is_pa20(env)) { + w = 16; + m = UINT64_MAX; + } else { + w = 8; + m = UINT32_MAX; + } qemu_fprintf(f, "IA_F " TARGET_FMT_lx " IA_B " TARGET_FMT_lx - " IIR " TREG_FMT_lx "\n", + " IIR %0*" PRIx64 "\n", hppa_form_gva_psw(psw, env->iasq_f, env->iaoq_f), hppa_form_gva_psw(psw, env->iasq_b, env->iaoq_b), - env->cr[CR_IIR]); + w, m & env->cr[CR_IIR]); psw_c[0] = (psw & PSW_W ? 'W' : '-'); psw_c[1] = (psw & PSW_E ? 'E' : '-'); @@ -143,13 +151,15 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) psw_c[16] = (psw & PSW_D ? 'D' : '-'); psw_c[17] = (psw & PSW_I ? 'I' : '-'); psw_c[18] = '\0'; - psw_cb = ((env->psw_cb >> 4) & 0x01111111) | (env->psw_cb_msb << 28); + psw_cb = ((env->psw_cb >> 4) & ((target_ureg)-1 / 0xf)) + | (env->psw_cb_msb << (TARGET_REGISTER_BITS - 4)); - qemu_fprintf(f, "PSW " TREG_FMT_lx " CB " TREG_FMT_lx " %s\n", - psw, psw_cb, psw_c); + qemu_fprintf(f, "PSW %0*" PRIx64 " CB %0*" PRIx64 " %s\n", + w, m & psw, w, m & psw_cb, psw_c); for (i = 0; i < 32; i++) { - qemu_fprintf(f, "GR%02d " TREG_FMT_lx "%c", i, env->gr[i], + qemu_fprintf(f, "GR%02d %0*" PRIx64 "%c", + i, w, m & env->gr[i], (i & 3) == 3 ? '\n' : ' '); } #ifndef CONFIG_USER_ONLY From patchwork Thu Nov 2 01:29:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740342 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593552wrv; Wed, 1 Nov 2023 18:32:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaE6QI6/CIRBk+7LM6f26apfxdDtvPG8J7FDuNI0VbVtIDA0W9/qe1vD4DGWa3/9kDOd9j X-Received: by 2002:a05:622a:1b8e:b0:417:a645:982f with SMTP id bp14-20020a05622a1b8e00b00417a645982fmr19651444qtb.29.1698888731487; Wed, 01 Nov 2023 18:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888731; cv=none; d=google.com; s=arc-20160816; b=wO0BGhxHG5zJzjj6c7921SQ9AACehieGB+c7SsntmF+Wpy4tHxBu4Y4sMkVigWQ/Eo VaYH1OTS0phJgijFt/uFXQpVbKFpSiyBxiOfzlft6936k2X6M/EJRTi8UnuED6K9aTPa oCEka4e7yUTkqfQ04I4QeFuCXl8ZyBdMMQTUNSU7plXbunI64ykbiRfmmJcxcKdH1S5F RWsLnD9F8rmFrzHDHuAgDBo4ID9jmRfBTZy20z6jpG0EwMSHXu2HzkRvsK5h7pvQe7jh CbatP+RmOQ9KkWinaY2+PoPPU2fM/WoeL95UP+CMn+rGFB+z101GkUR4YnAv5oB+AVIY HVTQ== 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=I/ED2o2s4ms+vsY/bEE/bt2PcFzZktCazvwqho7s/dw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=juTEwUZZzStqodFwy57RzBScRhyj8wrzCT9fvJZcR07NRqYaLLvigFeGNEYLusjBVQ 2OuKRZKFhFJXRO3ZID2vQzOYNFWGy5Hr6CG9gnuGv3Hv50WIuTpqxw+sSfE6KVXbBiVT l/oTHRCYPsXujLvoNYBfbOH0qkUOHCOpLS07rAn/3pWVn8K7mjZCQfCNm/oReASP+h6G Do8TEd9JSY9UUPm1YWSxhuuF/9d5NQjDEiItny687p00gZvTJN5ZtSQ1sJBUxXEC1VXF LnnlnmXLF58HIwkzllMPGi1lp5DSRvoDJT3yFWpOIRvD1q9uQtiVW1GDK0o500yMA2nZ F5Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aEeU6Ch6; 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 k2-20020ac85fc2000000b00419c9df4106si3749423qta.116.2023.11.01.18.32.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:11 -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=aEeU6Ch6; 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 1qyMYm-0006ET-L9; Wed, 01 Nov 2023 21:31:50 -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 1qyMXl-0005kZ-4D for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:45 -0400 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXj-0001cD-Ew for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:44 -0400 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6d31f3e8ca8so244250a34.0 for ; Wed, 01 Nov 2023 18:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888642; x=1699493442; 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=I/ED2o2s4ms+vsY/bEE/bt2PcFzZktCazvwqho7s/dw=; b=aEeU6Ch6Rl+XqdKd1HXtBxdXGlfAFq+e9Ze7EFVn5llEmjv/5q/xED4slRai6MPfua pS51WXp6bGlTdtnNn3J379ZjNjBgqShLWTbUE4pn5d/0TWQrlfBVrpGu2ORMxexbFiiY hx62VF7WVyuKfgDFYC/s3yoqdUsPnzUC9EyZwEIUj+dqGcR2AxI1vkgthjMs6Zgei1dH l8OHf8mU438FwNuvpChF+cZLKhAdZlAKVRAsHeg4pQSLPqzQa4acv8U7MpDAhlBkvlFU vMuvAzVMWdXBEMEHSmdSp4mQz42FwK590CfdAcZLQWsHDJbExcPH4mjLZyOrth0XQF0i zCaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888642; x=1699493442; 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=I/ED2o2s4ms+vsY/bEE/bt2PcFzZktCazvwqho7s/dw=; b=QLSGFTtw9m55EUp1TH54PZRgsYytYE3CH+nedq+uAQQMirt0DXSWTCC428Z5CHqym2 uhKdiIuTQIAg9t62NIjFAbH1RZFXzX9nFHB324MQA6EgUGTNqtGB+xmPjWgNp0BC7HIp WSYFqV+t4gsRRlBGvhigAfPTosE9wbU5MEYkiw+wwXdUWFMndoNvas6pgh7Z+V8vBf/A 534MEZcn610w0i42oDWePQOKLVXGDqzn0Cq9IWxTRRRqO9zQ2lfiLbh3I+yLzbcH4JPi b6ns1/PDrTLJ5Z+nbtnBCqFJSNuXCSQh/MXoSm9YQjcEcWEYyU6Ig671ft0XYctfEi9M 1CcQ== X-Gm-Message-State: AOJu0Yxvu2L5UMpdWYyKA0LowMlODx0NYhka97+80F7NzKRNQ2uEZCnB fxqE5jun7V6pSWBTO84TxtmWTTCPSGNgYecDeyI= X-Received: by 2002:a05:6830:110c:b0:6cd:4358:1f02 with SMTP id w12-20020a056830110c00b006cd43581f02mr19111087otq.34.1698888642252; Wed, 01 Nov 2023 18:30:42 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 26/88] target/hppa: Fix hppa64 addressing Date: Wed, 1 Nov 2023 18:29:14 -0700 Message-Id: <20231102013016.369010-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::335; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01 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 In form_gva and cpu_get_tb_cpu_state, we must truncate when PSW_W == 0. In space_select, the bits that choose the space depend on PSW_W. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 7 +++---- target/hppa/translate.c | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 2999df9ff9..cb838defb0 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -302,7 +302,7 @@ static inline target_ulong hppa_form_gva_psw(target_ureg psw, uint64_t spc, #ifdef CONFIG_USER_ONLY return off; #else - off &= (psw & PSW_W ? 0x3fffffffffffffffull : 0xffffffffull); + off &= psw & PSW_W ? MAKE_64BIT_MASK(0, 62) : MAKE_64BIT_MASK(0, 32); return spc | off; #endif } @@ -343,9 +343,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, flags |= env->psw & (PSW_W | PSW_C | PSW_D | PSW_P); flags |= (env->iaoq_f & 3) << TB_FLAG_PRIV_SHIFT; - *pc = (env->psw & PSW_C - ? hppa_form_gva_psw(env->psw, env->iasq_f, env->iaoq_f & -4) - : env->iaoq_f & -4); + *pc = hppa_form_gva_psw(env->psw, (env->psw & PSW_C ? env->iasq_f : 0), + env->iaoq_f & -4); *cs_base = env->iasq_f; /* Insert a difference between IAOQ_B and IAOQ_F within the otherwise zero diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 44c9911720..4e0bc48b09 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -710,6 +710,13 @@ static bool nullify_end(DisasContext *ctx) return true; } +static target_ureg gva_offset_mask(DisasContext *ctx) +{ + return (ctx->tb_flags & PSW_W + ? MAKE_64BIT_MASK(0, 62) + : MAKE_64BIT_MASK(0, 32)); +} + static void copy_iaoq_entry(TCGv_reg dest, target_ureg ival, TCGv_reg vval) { if (unlikely(ival == -1)) { @@ -1398,7 +1405,8 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) tmp = tcg_temp_new(); spc = tcg_temp_new_tl(); - tcg_gen_shri_reg(tmp, base, TARGET_REGISTER_BITS - 5); + /* Extract top 2 bits of the address, shift left 3 for uint64_t index. */ + tcg_gen_shri_reg(tmp, base, (ctx->tb_flags & PSW_W ? 64 : 32) - 5); tcg_gen_andi_reg(tmp, tmp, 030); tcg_gen_trunc_reg_ptr(ptr, tmp); @@ -1415,6 +1423,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, { TCGv_reg base = load_gpr(ctx, rb); TCGv_reg ofs; + TCGv_tl addr; /* Note that RX is mutually exclusive with DISP. */ if (rx) { @@ -1429,18 +1438,13 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, } *pofs = ofs; -#ifdef CONFIG_USER_ONLY - *pgva = (modify <= 0 ? ofs : base); -#else - TCGv_tl addr = tcg_temp_new_tl(); + *pgva = addr = tcg_temp_new_tl(); tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); - if (ctx->tb_flags & PSW_W) { - tcg_gen_andi_tl(addr, addr, 0x3fffffffffffffffull); - } + tcg_gen_andi_tl(addr, addr, gva_offset_mask(ctx)); +#ifndef CONFIG_USER_ONLY if (!is_phys) { tcg_gen_or_tl(addr, addr, space_select(ctx, sp, base)); } - *pgva = addr; #endif } From patchwork Thu Nov 2 01:29:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740381 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595364wrv; Wed, 1 Nov 2023 18:38:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEfYyImd5O8Vp+N5auMh63kpkrqpYlvi7b3WyCCswxZJBVP7szTfu5YkyIEV/HKYhm/QYUH X-Received: by 2002:a05:6214:5007:b0:66d:4a22:d7cd with SMTP id jo7-20020a056214500700b0066d4a22d7cdmr22040182qvb.60.1698889122286; Wed, 01 Nov 2023 18:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889122; cv=none; d=google.com; s=arc-20160816; b=uxMrqv27Yp/xrozO2iCCsgsp82bnGVbWQy3P/sLRzDIvJ8jHG1Ey8B7ONbYaEYDcb+ 3ThZJrWOgOkg637OMmPam56ePwx0P4qMuwLJZuE12o/8BtVa3GaZ10tqQioHFnNoj8CJ gerz4MIEASgZgiyKzH27MODS6loZe9Ei3bMiXxtXCMUtCJVekAznTS+xa/yPE2BLQJiv 15TLCmOVNEleBZyh8QUHKK7xOj8Q7Q51oGrowM9HYHbEJXQYquus7szxpDQUesdeC0p/ aMJ+32EQtRVPM6/ZNy8kQO12bU69+1w2tmEpwNMaAHlaQ93AlLA+SvRQCL80U6JmMhOv mJ+Q== 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=UdEYiuOYJXkuv427aOu34bhOpMdqGfn9qCvVFPH2z9A=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=FFjMq4Dzq/7x+LiKBjaDgaN9O43lhjNj/hrlVuikPwZNaOZmMYOPtaGzLIa96qN11k 5P4UGHLwc77ojJajlg1jKbeihf2C+ZZkYdxzuSr4bAn3Y7xirqfWxTT9G/0VqhLuRidL WWSvyEasYIPDHYtCe2L9Xb4Cfq95413FLDgZfl9z99BIJ7Vfca87mds02Kq5x9JEsKvm i0JmSIoeXzBqIVrnz9PdHodZkxDIvhVDwZI2tWOLMx3jmU2CseO0XU4g/mS8UEpyJyqA /T3Y48j0Yv3PiN918Yi8A4iWBf9Vl6oEhUYTWyFr+HwZ4jg44OWJ2VwUk7W2IO6BlPsm y0jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWTAKTx1; 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 w13-20020a0cef8d000000b0065d124684a6si3633885qvr.88.2023.11.01.18.38.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:42 -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=CWTAKTx1; 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 1qyMYL-0005td-P2; Wed, 01 Nov 2023 21:31:21 -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 1qyMXp-0005lZ-Gq for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:49 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXm-0001cl-Cb for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:49 -0400 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-5b8c39a2dceso290743a12.2 for ; Wed, 01 Nov 2023 18:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888644; x=1699493444; 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=UdEYiuOYJXkuv427aOu34bhOpMdqGfn9qCvVFPH2z9A=; b=CWTAKTx1V/8IobZA91ZcgRkIUJ4S40FkdnDWDp68+C/+X/0LfixSzZaECNX7j2z/Tp 2Kt0BRfcgQoNyEgGHbLBJTZZHHqw9mRqz/Y7yoXZKFfzEPYNaoj1WjP39WAgnb93mwXJ Uj6c+5ILdJ3fTY5eB/PiCed3psDX9FtnRj1shR7mG6JZG6iftT0cUXfGHKkB0aDg0fYk 1GvtBu+6E5ffpxs2g1Ld6u6sEEOkxc1Wp9TkZL9j+CLFUTx/329Hdz5MSLiVt64rvFRA wGWMyoqxK183DG27DiH9piyBi5NQ/TEQBCSZedKmMSmSAt97rm+nFps96M5yBMBSIT2B S6gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888644; x=1699493444; 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=UdEYiuOYJXkuv427aOu34bhOpMdqGfn9qCvVFPH2z9A=; b=gT5CQvAGeuvYx5g/Jsc/aSh+HXsEs3oOKhrLRboHG8wcRSjZIx/sXaPw8ueiLtHmv3 f63XyIaSLF4lxLm5yevvx1t6H4b389dPqzPxm5EqESPD4bDCgUa1VGEXMb2I5pDi0nwZ ITrDrl/wous21OwcKVhlw4Amxd1ipavDyxxERIGH0+ocL1t8anZXFxan0pegTJG3CGey 02arLn0IdAh/BK4uqELnZv2hir7JIN8dUtWYw1cknLv7PS8AzwV/OwOWKfY47CY3TDaL SWTMdEIFwD5eb31LDgoyGklSqHO0GsYpjMZfUBG5j3yZzmaQAlctaM1m7KiOLYtjyXHi nVng== X-Gm-Message-State: AOJu0Yy5WMoNgGMwddYCqYUqwVauYYd63ZdAk55pKF2WblM0A4tcbCKT 1SK7ddHs351oVTzV66zDXA1euuxOTtTIcshK6xs= X-Received: by 2002:a05:6a20:e114:b0:14d:abc:73dc with SMTP id kr20-20020a056a20e11400b0014d0abc73dcmr18685959pzb.32.1698888642947; Wed, 01 Nov 2023 18:30:42 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 27/88] target/hppa: Pass DisasContext to copy_iaoq_entry Date: Wed, 1 Nov 2023 18:29:15 -0700 Message-Id: <20231102013016.369010-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Interface change only, no functional effect. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4e0bc48b09..e342cc1d08 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -717,7 +717,8 @@ static target_ureg gva_offset_mask(DisasContext *ctx) : MAKE_64BIT_MASK(0, 32)); } -static void copy_iaoq_entry(TCGv_reg dest, target_ureg ival, TCGv_reg vval) +static void copy_iaoq_entry(DisasContext *ctx, TCGv_reg dest, + target_ureg ival, TCGv_reg vval) { if (unlikely(ival == -1)) { tcg_gen_mov_reg(dest, vval); @@ -738,8 +739,8 @@ static void gen_excp_1(int exception) static void gen_excp(DisasContext *ctx, int exception) { - copy_iaoq_entry(cpu_iaoq_f, ctx->iaoq_f, cpu_iaoq_f); - copy_iaoq_entry(cpu_iaoq_b, ctx->iaoq_b, cpu_iaoq_b); + copy_iaoq_entry(ctx, cpu_iaoq_f, ctx->iaoq_f, cpu_iaoq_f); + copy_iaoq_entry(ctx, cpu_iaoq_b, ctx->iaoq_b, cpu_iaoq_b); nullify_save(ctx); gen_excp_1(exception); ctx->base.is_jmp = DISAS_NORETURN; @@ -795,8 +796,8 @@ static void gen_goto_tb(DisasContext *ctx, int which, tcg_gen_movi_reg(cpu_iaoq_b, b); tcg_gen_exit_tb(ctx->base.tb, which); } else { - copy_iaoq_entry(cpu_iaoq_f, f, cpu_iaoq_b); - copy_iaoq_entry(cpu_iaoq_b, b, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_iaoq_f, f, cpu_iaoq_b); + copy_iaoq_entry(ctx, cpu_iaoq_b, b, ctx->iaoq_n_var); tcg_gen_lookup_and_goto_ptr(); } } @@ -1752,7 +1753,7 @@ static bool do_dbranch(DisasContext *ctx, target_ureg dest, { if (ctx->null_cond.c == TCG_COND_NEVER && ctx->null_lab == NULL) { if (link != 0) { - copy_iaoq_entry(cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } ctx->iaoq_n = dest; if (is_n) { @@ -1762,7 +1763,7 @@ static bool do_dbranch(DisasContext *ctx, target_ureg dest, nullify_over(ctx); if (link != 0) { - copy_iaoq_entry(cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } if (is_n && use_nullify_skip(ctx)) { @@ -1860,7 +1861,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, if (ctx->null_cond.c == TCG_COND_NEVER) { if (link != 0) { - copy_iaoq_entry(cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } next = tcg_temp_new(); tcg_gen_mov_reg(next, dest); @@ -1906,7 +1907,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, tmp = tcg_temp_new(); next = tcg_temp_new(); - copy_iaoq_entry(tmp, ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, tmp, ctx->iaoq_n, ctx->iaoq_n_var); tcg_gen_movcond_reg(c, next, a0, a1, tmp, dest); ctx->iaoq_n = -1; ctx->iaoq_n_var = next; @@ -2643,8 +2644,8 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf *a) nullify_over(ctx); /* Advance the instruction queue. */ - copy_iaoq_entry(cpu_iaoq_f, ctx->iaoq_b, cpu_iaoq_b); - copy_iaoq_entry(cpu_iaoq_b, ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_iaoq_f, ctx->iaoq_b, cpu_iaoq_b); + copy_iaoq_entry(ctx, cpu_iaoq_b, ctx->iaoq_n, ctx->iaoq_n_var); nullify_set(ctx, 0); /* Tell the qemu main loop to halt until this cpu has work. */ @@ -3433,7 +3434,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) load_spr(ctx, new_spc, a->sp); if (a->l) { - copy_iaoq_entry(cpu_gr[31], ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_gr[31], ctx->iaoq_n, ctx->iaoq_n_var); tcg_gen_mov_i64(cpu_sr[0], cpu_iasq_f); } if (a->n && use_nullify_skip(ctx)) { @@ -3442,7 +3443,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) tcg_gen_mov_i64(cpu_iasq_f, new_spc); tcg_gen_mov_i64(cpu_iasq_b, cpu_iasq_f); } else { - copy_iaoq_entry(cpu_iaoq_f, ctx->iaoq_b, cpu_iaoq_b); + copy_iaoq_entry(ctx, cpu_iaoq_f, ctx->iaoq_b, cpu_iaoq_b); if (ctx->iaoq_b == -1) { tcg_gen_mov_i64(cpu_iasq_f, cpu_iasq_b); } @@ -3556,14 +3557,14 @@ static bool trans_bve(DisasContext *ctx, arg_bve *a) nullify_over(ctx); dest = do_ibranch_priv(ctx, load_gpr(ctx, a->b)); - copy_iaoq_entry(cpu_iaoq_f, ctx->iaoq_b, cpu_iaoq_b); + copy_iaoq_entry(ctx, cpu_iaoq_f, ctx->iaoq_b, cpu_iaoq_b); if (ctx->iaoq_b == -1) { tcg_gen_mov_i64(cpu_iasq_f, cpu_iasq_b); } - copy_iaoq_entry(cpu_iaoq_b, -1, dest); + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, dest); tcg_gen_mov_i64(cpu_iasq_b, space_select(ctx, 0, dest)); if (a->l) { - copy_iaoq_entry(cpu_gr[a->l], ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_gr[a->l], ctx->iaoq_n, ctx->iaoq_n_var); } nullify_set(ctx, a->n); tcg_gen_lookup_and_goto_ptr(); @@ -4218,7 +4219,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) case DISAS_IAQ_N_STALE_EXIT: if (ctx->iaoq_f == -1) { tcg_gen_mov_reg(cpu_iaoq_f, cpu_iaoq_b); - copy_iaoq_entry(cpu_iaoq_b, ctx->iaoq_n, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_iaoq_b, ctx->iaoq_n, ctx->iaoq_n_var); #ifndef CONFIG_USER_ONLY tcg_gen_mov_i64(cpu_iasq_f, cpu_iasq_b); #endif @@ -4247,8 +4248,8 @@ static void hppa_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) case DISAS_TOO_MANY: case DISAS_IAQ_N_STALE: case DISAS_IAQ_N_STALE_EXIT: - copy_iaoq_entry(cpu_iaoq_f, ctx->iaoq_f, cpu_iaoq_f); - copy_iaoq_entry(cpu_iaoq_b, ctx->iaoq_b, cpu_iaoq_b); + copy_iaoq_entry(ctx, cpu_iaoq_f, ctx->iaoq_f, cpu_iaoq_f); + copy_iaoq_entry(ctx, cpu_iaoq_b, ctx->iaoq_b, cpu_iaoq_b); nullify_save(ctx); /* FALLTHRU */ case DISAS_IAQ_N_UPDATED: From patchwork Thu Nov 2 01:29:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740356 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594557wrv; Wed, 1 Nov 2023 18:35:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbscHuYTSsfEfZUWnXK5foloaVYeM5ap9IJTqJJ1tllkC/V5EKlxtnSZLHEq4J1lSLI6/y X-Received: by 2002:a05:6214:301e:b0:66d:6405:15f7 with SMTP id ke30-20020a056214301e00b0066d640515f7mr17569885qvb.2.1698888942295; Wed, 01 Nov 2023 18:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888942; cv=none; d=google.com; s=arc-20160816; b=fRyRd0Phaab1HV+EBHqh9J1OkczrQpZZnP/aav79yjM1GN+8xCPkCTrDdCmI53mRVA OYMsupWQQYqtGiI7sUzytxtwNh0p3/aeyodZfpCbFcxlIVapzHN6/ebPay5EEKya6/xO VXCEfKGvKc7MVCR4BgdUlv8dY6vsbPjvo0IaPlwnrAgYsB6tTLD4j+kgKsLeUbank7BM WZQKz5QyX7d22Ntk1zTCq60vlqNSIao/w+Ja+c3hR8oUttRiXt3AywI2lO8RAGxyXh4y WPTg5WuJnX01y4HMHSMAhzQoqWgDykd/Gff4Bl25ucZqsZuEOl9VpFZuicpLx/075hAO xJug== 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=7b9B75syRRFox+ySjdaas6fiuQ+tj66tig0BEDzKTxY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=KxcZ6h/JYkFaadQzlguCE4P8usF92YCL3EtaNg6nAxcfq0Un2CQ+0JIJRbT7b0UJeF HGqDsFqn1ciCRBiY9GoEZO8Q2RDTqc5pwd/5MBgxxdXgHMl+BRLYyUJNxIqYT4cTCsTd m9PnwGgW9hXq5bwnGRegolAZc4CEr+fjtF7ibtRd5Zv2WPFcduL1pBLn+R6qhMF6HufV 40RaCAnVP8S6IdHgCSYT1zDA1U5+DS4RQ1qUXAKmfNZ2OQqhzl0txwcJxQ9S1UY119nM mQaAhMcshDkc7sw834Fr4q2Zs/dRKsra4/ecu3gGi8nqU8fJYKWK3mSdHr9KOwbbfgwQ vmGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bK3CjHk8; 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 m11-20020ad44b6b000000b0065afaec84b5si3497138qvx.355.2023.11.01.18.35.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:35:42 -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=bK3CjHk8; 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 1qyMYL-0005t4-G0; Wed, 01 Nov 2023 21:31:21 -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 1qyMXn-0005lU-Np for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:49 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXl-0001ch-TZ for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:47 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6ce31c4a653so210639a34.3 for ; Wed, 01 Nov 2023 18:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888644; x=1699493444; 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=7b9B75syRRFox+ySjdaas6fiuQ+tj66tig0BEDzKTxY=; b=bK3CjHk8fAFXXSNes7rWr56JzuOpSJWX7QuTb4RXUqXcxreel1WJg2LGxmVg2/BzlG aO2LVUsrQKRE1dy1d9TEilRANvDYOC/bml3RHai2dXWQLrtTDObjlWHthBGjjegzrtv9 tecTj082uqS4haKaKCfgmHbq9LoDgvFUqYzTnoANziwUvf7snJJfIGY9XBLVVWuqbNXk GdlsXIZyLCVcV4elkty3YuLDIkz8XkB+fdvDmstmEOWxdosDezokTw7GJOcV/PNS2YO8 SjuUOerJyTMO9p9QNXmbCWLhoGmRnjMtgsg4yCo87SNPdVyBKhp+KJ7QpA/wqdLAGe6Y KHgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888644; x=1699493444; 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=7b9B75syRRFox+ySjdaas6fiuQ+tj66tig0BEDzKTxY=; b=BvxkkxgD9xwX3OKUq9Fj5UHHl6LcmHVCruQCD9YOdrzzxIeeaB2PqUMQYoMS+ZDXCF +KvNdBTpJhFMkxDtVcWqOxJTpXsp2hJdS9hkFt0+0W3Be+tn4Amswm7gyEt8FCosnFfa so01YbEiV6/Ls3IQilWB5Jzn2cP/Lw43BLZFlb94OoBrE82KC4lCpvkXo7oSuF0Ppuwb pRVd2l9i6bUbOf0iCKpYzhzYbG/wFZGVjaDpU2XU6iwH6ZJrpaB9waiao6W4bYry+a5K SJCFhfduv0Z5LNzgilJItsL0f7ak1O1zFOmjFp4rlY7D0uXCGarW4Br5XDViE5oAgThB 7vwA== X-Gm-Message-State: AOJu0YyliTV4pjsPnacBJXaxq+/6pYLzg8AD5Fw681VcK6X8d0eBMBCa iT6/dhJ2RIOmGwSGUfyp9t7yo3G+QXDAI/9iYqc= X-Received: by 2002:a05:6830:1e35:b0:6d3:a14:f3f1 with SMTP id t21-20020a0568301e3500b006d30a14f3f1mr7009128otr.7.1698888643774; Wed, 01 Nov 2023 18:30:43 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 28/88] target/hppa: Always use copy_iaoq_entry to set cpu_iaoq_[fb] Date: Wed, 1 Nov 2023 18:29:16 -0700 Message-Id: <20231102013016.369010-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::336; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x336.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, T_SCC_BODY_TEXT_LINE=-0.01 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 This will be how we ensure that the IAOQ is always valid per PSW.W, therefore all stores to these two variables must be done with this function. Use third argument -1 if the destination is always dynamic, and fourth argument NULL if the destination is always static. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index e342cc1d08..348fdb75e5 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -792,8 +792,8 @@ static void gen_goto_tb(DisasContext *ctx, int which, { if (f != -1 && b != -1 && use_goto_tb(ctx, f)) { tcg_gen_goto_tb(which); - tcg_gen_movi_reg(cpu_iaoq_f, f); - tcg_gen_movi_reg(cpu_iaoq_b, b); + copy_iaoq_entry(ctx, cpu_iaoq_f, f, NULL); + copy_iaoq_entry(ctx, cpu_iaoq_b, b, NULL); tcg_gen_exit_tb(ctx->base.tb, which); } else { copy_iaoq_entry(ctx, cpu_iaoq_f, f, cpu_iaoq_b); @@ -1867,8 +1867,9 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, tcg_gen_mov_reg(next, dest); if (is_n) { if (use_nullify_skip(ctx)) { - tcg_gen_mov_reg(cpu_iaoq_f, next); - tcg_gen_addi_reg(cpu_iaoq_b, next, 4); + copy_iaoq_entry(ctx, cpu_iaoq_f, -1, next); + tcg_gen_addi_reg(next, next, 4); + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, next); nullify_set(ctx, 0); ctx->base.is_jmp = DISAS_IAQ_N_UPDATED; return true; @@ -1890,8 +1891,10 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, /* We do have to handle the non-local temporary, DEST, before branching. Since IOAQ_F is not really live at this point, we can simply store DEST optimistically. Similarly with IAOQ_B. */ - tcg_gen_mov_reg(cpu_iaoq_f, dest); - tcg_gen_addi_reg(cpu_iaoq_b, dest, 4); + copy_iaoq_entry(ctx, cpu_iaoq_f, -1, dest); + next = tcg_temp_new(); + tcg_gen_addi_reg(next, dest, 4); + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, next); nullify_over(ctx); if (link != 0) { @@ -1970,6 +1973,8 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) aforementioned BE. */ static void do_page_zero(DisasContext *ctx) { + TCGv_reg tmp; + /* If by some means we get here with PSW[N]=1, that implies that the B,GATE instruction would be skipped, and we'd fault on the next insn within the privileged page. */ @@ -2006,8 +2011,11 @@ static void do_page_zero(DisasContext *ctx) case 0xe0: /* SET_THREAD_POINTER */ tcg_gen_st_reg(cpu_gr[26], tcg_env, offsetof(CPUHPPAState, cr[27])); - tcg_gen_ori_reg(cpu_iaoq_f, cpu_gr[31], 3); - tcg_gen_addi_reg(cpu_iaoq_b, cpu_iaoq_f, 4); + tmp = tcg_temp_new(); + tcg_gen_ori_reg(tmp, cpu_gr[31], 3); + copy_iaoq_entry(ctx, cpu_iaoq_f, -1, tmp); + tcg_gen_addi_reg(tmp, tmp, 4); + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, tmp); ctx->base.is_jmp = DISAS_IAQ_N_UPDATED; break; @@ -3438,8 +3446,9 @@ static bool trans_be(DisasContext *ctx, arg_be *a) tcg_gen_mov_i64(cpu_sr[0], cpu_iasq_f); } if (a->n && use_nullify_skip(ctx)) { - tcg_gen_mov_reg(cpu_iaoq_f, tmp); - tcg_gen_addi_reg(cpu_iaoq_b, cpu_iaoq_f, 4); + copy_iaoq_entry(ctx, cpu_iaoq_f, -1, tmp); + tcg_gen_addi_reg(tmp, tmp, 4); + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, tmp); tcg_gen_mov_i64(cpu_iasq_f, new_spc); tcg_gen_mov_i64(cpu_iasq_b, cpu_iasq_f); } else { @@ -3447,7 +3456,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) if (ctx->iaoq_b == -1) { tcg_gen_mov_i64(cpu_iasq_f, cpu_iasq_b); } - tcg_gen_mov_reg(cpu_iaoq_b, tmp); + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, tmp); tcg_gen_mov_i64(cpu_iasq_b, new_spc); nullify_set(ctx, a->n); } @@ -4218,7 +4227,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) case DISAS_IAQ_N_STALE: case DISAS_IAQ_N_STALE_EXIT: if (ctx->iaoq_f == -1) { - tcg_gen_mov_reg(cpu_iaoq_f, cpu_iaoq_b); + copy_iaoq_entry(ctx, cpu_iaoq_f, -1, cpu_iaoq_b); copy_iaoq_entry(ctx, cpu_iaoq_b, ctx->iaoq_n, ctx->iaoq_n_var); #ifndef CONFIG_USER_ONLY tcg_gen_mov_i64(cpu_iasq_f, cpu_iasq_b); @@ -4228,7 +4237,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) ? DISAS_EXIT : DISAS_IAQ_N_UPDATED); } else if (ctx->iaoq_b == -1) { - tcg_gen_mov_reg(cpu_iaoq_b, ctx->iaoq_n_var); + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, ctx->iaoq_n_var); } break; From patchwork Thu Nov 2 01:29: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: 740344 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593680wrv; Wed, 1 Nov 2023 18:32:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtd5DVE/N0FZ0xKOv58+XG0ERxTLWpye75UXbyqtWJjHvCpTyxN/rD5PIUxOOasTV4yE94 X-Received: by 2002:a05:620a:51d2:b0:767:e993:5702 with SMTP id cx18-20020a05620a51d200b00767e9935702mr16365076qkb.35.1698888758390; Wed, 01 Nov 2023 18:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888758; cv=none; d=google.com; s=arc-20160816; b=qlNfZvgUHWRscUrBH4TbCpA3poNisaWqmVOzSwuih/hHAGu76sIfveBS0glRRuyrs1 Rs8UHcONcgrYT6geKK1qVvBfN+cU6dENM7YgQ3ezje6ye0meM7czLiGB44ZoWs3U0bEd aOvVL0pLc/KrQ5SwvUasMTyiDN8ixNvzZbqQY1Bpr8s91CYkqLeGiSJ5TMMXC0j34VaI I/JYBL1hQkPLrgjPkSz+yeOAqXrSCQUC4VfwidUuvS/7Ii8GQFSURJdiSqokktnppajU E8MCrFnjpwrzSZEIInO78QxGY8t1iUiIHTp1S5WsLrhqNHGVTpKeVQNgeiCzHPRT8ZMc /EFQ== 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=nte4AsF0yU49KoFZ5WsKrCyyvXp9Hm4i6B93/Stt4MI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=1FISHpFjOluO9I4nELOb0YhvOITkOIEA1cs2Gc0cLYFuPTT1Ie7RmgHTCz45BvD5hu +FA+1ygYBTXGzh7Q+XXtWAQMzTlfI8eEEtzi2l0By8SSyV+AYRhIyB+xIvLvRD4qxaqd Dz4cG6MvXRNLUC6paMwHpkfgvVpenyrzVqkp+7WsyDPtjdBxelpxmSgnAN4+81zUKHq4 94jkyw/kigjtIaNvZ+iFQ+r4x2PegHBywB+y3/Y4YDZNpuhFpXTsJ7BE+oRq1r+HfygR QbJd1MVzo+yJEhyTYRoUctfZtkTGMLpuWYmQY4eKhLsG+iJFl10J3iVpo08QIoYig/Bk FaJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t74CW5XJ; 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 dl6-20020a05620a1d0600b00773a23eb2a8si3601956qkb.671.2023.11.01.18.32.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:38 -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=t74CW5XJ; 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 1qyMYP-0005ww-6j; Wed, 01 Nov 2023 21:31:25 -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 1qyMXq-0005nB-QH for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:50 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXm-0001d4-2P for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:50 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso500238b3a.2 for ; Wed, 01 Nov 2023 18:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888644; x=1699493444; 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=nte4AsF0yU49KoFZ5WsKrCyyvXp9Hm4i6B93/Stt4MI=; b=t74CW5XJVVNILjGbhgKul5NCO117c2wmycQ2xuO5E1Qy3ksV8FwjyphQ1N9yqBuuN6 Ms1A8TrIkN3ZdVnUt8JQEzwOulRS9D4hp9KpAbdOSuewXINwQeEcQde6CY/fmsEd9ZNs 0Dz2ZeI412uA49SBvnMHcA3J6D3dPfaA3/GcNyrzFWyTWbVEATbQ1S12ynlT5ndkBATm ts4bH/N6+5CVbTe+Bv5RRMQAW+qxvtTn1sR7Sll84+SZ8vG8u+jWwESsPrdqmb8NIeGt 3AQJlv7ynMgoPlh3WsFyNfYualJlVe04fPbwri+8GfbKpa5gM18EBjUbMM6DwpsfvCCe cafw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888644; x=1699493444; 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=nte4AsF0yU49KoFZ5WsKrCyyvXp9Hm4i6B93/Stt4MI=; b=QR7tq+4lg9EHXXh7xblF1H1KnvjkwQQ6NI58Nbh3idFKd+rO272ayIa2E4LOr1pGJ9 fzA+cjSBvaPtspMvcOb8OmtniyVjgtuMX2rStkmkkvoFtfzoP50Vm2VyYJOz2lyVdDdb oQHPSsUbpa/icRhf0OynxJg+NA95goncTWbDjbXSUhgiCi/W5j8kPADZBgxjzlyic9Xx zrw2nCmwTxTKoMvsduOhX641VcJ/cs6BKIkyn3KI3kxBt1u5lUx6ImwW4yNpgAmFQkeQ UFC+Q7kbaKr9PEk6jA5q337Z34Dy1vr1sSLQkc5VrfnMyXrXT/x5PztC/y3Vs0fp7cOa cG3Q== X-Gm-Message-State: AOJu0Yypo7R23yPD/uPqqB/9GMUYlW30Q1/dn2NeoyGVXnUg34MDFG6q 4saM1fMqVsBuV5GIkTI9SnCIyvjvJA/+25K09Es= X-Received: by 2002:a05:6a00:856:b0:6be:23dd:d62c with SMTP id q22-20020a056a00085600b006be23ddd62cmr21950112pfk.2.1698888644583; Wed, 01 Nov 2023 18:30:44 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 29/88] target/hppa: Use copy_iaoq_entry for link in do_ibranch Date: Wed, 1 Nov 2023 18:29:17 -0700 Message-Id: <20231102013016.369010-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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 We need to make sure the link is masked properly along the use_nullify_skip path. The other three settings of a link register already use this. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 348fdb75e5..c2db2782f4 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1898,7 +1898,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, nullify_over(ctx); if (link != 0) { - tcg_gen_movi_reg(cpu_gr[link], ctx->iaoq_n); + copy_iaoq_entry(ctx, cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } tcg_gen_lookup_and_goto_ptr(); return nullify_end(ctx); From patchwork Thu Nov 2 01:29:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740360 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594664wrv; Wed, 1 Nov 2023 18:36:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsZZriU0M2A2qn2zo/VXWrhhThcgxNVqdUkBj5YihAZMzao/1eMaoGKtX/ckcEfTtjkVUr X-Received: by 2002:a0c:8c81:0:b0:66d:5b50:1056 with SMTP id p1-20020a0c8c81000000b0066d5b501056mr15709253qvb.18.1698888961107; Wed, 01 Nov 2023 18:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888961; cv=none; d=google.com; s=arc-20160816; b=zFunBehLnl9DFCBIuQXV7MXwmoo4It1RplLxSBkCa+d/mf1X+pfZhJcEJKz/5VLUWi BErUC9DUZH6p1ZtQyeL2tXjMQhH63W26i1b67o+SPNymtyVJGxtHamTaLPc1MKP/I61e O7dIcwbU1KAIlnlfYeDsB10OraHiJoicBr7/xga+8WL6Y+LHqfVFBrXZHOQ4qcOk0l8B WARyOVmgfY04gKpuBo2RFYq6Dj1kPhi0LFM2UKTFvTd7VfSBiIbHfpkRUgvG50RfMLuP RDiYq9BNtpig1WxP9ncQ2RtUD2VqCd/031Mw4T0lMCLW1ZM40ti5IZ1Sy+PQjxUldbRh Qh8A== 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=KL35RIOske5ZEwNLa4RVHtpQpzTuLRW6sfRRvrTR5m0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=t5Nfi47s6Oiaaea5uB6uFyAnjUxUC6fDAEeHV8jCPQcei5K8LI20nYTSekA9QlrUWj ZEpZdjjZ8TjwTUJacpup9ic9pJmXdf9KXbrNJCqEGTBgcmsdOwrsWq2DRxS7lYrI8/B/ eOj+baJYbumMYKmlrP1jQr1OumIsmYHoMcEH2A49kLmeW+rexhWCnE+CxTk8BvZfY9vP ZioVEdQrlHMwS/F21oojBofXyW6CS6/DUCXMxTexWWsfde2uMDm3+HgLOG8TMDZRHwfR 3pX6zjWqBf9FU/Qq6JhHsv/Z2dcJdAOYtB2SBk2ZQfegmRIjeRwwR+ThAePb1/pd1KXS mDrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TeF7SY4U; 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 c9-20020a0ce649000000b006754071689fsi3066850qvn.433.2023.11.01.18.36.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:36:01 -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=TeF7SY4U; 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 1qyMYK-0005qM-9r; Wed, 01 Nov 2023 21:31:20 -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 1qyMXp-0005lY-FB for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:49 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXn-0001dE-D3 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:49 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6be1bc5aa1cso487528b3a.3 for ; Wed, 01 Nov 2023 18:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888646; x=1699493446; 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=KL35RIOske5ZEwNLa4RVHtpQpzTuLRW6sfRRvrTR5m0=; b=TeF7SY4U12yNB5rKhwhDmYopqEKzq3xszeWHUB3I7ByFPg3WSbmrBqCBot5MHvRNOW J16/nCp/l69WPL0dFNDp/iG81hR3qzFfUupvnCvy2kw4V3rdVwoNcoqaMGrDEZu2OhlI RCjO/LEc6ubW7hW2sot6j5epvguIKD6LMvXOX27mHUW2ZAOxy21V6KVllESGPge+P5TQ z1B0q2fBjtmWgpbTf5SLflDMRUMa7NZ2f3t+jF2vE3xv8p1/7DJVeiENbh5YYr3gsU81 1KtyHs7MIWe02LxdIzjIWuGlRmZZrc60IS0pRIaRU9nW6Coo+BA50bEK17xTPqEhULSI JyAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888646; x=1699493446; 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=KL35RIOske5ZEwNLa4RVHtpQpzTuLRW6sfRRvrTR5m0=; b=k+A01f9oQiF0JPgCoVLxeeJyz31HrOerYnHe+Iat6PAJuBiPBcL4HFkxAmdref/OJ9 q+Uz93ZiDunZTX4ax+fQpvsx1PFLaU6ghjYYO0WcljOuJEpHxuXy0PcBeyJ7tshw9GoX K/nhWuvN2fHNhcBhxZWOnpWDcc7GSZ42VC1NeJURf4dDZuNOJRQobx7xkrrLc6QfHTcK qpxfwBvgd8hOe0KdpIN2beVj8wmey0w32nhUmalz5QJ1ZZyTl4UjeeMQ7oI6IR2m00Bd qc8a4UidWdeWQs4JGITq2D+/krSQMWOGnx1yQFZgzsDFcCL1qOZH8PkWTmJAc0vydihq +s8w== X-Gm-Message-State: AOJu0YwhKO76r1brbZ8IrjkABGlvRy7IcAtf11qY716N5aaTCzpKq0Tk fWBkPru8R4vPLyZjGp9xCeVWPFlUV2H2IZWU01Q= X-Received: by 2002:a05:6a00:a27:b0:6b5:26ef:3261 with SMTP id p39-20020a056a000a2700b006b526ef3261mr20222904pfh.16.1698888645330; Wed, 01 Nov 2023 18:30:45 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 30/88] target/hppa: Mask inputs in copy_iaoq_entry Date: Wed, 1 Nov 2023 18:29:18 -0700 Message-Id: <20231102013016.369010-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Ensure that the destination is always a valid GVA offset. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c2db2782f4..cf05d8b6e4 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -720,10 +720,22 @@ static target_ureg gva_offset_mask(DisasContext *ctx) static void copy_iaoq_entry(DisasContext *ctx, TCGv_reg dest, target_ureg ival, TCGv_reg vval) { - if (unlikely(ival == -1)) { + target_ureg mask = gva_offset_mask(ctx); + + if (ival != -1) { + tcg_gen_movi_reg(dest, ival & mask); + return; + } + tcg_debug_assert(vval != NULL); + + /* + * We know that the IAOQ is already properly masked. + * This optimization is primarily for "iaoq_f = iaoq_b". + */ + if (vval == cpu_iaoq_f || vval == cpu_iaoq_b) { tcg_gen_mov_reg(dest, vval); } else { - tcg_gen_movi_reg(dest, ival); + tcg_gen_andi_reg(dest, vval, mask); } } From patchwork Thu Nov 2 01:29:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740390 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595975wrv; Wed, 1 Nov 2023 18:41:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8wgc+WNBAcH95FAlC4O1TbZBsO1xjs4Eleqb5UM8l6TVhvcR3wjkAAa1PNhfSD51PWvpH X-Received: by 2002:a1f:f28f:0:b0:49a:b9ed:8c1f with SMTP id q137-20020a1ff28f000000b0049ab9ed8c1fmr12711713vkh.0.1698889262546; Wed, 01 Nov 2023 18:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889262; cv=none; d=google.com; s=arc-20160816; b=pX7QU/AqAzQLMnVwlH92InBJ8f/K9GHehJbUICv+K0WOpW8HL9Svk2E2g4U+RdNYAu fa26DRhpmms8LGPlbGyW66eQ08wToiBoohqoigCyr2aWsTzJ7TFwt/IlfMWVJiLOD0S1 Bc5+KvV30YcIlETy+82rjZ3evDCCg1GKNx93bk8v7my+uN0JgjObTlIuCB66yInqE6Rz q5WLSmPRnapBl8aeR9olaN5fDTSPL61BniNTtthBx+dBkjfzbE2RBwmhru5/qUfxKkqP EFdCJaKOvH3wz9H67sKwlEHGSHz8K8YrCyv0BN744Szi7Hdj/ATyZAAjU1XLKBUVJ+Ha cPtg== 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=TlmvaxlY9UgjcMmC1xCbzus1zwL6bLCGJMO5gWkqRLs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=eWinp1CixVY0sd/uKFw7oi3DVnMsNL9nm8E8i9kfVCvt5Julb94eZyRajIrN8TZCPM g5vg18gRSB5mhGc1Y2PkbGvzQyRxPgcb9/PQbZTgKUbN0/xaNkCp1IJV1vkTiIjOnN0u rT3pHM/uzXb+TiVT9UJvO3g8HBJaGvADJswVNFy6r6bYr4vSOoIXA/4KZ/r10kGzwn2c uoe7FkKwervI0nWQn//32ymrW6GC6bpw1N8AZLifeUSF9CHiZe5IpuD4M2vW20AnVx1k djx+WgI21njG/o1gYXHfKnvzeWiw3dFqJpmd8ovAlBocAYPRRMoCviI8dKLkQA0F4Bqt u/fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qiwUXYx/"; 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 sw6-20020a05620a4bc600b007758ffaef15si3310027qkn.522.2023.11.01.18.41.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:41:02 -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="qiwUXYx/"; 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 1qyMYP-00062W-KR; Wed, 01 Nov 2023 21:31:25 -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 1qyMXq-0005mi-9P for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:50 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXo-0001dO-4H for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:50 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso500265b3a.2 for ; Wed, 01 Nov 2023 18:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888647; x=1699493447; 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=TlmvaxlY9UgjcMmC1xCbzus1zwL6bLCGJMO5gWkqRLs=; b=qiwUXYx/W0Z13RljaDqgRYxfmufbNCF+bB7VIddFWrNptqda0sYxf0s/xrUxWko0nc iQC37zNUBZwQFUzAu2oViHvIEyeZCsscBtjQSUz3Iu9ZJN54ZZXxEVJL95f3ZP2rjsq9 c4jRyluifzeExS2zhHo3iLGJh7xCDDE1KKVKEgglh9ijx7JFISc/t6Q2LPtOsy2NGn6S rqVuap9OoHoGUzDrSvROC2+Spyt9DjCoj+1ploJCZ3OxwtI6/btEOmCxpGOo8jqDykk3 J5IsqyvNVRI9UBkjckykWJLhKvIgD94jLCNZzaRKzlMEw04QUaKcC8ArHa5F9sf/ctVG NtuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888647; x=1699493447; 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=TlmvaxlY9UgjcMmC1xCbzus1zwL6bLCGJMO5gWkqRLs=; b=O3cGKU45lIYYzrGk9B87GF6GrarR2PA97JbxGfP26GpgYGVq9OwZXJBoaxuQhK2wyh DSgLTORmLbi2/zV18xXx6lCwV7dUUslTefRl9HurZ+XEQR/MIw49CZQHQgQKtDOgirTL wr1Sb78E8yyUIvg9Y0UWYIzgjljIstNTtCuZMK6eb7f+Bo/r0GxizmalalWaj6v+STOS oDPkmabNAZWhXNLCRfS7Arywc1RbZrWVTHzws/MOY+jHsUM8zYZ/EYa2ZXMxlCQvQV3l ck278WmvxBSVSdNzDzeXLLR9MaVhSfbK7NZOq6UX2xxOz6EUcNRKxobKiw5LgtBQHC9x aiog== X-Gm-Message-State: AOJu0YzbcVVTMQOetQ8pbEIr4Md9gTr43BpVfFXCWvOIMi59+rcNJoI1 5gVvQUxMkkauJuQFleQ8nIwh42LA8cSuah4Wskk= X-Received: by 2002:a05:6a00:c82:b0:6bf:50df:2df5 with SMTP id a2-20020a056a000c8200b006bf50df2df5mr20242459pfv.13.1698888646711; Wed, 01 Nov 2023 18:30:46 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 31/88] target/hppa: sar register allows only 5 bits on 32-bit CPU Date: Wed, 1 Nov 2023 18:29:19 -0700 Message-Id: <20231102013016.369010-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller The sar shift amount register is limited to 5 bits when running a 32-bit CPU. Strip off the remaining bits. The interesting part is, that this register allows to detect at runtime if a physical CPU is capable to execute PA2.0 (64-bit) instructions. Signed-off-by: Helge Deller --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index cf05d8b6e4..1694b988ae 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2176,7 +2176,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) if (ctl == CR_SAR) { reg = load_gpr(ctx, a->r); tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, reg, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); @@ -2237,7 +2237,7 @@ static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) TCGv_reg tmp = tcg_temp_new(); tcg_gen_not_reg(tmp, load_gpr(ctx, a->r)); - tcg_gen_andi_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, tmp, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); From patchwork Thu Nov 2 01:29:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740338 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593500wrv; Wed, 1 Nov 2023 18:32:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2njTSjEWwzkuUwoaJ26nSWpHaUFLnADjqyqDU8Rf1F6WRlr5b+G7UkNLa/1p3Au+CPMCE X-Received: by 2002:ac8:5bc7:0:b0:418:1272:7c6e with SMTP id b7-20020ac85bc7000000b0041812727c6emr20795245qtb.7.1698888719930; Wed, 01 Nov 2023 18:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888719; cv=none; d=google.com; s=arc-20160816; b=N8ztrw+Hox2j8hmHL2FcDT591cQJUkZikt7vXQJZhW+o9LMzmtieIMbTYTZZNXJieA KBUckfo607Vc7Hg+h+uTw1IUAGH6nsonSoj9x4nuBRhPtmjBM/vu8cQ7ckh9zgW1A5PY 1WbAPBkdSCTRMm8C3lU3RZVaNAmfC9WPjFcK3tgL7gYi30CDVNziUYPpuX14Qw+z3t5R syJ2KeYWy2lEUOxDTbEB4Vnfa7AFlk+1fHZN+pTkKVyenI5rYCc+qQG3F6oiZGeOSRBU iuvR9CjOxV2pp3tCkbk0kOGqhgyIjm6GAr3PDvE6lhpl+dsKyqMGpul4Q+B4hklHv/Yg dzTw== 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=GfDw/bslcTiKaSPMMxqGxyDHw7Pd9QUFMroBjWabI5A=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=x1FWFTnaGowguJpyQNZrQd7G9UvH06iLYUsho+rLjtLeuZANH95AJJ9u42bkFqMHrx p+CIbyupTVr5ObiOzT07Y8m2NBIRvzotxficF+M2kuKw8lAK1O7p3RpzOoTmFFO4cnRS U1w7Z2XywNvK+zi9EhCBPn9yK979lMXMScwWu2u3IFAlfaovisfUNK1GyyztNcmppjYp W3w5GpC5OgyuXHkEiYRZcIs8Dg5X9fcZrWwhyGtzYERpk2Jss/ctbDEHBT2qXQzwpf2U mmTkg/FPgbkn3KrClzyL8al1jgapqsNPXenpYRHteIlZGJakpiy0+x9749QYW9Iq2x7f 7WuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qCBJUq/V"; 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 u11-20020a05622a17cb00b0041e3130cd0esi3312943qtk.236.2023.11.01.18.31.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:31:59 -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="qCBJUq/V"; 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 1qyMYK-0005rM-SZ; Wed, 01 Nov 2023 21:31:20 -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 1qyMXr-0005nP-7M for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:51 -0400 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXo-0001dY-TF for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:50 -0400 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1f055438492so14270fac.3 for ; Wed, 01 Nov 2023 18:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888647; x=1699493447; 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=GfDw/bslcTiKaSPMMxqGxyDHw7Pd9QUFMroBjWabI5A=; b=qCBJUq/Vj47Pdf8lUUps6qzw4l5aarQkxMQ1oempqVaP24J6kLsxUy/jMlLQI68sh/ ICFwy/tnDwW93qPiS4QjJf3KpqZITnypm8OcVK+eo/5N+3hDmrsJSUEjBkUVSqnfzRzW 9ALUlGMWOTPv3rk0DywBYykUwDpfjsRVbqdYd9HiTgXCrBRdWsJRYensKbAfTjhNao8O uZAmYr3x4NlUkSlieC34mifU4Qp1MIvHtSnrGiDLgfVspXWWxfnK7ezXdGuohWPsLGmH 3SZh5KelOcjpWOSx4OH/Hw7X2aUVtYdC5sC8P74MML6T3IN1EJimas0TqA/D2tHnjJiD IVMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888647; x=1699493447; 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=GfDw/bslcTiKaSPMMxqGxyDHw7Pd9QUFMroBjWabI5A=; b=QlZ275lQY5zYhlvo1dcPffKp7dFBFVXRbEnXOWic8KOk0AlamK0KCmjhoMRik6oazw gDF8hHb+sbP9QGmAbuObgvUo63uV6QlvzXi8V879VIi13MAfj61iD7UfGFvcL/SAQl1A E6tmw2LHOFoCjrxJd0JtcgRpIcxK/zJT2tjieLD/1sunnCZ5OrPmv3/GyfFD2GIMkorM 30vXwDN5F7XqhX5xn3lDBiADXOZKqv5kjliB/Sc3/0Fsq7YymVFXhxi59ik62ySh71s9 lNloI51Dgn/UM+tHNb4FzH6alfJbWlMnFL2m2jn1VZNmDcu9aqeIAgx5zffH+JxrCu/7 WUgA== X-Gm-Message-State: AOJu0YzcT/9pnPBgOzjyMc+5qnRXDxVBJtnj6+EcIMtJcwZM5d6TCowO V26VVK2C85ICY39m8hCBiOexokSsrvUx9fbgwQQ= X-Received: by 2002:a05:6870:b48f:b0:1e9:b0fa:de48 with SMTP id y15-20020a056870b48f00b001e9b0fade48mr21121198oap.47.1698888647525; Wed, 01 Nov 2023 18:30:47 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 32/88] target/hppa: Pass d to do_cond Date: Wed, 1 Nov 2023 18:29:20 -0700 Message-Id: <20231102013016.369010-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::33; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x33.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Hoist the resolution of d up one level above do_cond. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 82 +++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 28 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1694b988ae..7b0e48c42b 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -827,7 +827,7 @@ static bool cond_need_cb(int c) /* Need extensions from TCGv_i32 to TCGv_reg. */ static bool cond_need_ext(DisasContext *ctx, bool d) { - return TARGET_REGISTER_BITS == 64 && !d; + return TARGET_REGISTER_BITS == 64 && !(ctx->is_pa20 && d); } /* @@ -835,8 +835,8 @@ static bool cond_need_ext(DisasContext *ctx, bool d) * the Parisc 1.1 Architecture Reference Manual for details. */ -static DisasCond do_cond(unsigned cf, TCGv_reg res, - TCGv_reg cb_msb, TCGv_reg sv) +static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, + TCGv_reg res, TCGv_reg cb_msb, TCGv_reg sv) { DisasCond cond; TCGv_reg tmp; @@ -846,11 +846,19 @@ static DisasCond do_cond(unsigned cf, TCGv_reg res, cond = cond_make_f(); break; case 1: /* = / <> (Z / !Z) */ + if (cond_need_ext(ctx, d)) { + tmp = tcg_temp_new(); + tcg_gen_ext32u_reg(tmp, res); + res = tmp; + } cond = cond_make_0(TCG_COND_EQ, res); break; case 2: /* < / >= (N ^ V / !(N ^ V) */ tmp = tcg_temp_new(); tcg_gen_xor_reg(tmp, res, sv); + if (cond_need_ext(ctx, d)) { + tcg_gen_ext32s_reg(tmp, tmp); + } cond = cond_make_0_tmp(TCG_COND_LT, tmp); break; case 3: /* <= / > (N ^ V) | Z / !((N ^ V) | Z) */ @@ -865,20 +873,35 @@ static DisasCond do_cond(unsigned cf, TCGv_reg res, */ tmp = tcg_temp_new(); tcg_gen_eqv_reg(tmp, res, sv); - tcg_gen_sari_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); - tcg_gen_and_reg(tmp, tmp, res); + if (cond_need_ext(ctx, d)) { + tcg_gen_sextract_reg(tmp, tmp, 31, 1); + tcg_gen_and_reg(tmp, tmp, res); + tcg_gen_ext32u_reg(tmp, tmp); + } else { + tcg_gen_sari_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); + tcg_gen_and_reg(tmp, tmp, res); + } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; case 4: /* NUV / UV (!C / C) */ + /* Only bit 0 of cb_msb is ever set. */ cond = cond_make_0(TCG_COND_EQ, cb_msb); break; case 5: /* ZNV / VNZ (!C | Z / C & !Z) */ tmp = tcg_temp_new(); tcg_gen_neg_reg(tmp, cb_msb); tcg_gen_and_reg(tmp, tmp, res); + if (cond_need_ext(ctx, d)) { + tcg_gen_ext32u_reg(tmp, tmp); + } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; case 6: /* SV / NSV (V / !V) */ + if (cond_need_ext(ctx, d)) { + tmp = tcg_temp_new(); + tcg_gen_ext32s_reg(tmp, sv); + sv = tmp; + } cond = cond_make_0(TCG_COND_LT, sv); break; case 7: /* OD / EV */ @@ -900,10 +923,11 @@ static DisasCond do_cond(unsigned cf, TCGv_reg res, can use the inputs directly. This can allow other computation to be deleted as unused. */ -static DisasCond do_sub_cond(unsigned cf, TCGv_reg res, +static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, TCGv_reg res, TCGv_reg in1, TCGv_reg in2, TCGv_reg sv) { DisasCond cond; + bool d = false; switch (cf >> 1) { case 1: /* = / <> */ @@ -922,7 +946,7 @@ static DisasCond do_sub_cond(unsigned cf, TCGv_reg res, cond = cond_make(TCG_COND_LEU, in1, in2); break; default: - return do_cond(cf, res, NULL, sv); + return do_cond(ctx, cf, d, res, NULL, sv); } if (cf & 1) { cond.c = tcg_invert_cond(cond.c); @@ -940,8 +964,10 @@ static DisasCond do_sub_cond(unsigned cf, TCGv_reg res, * how cases c={2,3} are treated. */ -static DisasCond do_log_cond(unsigned cf, TCGv_reg res) +static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) { + bool d = false; + switch (cf) { case 0: /* never */ case 9: /* undef, C */ @@ -970,7 +996,7 @@ static DisasCond do_log_cond(unsigned cf, TCGv_reg res) case 14: /* OD */ case 15: /* EV */ - return do_cond(cf, res, NULL, NULL); + return do_cond(ctx, cf, d, res, NULL, NULL); default: g_assert_not_reached(); @@ -979,7 +1005,7 @@ static DisasCond do_log_cond(unsigned cf, TCGv_reg res) /* Similar, but for shift/extract/deposit conditions. */ -static DisasCond do_sed_cond(unsigned orig, TCGv_reg res) +static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) { unsigned c, f; @@ -992,7 +1018,7 @@ static DisasCond do_sed_cond(unsigned orig, TCGv_reg res) } f = (orig & 4) / 4; - return do_log_cond(c * 2 + f, res); + return do_log_cond(ctx, c * 2 + f, res); } /* Similar, but for unit conditions. */ @@ -1164,7 +1190,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Emit any conditional trap before any writeback. */ - cond = do_cond(cf, dest, cb_cond, sv); + cond = do_cond(ctx, cf, d, dest, cb_cond, sv); if (is_tc) { tmp = tcg_temp_new(); tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); @@ -1254,9 +1280,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Compute the condition. We cannot use the special case for borrow. */ if (!is_b) { - cond = do_sub_cond(cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); } else { - cond = do_cond(cf, dest, get_carry(ctx, d, cb, cb_msb), sv); + cond = do_cond(ctx, cf, d, dest, get_carry(ctx, d, cb, cb_msb), sv); } /* Emit any conditional trap before any writeback. */ @@ -1319,7 +1345,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Form the condition for the compare. */ - cond = do_sub_cond(cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); /* Clear. */ tcg_gen_movi_reg(dest, 0); @@ -1343,7 +1369,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (cf) { - ctx->null_cond = do_log_cond(cf, dest); + ctx->null_cond = do_log_cond(ctx, cf, dest); } } @@ -2817,7 +2843,7 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) /* ??? The lshift is supposed to contribute to overflow. */ sv = do_add_sv(ctx, dest, add1, add2); } - ctx->null_cond = do_cond(a->cf, dest, cout, sv); + ctx->null_cond = do_cond(ctx, a->cf, false, dest, cout, sv); } return nullify_end(ctx); @@ -3034,7 +3060,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_sub_sv(ctx, dest, in1, in2); } - cond = do_sub_cond(c * 2 + f, dest, in1, in2, sv); + cond = do_sub_cond(ctx, c * 2 + f, dest, in1, in2, sv); return do_cbranch(ctx, disp, n, &cond); } @@ -3078,7 +3104,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_add_sv(ctx, dest, in1, in2); } - cond = do_cond(c * 2 + f, dest, cb_cond, sv); + cond = do_cond(ctx, c * 2 + f, d, dest, cb_cond, sv); save_gpr(ctx, r, dest); return do_cbranch(ctx, disp, n, &cond); } @@ -3149,7 +3175,7 @@ static bool trans_movb(DisasContext *ctx, arg_movb *a) tcg_gen_mov_reg(dest, cpu_gr[a->r1]); } - cond = do_sed_cond(a->c, dest); + cond = do_sed_cond(ctx, a->c, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3163,7 +3189,7 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) dest = dest_gpr(ctx, a->r); tcg_gen_movi_reg(dest, a->i); - cond = do_sed_cond(a->c, dest); + cond = do_sed_cond(ctx, a->c, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3201,7 +3227,7 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3237,7 +3263,7 @@ static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3271,7 +3297,7 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3298,7 +3324,7 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3335,7 +3361,7 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3365,7 +3391,7 @@ static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3402,7 +3428,7 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (c) { - ctx->null_cond = do_sed_cond(c, dest); + ctx->null_cond = do_sed_cond(ctx, c, dest); } return nullify_end(ctx); } From patchwork Thu Nov 2 01:29:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740394 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596177wrv; Wed, 1 Nov 2023 18:41:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHr2mZn81gOYSwkfqyMwtXzpeNY5QQX5aVn4zWvpXz9yjZxiK+5CGAosGjxOic+s9h4QI94 X-Received: by 2002:a25:4192:0:b0:d9a:634e:5ad3 with SMTP id o140-20020a254192000000b00d9a634e5ad3mr16821932yba.13.1698889314496; Wed, 01 Nov 2023 18:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889314; cv=none; d=google.com; s=arc-20160816; b=YMQSMeXsIWGNK3ZxoGCRD+e8z9RuHUVJ7VZbb4wMWZeK7atZKxPAPZqBxiWxaCuTu+ jDiwSnlmtIhaxfVUj3IaH2F/BbbiWVLcCo5qw4l+rZB4K22Dj/zaBqgZUatZJKi/3Cga R4BZnuQOo2QD3EFLnogDW/9s73pIx6lwYbCWV+GSBbwJneN+/GWMN/l8ziNWBnJYpLvK SqlykkIhcIYONpuPYiqP1W3cnnxBfFtFYy1j2B2wnTNtyXJFrlObhnqO9vvrSW5Y9p84 tjZXsTUZopSLa9CNd9+Hx3nUyh0/m+mwIvGPeba8KzdI52nf8nG1InRqq3sv3KRYoazN 65ng== 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=Hr5vuZ68lJAyQU4cT2RqX4i7gNDgWOQDVCjFWr924pI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Hm5kOqY2mZSz02hOoqzyJ9BB51u5jkiYHAmB59VKQKeRzUlhNJTVZ686Jkwd0SfPXQ SXnGmvry02Bloe0hptqUuGaxeUdTIKN0GOmHP8OxozWS0NRpM0an5xgeGHYKsHwZpC/J EJQD5MChdKW5fKZduIQ7rIVbfEprknzpo9HPNf1/jDilWo9YnrFAkXIELn9tUnTTWjSB L6kCi5jLVZvqkhnxRAQIP4aiPcA2rYbc55Q6nn7jNHDXDNfRZVAf5zUO38K8xe/l+6vm e89kMFRb05Xflmc+cxpguajm1sq5LtIjFvIJT91PEkdWHxAhpbFUVV1YRQUD8G88qeVP tNZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BlGFREfz; 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 h7-20020a0ceec7000000b0066d132b1c94si3614764qvs.32.2023.11.01.18.41.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:41:54 -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=BlGFREfz; 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 1qyMYp-0006hd-Lz; Wed, 01 Nov 2023 21:31:51 -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 1qyMXr-0005nT-CH for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:51 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXp-0001dl-Iv for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:51 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so489085b3a.2 for ; Wed, 01 Nov 2023 18:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888648; x=1699493448; 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=Hr5vuZ68lJAyQU4cT2RqX4i7gNDgWOQDVCjFWr924pI=; b=BlGFREfzzhiSjOBOiiyAQSGv74H5Fee+XlNImF6OaaKIME8f2C4SQPswrzcthj5JNR kjdKVfG2u+xf2XZDxrAsKG5bObGbS/AWRwTvOgOQyJ6Ixeto2KhvlUH28Wgv6KGOmHMp /YEufXGkQCr6zHCkTVZuYLOoLxuYNt7j6ormmcE8HMbV/45H4tZXuiSsOL0WS0EtTv5I bvyryxgnqGaTR3Zr9CftyYSdOaqpKvQnSaFeVW7m08OYscB6GILNu1QQ6FmZAeQz8/o/ GoiypUJlIR6907dL13qoMrVEvWlcDl5ARGgE4mhf/YAyis+n5fvFEMhoE2FVEpL3hz7D TUcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888648; x=1699493448; 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=Hr5vuZ68lJAyQU4cT2RqX4i7gNDgWOQDVCjFWr924pI=; b=RF9jalMixen+ahi5OPOkWZ9okwoIZF1XhAVTFZUcXy5iEkfftmhfTViEyy70ETmqtQ n7HAikTY/1IqtRFNWwK9xutEFiqThWwf3e0YA71MwnW/5QldmX1lbqULCLujnWskOPEy 6sLlzrLhVdO9JBBiAHpgAtEy/QCMi/CksNfPgafCLX5FPtQgbspMlZJJI9nV/dvONx5T xN3s/zWF0pvdEwgUZADnxqzVaAwQvMo9OjwVoCFRgzHcFCIepB6e9JAVa0xKc1++0vFZ /8BjstueVmusNhr4TGLpFxl1ZsS+Ufan2vy9WtooXPx+F8nESlx93fn4POONphepXys/ IJRw== X-Gm-Message-State: AOJu0YymI/AdoNgU4LdMLFz3ryhC4Lv6RE8NL/LJAq0zG8Fl6cxyHMlJ G2XVMaXM9kSaUtoS6WiYalPiTrYVClm0xuTVv2k= X-Received: by 2002:a05:6a00:392a:b0:693:394f:5d99 with SMTP id fh42-20020a056a00392a00b00693394f5d99mr21194285pfb.8.1698888648160; Wed, 01 Nov 2023 18:30:48 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 33/88] target/hppa: Pass d to do_sub_cond Date: Wed, 1 Nov 2023 18:29:21 -0700 Message-Id: <20231102013016.369010-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Hoist the resolution of d up one level above do_sub_cond. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 77 ++++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 7b0e48c42b..72971097bb 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -446,12 +446,15 @@ static DisasCond cond_make_n(void) }; } -static DisasCond cond_make_0_tmp(TCGCond c, TCGv_reg a0) +static DisasCond cond_make_tmp(TCGCond c, TCGv_reg a0, TCGv_reg a1) { assert (c != TCG_COND_NEVER && c != TCG_COND_ALWAYS); - return (DisasCond){ - .c = c, .a0 = a0, .a1 = tcg_constant_reg(0) - }; + return (DisasCond){ .c = c, .a0 = a0, .a1 = a1 }; +} + +static DisasCond cond_make_0_tmp(TCGCond c, TCGv_reg a0) +{ + return cond_make_tmp(c, a0, tcg_constant_reg(0)); } static DisasCond cond_make_0(TCGCond c, TCGv_reg a0) @@ -463,15 +466,12 @@ static DisasCond cond_make_0(TCGCond c, TCGv_reg a0) static DisasCond cond_make(TCGCond c, TCGv_reg a0, TCGv_reg a1) { - DisasCond r = { .c = c }; + TCGv_reg t0 = tcg_temp_new(); + TCGv_reg t1 = tcg_temp_new(); - assert (c != TCG_COND_NEVER && c != TCG_COND_ALWAYS); - r.a0 = tcg_temp_new(); - tcg_gen_mov_reg(r.a0, a0); - r.a1 = tcg_temp_new(); - tcg_gen_mov_reg(r.a1, a1); - - return r; + tcg_gen_mov_reg(t0, a0); + tcg_gen_mov_reg(t1, a1); + return cond_make_tmp(c, t0, t1); } static void cond_free(DisasCond *cond) @@ -923,36 +923,55 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, can use the inputs directly. This can allow other computation to be deleted as unused. */ -static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2, TCGv_reg sv) +static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, + TCGv_reg res, TCGv_reg in1, + TCGv_reg in2, TCGv_reg sv) { - DisasCond cond; - bool d = false; + TCGCond tc; + bool ext_uns; switch (cf >> 1) { case 1: /* = / <> */ - cond = cond_make(TCG_COND_EQ, in1, in2); + tc = TCG_COND_EQ; + ext_uns = true; break; case 2: /* < / >= */ - cond = cond_make(TCG_COND_LT, in1, in2); + tc = TCG_COND_LT; + ext_uns = false; break; case 3: /* <= / > */ - cond = cond_make(TCG_COND_LE, in1, in2); + tc = TCG_COND_LE; + ext_uns = false; break; case 4: /* << / >>= */ - cond = cond_make(TCG_COND_LTU, in1, in2); + tc = TCG_COND_LTU; + ext_uns = true; break; case 5: /* <<= / >> */ - cond = cond_make(TCG_COND_LEU, in1, in2); + tc = TCG_COND_LEU; + ext_uns = true; break; default: return do_cond(ctx, cf, d, res, NULL, sv); } - if (cf & 1) { - cond.c = tcg_invert_cond(cond.c); - } - return cond; + if (cf & 1) { + tc = tcg_invert_cond(tc); + } + if (cond_need_ext(ctx, d)) { + TCGv_reg t1 = tcg_temp_new(); + TCGv_reg t2 = tcg_temp_new(); + + if (ext_uns) { + tcg_gen_ext32u_reg(t1, in1); + tcg_gen_ext32u_reg(t2, in2); + } else { + tcg_gen_ext32s_reg(t1, in1); + tcg_gen_ext32s_reg(t2, in2); + } + return cond_make_tmp(tc, t1, t2); + } + return cond_make(tc, in1, in2); } /* @@ -1280,7 +1299,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Compute the condition. We cannot use the special case for borrow. */ if (!is_b) { - cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, d, dest, in1, in2, sv); } else { cond = do_cond(ctx, cf, d, dest, get_carry(ctx, d, cb, cb_msb), sv); } @@ -1334,6 +1353,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, { TCGv_reg dest, sv; DisasCond cond; + bool d = false; dest = tcg_temp_new(); tcg_gen_sub_reg(dest, in1, in2); @@ -1345,7 +1365,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Form the condition for the compare. */ - cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, d, dest, in1, in2, sv); /* Clear. */ tcg_gen_movi_reg(dest, 0); @@ -3049,6 +3069,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, { TCGv_reg dest, in2, sv; DisasCond cond; + bool d = false; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); @@ -3060,7 +3081,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_sub_sv(ctx, dest, in1, in2); } - cond = do_sub_cond(ctx, c * 2 + f, dest, in1, in2, sv); + cond = do_sub_cond(ctx, c * 2 + f, d, dest, in1, in2, sv); return do_cbranch(ctx, disp, n, &cond); } From patchwork Thu Nov 2 01:29:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740383 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595417wrv; Wed, 1 Nov 2023 18:38:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGx46pBSMEDLlu7s75ZALNGs5E1/rd9xWu1YZDmAOqgKq0Gr93Y5VHUupM2wJCwyYxcVktj X-Received: by 2002:a81:8b45:0:b0:58c:b8b4:2785 with SMTP id e5-20020a818b45000000b0058cb8b42785mr16579136ywk.45.1698889136024; Wed, 01 Nov 2023 18:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889136; cv=none; d=google.com; s=arc-20160816; b=tZQ+XIZYDK3nMjEVkl8n7qj6mXwJxjKjFaEFj9YP7ePGafx6gkKgo4E1QEsEQ4TLmQ zvterQFllWdcCnbxTUx0GDP8BwR+oXzVAJM+RtBD6BqcccF1+ft3antOVySYaFQXgtYD un1n/tiCyoouFBDvkUngMyQ2ISwdFKLpJ1lhkprwIkAMObAm4JR+1ZzBVULo7OodgOFF LnkHnM0M05Md925d3QsLE0nUXC0TqnF2Fr/xK19+QtoFbbNhSuoCAXklVk2ig9WmEcuq cosZvCMyDEgvLa9PBIm0dlmMuv0CUFeiFk4v7ELOAwnq1aZMGzC2S5bGwYwSA7M4aIie ElSg== 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=LA/AGLVV6ssagQlxsZX0RjDd9+wOPDPuaHlRJKzssek=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=NQS21yHASJ5fPG/++DFRGghZdP4qkUaQF3pFFUNhalprakNUarxRrVUjQt455QyEWB 8a5jA+Q7lZ/hsaQ6OYB6aKqb2BbgQ8zmfUhJzG0i+cGuVCYIdJJ1f9dGvoDJbAOFx8Cp FLAJApIjbUrz/wTY0wO8sS4IXTZQtWdUVXCviQ5nkBWkD+j/GywTvbk2JR8fXFMfnuTx RCMnblJxcqnFh2NlXiuTC/CcP0sOeck+kQefy7XzV1GfGTMufiVSl5LMffwToaiG2jyt jxgT25nZ+qaUL2y2VGXFCTYmzZA99Q236rGIUfeKc7pBK3+n0SGWfFvoZBC0iJtf8/Me XSHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vxeCJdlo; 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 e11-20020a0cd64b000000b0066d1e8d7d7asi3558955qvj.191.2023.11.01.18.38.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:56 -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=vxeCJdlo; 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 1qyMYP-0005wu-6p; Wed, 01 Nov 2023 21:31:25 -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 1qyMXr-0005nh-NI for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:31:18 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXq-0001dt-1Z for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:51 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so489095b3a.2 for ; Wed, 01 Nov 2023 18:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888649; x=1699493449; 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=LA/AGLVV6ssagQlxsZX0RjDd9+wOPDPuaHlRJKzssek=; b=vxeCJdloKXNzHcCJlF/fmuJyx1PhUFPREEY1ogI+fokduzTDiFQxcUdZVDXr4cByET IapZt8gwxt+p0cRd3WejL+ErgRuOz8V4/HOEYUxeK6kh4vCZareSyYKgJRC0ZH2zodit pnt/FEinfMJ8zETRD+fKY+IIQjLMv3g7+BWjIMYM4CjEaUoM/kO+1pUQK1WYqbRvbF2q oztl5ehMK0N+DrwnbFVF/x3UxHTcpEIzZAU6efBQWe26pXLbUQmGVbRBNYxUI4yFnHsO meF26BZIlZSChlyAhjjoj1sft2W+kY8MCFmhOYusexkxpxFVCekNP306wVb4zE2x87Jp sSoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888649; x=1699493449; 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=LA/AGLVV6ssagQlxsZX0RjDd9+wOPDPuaHlRJKzssek=; b=REZKKUJvNpF5p2X5XelmL+luUQX0zhOM8XBX1/KzyQHkXyjUZlzCsuHyhgYLXkz/Jv v8QOTRHmZ9UN+QP1ZXDKw4I3HS9Ecnbb1wKG1Su9b1Kpvfc+cS+hWrKv+QZVAAge548L nHZwB2WMSYJP5E5hfgQlJ86GN4WfslW2AkbPPruox5YkQ5K7dHD5P0uGjHC/tgs6s3GI Rk6g0EkeJoh+FHOBg+byqfqZoGneSMtsbowidqVPOVwIcSjC328gUH0wRBODB7C+ypzP d1CJjz9GBIXocEHAreRMrcsfZr/N2XwoxBkfJA6h4EDukm6Z+F0uOl+hp3do/Y7BKr3l 9Fjw== X-Gm-Message-State: AOJu0YxIHnHlNFziF2Eid3Rruy/kN+UiMEMbp+iAyv9iSL+R8/cyTTUS dPO1TJwzGTY5JGpQWyeotS2dFilosxQQM2UqNeY= X-Received: by 2002:a05:6a00:994:b0:68a:5cf8:dac5 with SMTP id u20-20020a056a00099400b0068a5cf8dac5mr20505965pfg.22.1698888648787; Wed, 01 Nov 2023 18:30:48 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 34/88] target/hppa: Pass d to do_log_cond Date: Wed, 1 Nov 2023 18:29:22 -0700 Message-Id: <20231102013016.369010-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Hoist the resolution of d up one level above do_log_cond. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 48 ++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 72971097bb..ac7f1f048c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -983,9 +983,11 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, * how cases c={2,3} are treated. */ -static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) +static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, + TCGv_reg res) { - bool d = false; + TCGCond tc; + bool ext_uns; switch (cf) { case 0: /* never */ @@ -1001,17 +1003,29 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) return cond_make_t(); case 2: /* == */ - return cond_make_0(TCG_COND_EQ, res); + tc = TCG_COND_EQ; + ext_uns = true; + break; case 3: /* <> */ - return cond_make_0(TCG_COND_NE, res); + tc = TCG_COND_NE; + ext_uns = true; + break; case 4: /* < */ - return cond_make_0(TCG_COND_LT, res); + tc = TCG_COND_LT; + ext_uns = false; + break; case 5: /* >= */ - return cond_make_0(TCG_COND_GE, res); + tc = TCG_COND_GE; + ext_uns = false; + break; case 6: /* <= */ - return cond_make_0(TCG_COND_LE, res); + tc = TCG_COND_LE; + ext_uns = false; + break; case 7: /* > */ - return cond_make_0(TCG_COND_GT, res); + tc = TCG_COND_GT; + ext_uns = false; + break; case 14: /* OD */ case 15: /* EV */ @@ -1020,6 +1034,18 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) default: g_assert_not_reached(); } + + if (cond_need_ext(ctx, d)) { + TCGv_reg tmp = tcg_temp_new(); + + if (ext_uns) { + tcg_gen_ext32u_reg(tmp, res); + } else { + tcg_gen_ext32s_reg(tmp, res); + } + return cond_make_0_tmp(tc, tmp); + } + return cond_make_0(tc, res); } /* Similar, but for shift/extract/deposit conditions. */ @@ -1027,6 +1053,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) { unsigned c, f; + bool d = false; /* Convert the compressed condition codes to standard. 0-2 are the same as logicals (nv,<,<=), while 3 is OD. @@ -1037,7 +1064,7 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) } f = (orig & 4) / 4; - return do_log_cond(ctx, c * 2 + f, res); + return do_log_cond(ctx, c * 2 + f, d, res); } /* Similar, but for unit conditions. */ @@ -1381,6 +1408,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg dest = dest_gpr(ctx, rt); + bool d = false; /* Perform the operation, and writeback. */ fn(dest, in1, in2); @@ -1389,7 +1417,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (cf) { - ctx->null_cond = do_log_cond(ctx, cf, dest); + ctx->null_cond = do_log_cond(ctx, cf, d, dest); } } From patchwork Thu Nov 2 01:29:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740417 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597930wrv; Wed, 1 Nov 2023 18:48:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcUrl7yY/4ag/DoJJMDL1hG2CvBy/R1U/8RyS95A8S9qwoBCp0GEpqxR3wwH2rMlbDGDMQ X-Received: by 2002:a05:622a:20c:b0:41e:2816:ada5 with SMTP id b12-20020a05622a020c00b0041e2816ada5mr20574120qtx.41.1698889718730; Wed, 01 Nov 2023 18:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889718; cv=none; d=google.com; s=arc-20160816; b=ea1FljJK07HMOnEr9U3T4BCcN94VtLXPpuL2hnHJDRnrxp1nrLforxA59SO4c6TW+p v6i+OgtO7FK1IlZNh7MAbMFNS+zSmhw2JAeoY74KajpwfynnwaQk2LndzaYmpecK3/bN VRgGDoqwVHofl9wf6Xgiq/JKQt15+oGyCYsaAQZxRo1PVaoevrFreznIUk9ckbfI5WTI dVvDjjYRV9FXD/wDQXq9zsJsQwrLG2nahu1k+nnpXshZdPpQvm6K7HH2doZPGaopthGW 21NPVAssif2a5Cinz6ISj63tzg9iiW8fKn8PdOxVABtUUQE307+B4ARDp9UYIIKDxUCj flQw== 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=VaXliUFU7zxwYjzIKZW3FE6GrG46gQDaWnQhdZIDG68=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=dmBxVqkEuXs5vKq+4S4nyeYi4QhWeuDWVcjYP8ne1STh6mH6lflkfcKPhi+TWSaYWg NUy1na83sI6iENicms8tJvf0kz4RUhu+ZiYIzmGm2o5yztWgIWDxUpNTVh2RkIP9IF5x P76bIa453FHiMMmlMjQSbdEjUBbECa7awYELIMjvZdytBolNbXbuP4Msx3RNDeN26AEn sUfaPmSmwgJ739N/M0G5Q+t3QofqneeYTVeZvCRmJrfhK2LN3aeUCkOi24wbLdMX30dM HwPpoN8s1wz5T/mQEgCGYRE/Jox9yiyRNX/8isdp5ZYP7IBmEL1C79dxHhIQd0SqVHpz vT8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CteVYpe7; 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 y2-20020a05622a004200b0041cb66ed83bsi3509038qtw.238.2023.11.01.18.48.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:48:38 -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=CteVYpe7; 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 1qyMYo-0006U8-Co; Wed, 01 Nov 2023 21:31:50 -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 1qyMYH-0005os-TW for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:31:19 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXw-0001fi-FA for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:59 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6be1bc5aa1cso487657b3a.3 for ; Wed, 01 Nov 2023 18:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888654; x=1699493454; 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=VaXliUFU7zxwYjzIKZW3FE6GrG46gQDaWnQhdZIDG68=; b=CteVYpe73wrq96bw/uZzEMDz7LmFUnj4Gq6VBLk0EwNsTTGcx/IPgxJqZ/2WDUwXU3 U629pgQ/GyIFk1nT06i0TCiXLXTjh8GUNVn0MA2CVatAPfZpKKzCz8zQ1stlAh5w6KrG vtYGlpq4Ua5HiT/RAm7Loh14Zwrr8vIexpgBWHMXl2QNq54MlYCrN4Gj60+7SQGpi7cz LKQnMDBLR6Ny/m13PGMCka/VtBLdv/wJ3xIPJI2gYC0HNsmS1gvRTH4eUcpoINiv/MAw 3WajuOAzW5SEVeCHsYkUNIkR0fXPEWWZhuRDNyoGB8kNGkjglj/Iv3VyXU1LuQHFSnhl A7dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888654; x=1699493454; 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=VaXliUFU7zxwYjzIKZW3FE6GrG46gQDaWnQhdZIDG68=; b=bkXpUtugs3tnJP8frslPRSj2UuosbpQVXDRjA+46zovY6dWNLCxWCQK8IWGV7QbZXi E5J/ltKxdT/1FymJzgKo5ZlAPhHGjHC+7/jVH5zCw1Rs1RrOhKI0ojGOX7RVih0X9c+1 CyX0M6x7xUQDJ4TL4Y0FF9zddrX0hFLl2Nre/oiCPZ+g+7cYrC1THP7zeE1W4Eqf7rzn PyAyuFOpx+8jNV/QKpEVV70s8nNAr4iz/24ieRxsiqlO/D/+biH07qGZQQH4stUhKfiU hfNkox4dXegGBYf6OiIPaYm1lmoeSWT3GVbsNgX/xx1H55hbvL1ywGxj5iwosGqFR1QE SRSw== X-Gm-Message-State: AOJu0Yy9IjslnuRffDLMT7mzelfk9Cr9nVy6x9X1VPSkV47g3klu+C6G ONNt0E9EqZr9syLr0K72b01sWG882u8fvzW7kIw= X-Received: by 2002:a05:6a21:819e:b0:15e:7323:5c0f with SMTP id pd30-20020a056a21819e00b0015e73235c0fmr17973114pzb.16.1698888649492; Wed, 01 Nov 2023 18:30:49 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 35/88] target/hppa: Pass d to do_sed_cond Date: Wed, 1 Nov 2023 18:29:23 -0700 Message-Id: <20231102013016.369010-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Hoist the resolution of d up one level above do_sed_cond. The MOVB comparison and the existing shift/extract/deposit are all 32-bit. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ac7f1f048c..eb4605a9c7 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1050,10 +1050,10 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, /* Similar, but for shift/extract/deposit conditions. */ -static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) +static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, + TCGv_reg res) { unsigned c, f; - bool d = false; /* Convert the compressed condition codes to standard. 0-2 are the same as logicals (nv,<,<=), while 3 is OD. @@ -3224,7 +3224,8 @@ static bool trans_movb(DisasContext *ctx, arg_movb *a) tcg_gen_mov_reg(dest, cpu_gr[a->r1]); } - cond = do_sed_cond(ctx, a->c, dest); + /* All MOVB conditions are 32-bit. */ + cond = do_sed_cond(ctx, a->c, false, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3238,7 +3239,8 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) dest = dest_gpr(ctx, a->r); tcg_gen_movi_reg(dest, a->i); - cond = do_sed_cond(ctx, a->c, dest); + /* All MOVBI conditions are 32-bit. */ + cond = do_sed_cond(ctx, a->c, false, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3276,7 +3278,7 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3312,7 +3314,7 @@ static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3346,7 +3348,7 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3373,7 +3375,7 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3410,7 +3412,7 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3440,7 +3442,7 @@ static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3477,7 +3479,7 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (c) { - ctx->null_cond = do_sed_cond(ctx, c, dest); + ctx->null_cond = do_sed_cond(ctx, c, false, dest); } return nullify_end(ctx); } From patchwork Thu Nov 2 01:29:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740369 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595029wrv; Wed, 1 Nov 2023 18:37:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1t4EXacoemeWYHKxRM28i9PU0gvsA4jmBbOTbkYd7oJdJAnjmA01w5rZuhWae9aHktfDB X-Received: by 2002:a05:620a:3189:b0:77a:282:bfb2 with SMTP id bi9-20020a05620a318900b0077a0282bfb2mr20528695qkb.8.1698889050936; Wed, 01 Nov 2023 18:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889050; cv=none; d=google.com; s=arc-20160816; b=TzcV7zU3slny49p6QCVa+3pwFt2dGh8nUfxZ7GPiorzpPXcDsNPksR2Mrty2SNMakE PoSArChiB+E6hfSG+V5TZMKEUrTkA1trm2+1Y3Q6TaERE+LlZOo9V+gLACMemYFa04DJ z84VzqLnjn9/W2Fud5Q2WImDHPzQXlVS2tsM+06gKRkpO0Hqd0wHpvhgaAYPkfOs56lS qWWv+iNZ4vFvWIoBb1K/Y1suZm2ngjkB4ItPtF37LvPjoqJC9b0ldN+jJz65LmsP7rbJ ZTTkUl7P0SCVe6Gi5uP8sKU/yenk0p5dOHgqiyU3Xem8RwTrheoJfV9MKHTGJFD1vSEo Fkqg== 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=w81PJS53UwmAAbSwfGTJnD1xAO9wqXFrjFhUaqgumJk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=CBuve4HXuS6+zC1RFYu+4A4wSqH7ba1RbAKSo2EQBDiuTRBEIXNU2kZ50ll+nviAqi FG2g9qSCRbMzjcfutBiOF6fTkHCG8PZDYkUmqXKCAvoMLfr4izOshWGOt6m3pPw0X0jX FCHaiGYUOvbrTsL4O3uPgdEak6eh3yshimXOB+04/cHG/rxJcmqqehknv0cxhaPDZpN/ Yj7o7paV+Qt4VcO47ClTtQxLtn1W1LYqxBmUegy4PI3tSUPyy5oUZ9qDzkw4zQ6lCb5K Nho3F73wb69Gz4jM9/po4dG4Iv/6Nlsa1iK3pfXZfjCzj7CvqOCfTn4ER9LjJhNTkbvJ xAOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hDd/8s9v"; 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 pa17-20020a05620a831100b0077a065c875csi3368487qkn.161.2023.11.01.18.37.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37:30 -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="hDd/8s9v"; 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 1qyMYQ-00066L-Bk; Wed, 01 Nov 2023 21:31:30 -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 1qyMXt-0005nu-EL for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:31:18 -0400 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXr-0001ed-DR for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:53 -0400 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6ce322b62aeso212108a34.3 for ; Wed, 01 Nov 2023 18:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888650; x=1699493450; 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=w81PJS53UwmAAbSwfGTJnD1xAO9wqXFrjFhUaqgumJk=; b=hDd/8s9vXaGaZ5Sv0AmNCx3wz5/Bg7TMqS9E6OHwn581buQBYFZsbCWWtycmIxBSP3 7TR48+qNNrw9vB+UuxFIF4mrHBr3E0NJLxNFeB0NvWdqPmzOf8sfxAKAFcErzGqSYPn8 uvDecz4eYddD8pAeVWLKjD5OGiOvt6DoGPupPY9UNIgTfTSGWTdBIzxgRjNrCtNpMITJ 67/atjgVnD3lFcUIm40SFZ/FGc0XnJhGdSoYqRuRoFjl9FBHIi8ieKzwwJT0KJNYtg3y rHw/UVBq+Narjey13SdBUhAJi0r5sBiI0wtqJsxHhKkzhq2dGSlSA6O1etcoiOpw1aJe RCPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888650; x=1699493450; 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=w81PJS53UwmAAbSwfGTJnD1xAO9wqXFrjFhUaqgumJk=; b=LGNaPNLRsZTD+DiBKRaNXkLJRhv+TugIbM5cQtX1KtYwjIC5VXRM+1+7D6HF1vTQ4M JCbU0TMYiyRS6c4reZBn4lb/HtYTzEw39mdoKiXvwjGbZgTZpBTOacA0D1wKtDrwqwhB w6jkN4MSA16E6VgXT3LiFUz7fJfrJKuUezRpFQ0a84SpwsPM7aOWdrZaKBzGS1/+4/2w vcYFU0yIjndEnlGgjwPKrsJZTwiAdmP4gcIqwCy3Hvi0rR0zMZ1IO+xlTbb/7Uvf70EQ vMIFYCqTwGgj2ri1UK6lAZ1Ia/GWxhcOCHUwLXROOYcRDw5R0IZ451ebHezFpe7rU/h+ XL+A== X-Gm-Message-State: AOJu0Yzpc4wleZtmQ1t5u2ZARct9s/98x/PLzc73bI1v1aNUm1CpsUoF f+zaXF5ajOTDGOm4AyvxeNu/DAMgE7UijXN23Q8= X-Received: by 2002:a05:6830:1d83:b0:6d3:1dc1:6ecc with SMTP id y3-20020a0568301d8300b006d31dc16eccmr3146138oti.19.1698888650315; Wed, 01 Nov 2023 18:30:50 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 36/88] target/hppa: Pass d to do_unit_cond Date: Wed, 1 Nov 2023 18:29:24 -0700 Message-Id: <20231102013016.369010-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Hoist the resolution of d up one level above do_unit_cond. All computations are logical, and are simplified by using a mask of the correct width, after which the result may be compared with zero. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index eb4605a9c7..41f4e06841 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1069,11 +1069,12 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, /* Similar, but for unit conditions. */ -static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, +static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) { DisasCond cond; TCGv_reg tmp, cb = NULL; + target_ureg d_repl = d ? 0x0000000100000001ull : 1; if (cf & 8) { /* Since we want to test lots of carry-out bits all at once, do not @@ -1100,32 +1101,32 @@ static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, 0x01010101u); + tcg_gen_subi_reg(tmp, res, d_repl * 0x01010101u); tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, 0x80808080u); + tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 3: /* SHZ / NHZ */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, 0x00010001u); + tcg_gen_subi_reg(tmp, res, d_repl * 0x00010001u); tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, 0x80008000u); + tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 4: /* SDC / NDC */ - tcg_gen_andi_reg(cb, cb, 0x88888888u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x88888888u); cond = cond_make_0(TCG_COND_NE, cb); break; case 6: /* SBC / NBC */ - tcg_gen_andi_reg(cb, cb, 0x80808080u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, cb); break; case 7: /* SHC / NHC */ - tcg_gen_andi_reg(cb, cb, 0x80008000u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, cb); break; @@ -1441,6 +1442,7 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, { TCGv_reg dest; DisasCond cond; + bool d = false; if (cf == 0) { dest = dest_gpr(ctx, rt); @@ -1451,7 +1453,7 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, dest = tcg_temp_new(); fn(dest, in1, in2); - cond = do_unit_cond(cf, dest, in1, in2); + cond = do_unit_cond(cf, d, dest, in1, in2); if (is_tc) { TCGv_reg tmp = tcg_temp_new(); From patchwork Thu Nov 2 01:29:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740358 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594601wrv; Wed, 1 Nov 2023 18:35:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFz2x8XUb9bJr/41DLUYM3M2Q059KiSImSGgawCiLgo45jA9zu7HX1erSsXOKJWxZJ9Y4zj X-Received: by 2002:a05:622a:4a:b0:41e:3dfd:82d1 with SMTP id y10-20020a05622a004a00b0041e3dfd82d1mr17954117qtw.52.1698888948669; Wed, 01 Nov 2023 18:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888948; cv=none; d=google.com; s=arc-20160816; b=iBSZt8tAG4E0M9Ybq/QdTLvfr7NhQbk0WyR3IWSU8fDmutFesUyv0ispsAMx4vIGW5 iz7pnTVmraSqZL/263t72A0OBCZjgLX84WfxTccsuhAz8JV2xL92Yy8mbtZY0OWt06/r d4LKl6QTsCZQ8yu70BLWn8zYFcYlCy+9xr/dI2PN4pwpDfmM2dRk6W1qBLVBSTa0mOvt 7naCT87yD6bxK3MA8QYNq/f1zVl29RrwUK8f5xsyGdp352mvDcZX3XWK3+asc42Hqyvk fKYoNJjWkTwui/8akD+5AgMPV4DpZnW60KeXiCiG1IxvhIZuHEEiOlp53+kNSNTcmmj+ qM4w== 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=3B5AGwWmkfcW3PKZyiJ5NeRwC9XFMc7EJS0UPbJQ5t0=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=aq6PG25PPLC2MJHSVeD89at0sLme6Bq/iFhmOEqpthckKxTt8wMhvIieDPWPOVhZnn rJD5i2mJnzyha1/HiC/dz2Nn/PnEWjWJowGRSILVpCA82ZPxkt8JagBHlOyTFlya4Uwr WxyYMAdl7DcZGAvKQGKG0S2RzjkLmxNQpgpUXfoN0QyT7Q1QnsdWq8G1pEsuJlABsOL8 g+S3Zwg9olbpNfg/hvHt2wrglAWgmtz0FvzCYXXIdJs9SFOg6PDW6jHz/JVxO+NbFqZQ 6VocxGUPSBoHa/1gaNgNbnsLvpYKidmvIayFIk0G5abg5m9/SIyZINjQPGz3G7izrOno wSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OnjQckTd; 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 s10-20020a05622a178a00b0040546c7b568si3606524qtk.152.2023.11.01.18.35.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:35:48 -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=OnjQckTd; 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 1qyMYr-00070b-Ny; Wed, 01 Nov 2023 21:31:53 -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 1qyMXu-0005nv-E8 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:31:19 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXs-0001f1-Uq for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:54 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5b9a453d3d3so334510a12.0 for ; Wed, 01 Nov 2023 18:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888651; x=1699493451; 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=3B5AGwWmkfcW3PKZyiJ5NeRwC9XFMc7EJS0UPbJQ5t0=; b=OnjQckTdpPDFM6w6umRkTbVNrEflA88mj5OprcflX0yLF50KwtZDwv6MtUrq9ipV03 Bnv7UNpNOp1WhiZmiItbfBCgq9o0CJhD1ST0rO3Am2z6yC1uwidczm9K7dM8zQwqYPBL f6/amKjiLiY1phwvcZZ/1h/6yszXVLKnuPLu0U+JyscrdQjllYaktByVZwKZbA7lpQv+ niYWxuPxUdK6yM6+mAnca7+1vlpsskqd9FO3s51hW6K14htk3o0LTGnXKgNsriUnHHKT OqQH+bS+FQuYGsyilEN+P1J39nPDlDuAWn6BB4f6bf/WuY2IsK3YbctXqRtJnB/gZ8pA LH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888651; x=1699493451; 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=3B5AGwWmkfcW3PKZyiJ5NeRwC9XFMc7EJS0UPbJQ5t0=; b=X/cykDmbu/DhnzTAeOSIPpQ7B4AKYwS4sw0fSpHLP9EYefXs/CsWQI5OQfmcgvBNlX f672YYj+86r+7r5+Lf/mOxkU5S0g7t2g9A+249z6JqFFBbEfaMNNSOwt9GtnX7oLrisY i6FK74WwGEFEd7z9da9Y98GczhE5FxWikH5BQgQWWbbJ3R5YeCHAtz2Bl7zyp8GqOXjs IS+j0Bhy0zdYFXAexYDqAl4VajwYq8yDXxEgH7EJQgUmdGpAQ6mIdPoS5R2bmUac7Vy9 W5PmxNVD6vfrGU4lMFOFTtmM+KR1kudcPJ+LiGwhLaQgWeDMSCyYVMXLzdW5GS/5LfMd noWA== X-Gm-Message-State: AOJu0YyAgKk1yWQKx0govVma44euj0TWe8rim2WYQX9UiUqtbbxHdEya cNBgSXTVmc4COXPPt8X1ukJ/AfmZKM4C0Ty+ZP0= X-Received: by 2002:a05:6a21:193:b0:15d:c274:2eb1 with SMTP id le19-20020a056a21019300b0015dc2742eb1mr19697154pzb.10.1698888651243; Wed, 01 Nov 2023 18:30:51 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 37/88] linux-user/hppa: Fixes for TARGET_ABI32 Date: Wed, 1 Nov 2023 18:29:25 -0700 Message-Id: <20231102013016.369010-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Avoid target_ulong and use abi_* types. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/hppa/signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/hppa/signal.c b/linux-user/hppa/signal.c index 17920e9ceb..d08a97dae6 100644 --- a/linux-user/hppa/signal.c +++ b/linux-user/hppa/signal.c @@ -86,7 +86,7 @@ static void setup_sigcontext(struct target_sigcontext *sc, CPUArchState *env) static void restore_sigcontext(CPUArchState *env, struct target_sigcontext *sc) { - target_ulong psw; + abi_ulong psw; int i; __get_user(psw, &sc->sc_gr[0]); @@ -150,10 +150,10 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, haddr = ka->_sa_handler; if (haddr & 2) { /* Function descriptor. */ - target_ulong *fdesc, dest; + abi_ptr *fdesc, dest; haddr &= -4; - fdesc = lock_user(VERIFY_READ, haddr, 2 * sizeof(target_ulong), 1); + fdesc = lock_user(VERIFY_READ, haddr, 2 * sizeof(abi_ptr), 1); if (!fdesc) { goto give_sigsegv; } From patchwork Thu Nov 2 01:29:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740413 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597714wrv; Wed, 1 Nov 2023 18:47:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+9/yfFBBbLcXWAaljIJFFdUuGkmOnwoYo6Bil0TyEwbZpoYpKPet6mUom2ODQ739LNW2F X-Received: by 2002:a05:620a:2456:b0:778:8da0:a6a2 with SMTP id h22-20020a05620a245600b007788da0a6a2mr18015504qkn.28.1698889667455; Wed, 01 Nov 2023 18:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889667; cv=none; d=google.com; s=arc-20160816; b=Sss9jq2ykWWnOP/+Tw38rusVhE19EBs46Taf/Z1kNmlIibRJiK6/W1WfXWu2rnaBDj TB3yMP9xS/jNoFjxR0gjwalkQFloJotcVOY46ifhrM4NQoohTdofNyqzvodnLlk9OOLy ji90jrcvGOCeKPXOqRrTxYRYBlpurFK2y43ID6UJI7/1Whb0GhXLO/wd/tPSRUjzdo3y d1UNjYXioSpD9hNqkzaEN6qRKzEO+fL1CWh4nm9irT2kbgBmoqvZrzLoWC5hnFrYSNzV I/k4kxHBLFmGyrWygP4EJECrQ4wwbnfFij8BLmgRAze7EqIllUSKp16gB5NdtYHAuWvf Vogg== 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=fDB1iCB7dFrTdi+sskzC1+DL914HNFrtvGBOgbigGUk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=eXam8xkRpjB+hUG+8lxzD9H6CvHl+lS8b6EPeDwaFttiHhzTK5IDq2devG/T97VjsD tcibWOeUkYymyVm0mWt3kRDk4If2Cmtykd/mV6TM/Mvo07/cxpLYkq06MBdpnJgA2mse 11fLlyNStVnfH3FJ7HwXJC9RrgbPr7nmdCRm+RIB7hJGVcgKFIogEas35P3bMXty5wxV 2MxXFNdLfUSckjqG+NXg/qOjIMFbSyRl8QJbx5Y4LL+C5xt5F0aIJlr8017kRICGcsbJ YcBTv5BWs1nlNvWdSBgBh103F4RW0Mk9FJoXlNkW35/DVOaDhZspfNKQnUmfsUuN887/ YT0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gSYb3sGU; 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 u16-20020a05620a121000b0076f0cc82e44si3451376qkj.718.2023.11.01.18.47.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:47:47 -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=gSYb3sGU; 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 1qyMYo-0006ax-Rw; Wed, 01 Nov 2023 21:31:50 -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 1qyMXu-0005ny-K1 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:31:19 -0400 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXs-0001f3-WB for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:54 -0400 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b2b1af964dso269345b6e.1 for ; Wed, 01 Nov 2023 18:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888652; x=1699493452; 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=fDB1iCB7dFrTdi+sskzC1+DL914HNFrtvGBOgbigGUk=; b=gSYb3sGU6m6M81RMqcA0q4UVhaFwBGR4KMKlU0NT/aCp1J3OsbFHdwqhWw3DaNS8Mo 7qjMQs6EX2qLXZ5Gi+9HtnhEIu8/8UyXWfj2zMw6g0H8kB58H1rRvZR+rANdsXPAHlX1 PbydtCv+dFM+X3OUujpTwlRgko8UlmDyZ2CNWckKzTjb+1MxwYPUPbMXxxbUPxTKdvPi wJ51kpLnQM78woQio+q9gOhs0iew6+P4BbFJtHak2NKa9wCq+O96NnWP8SXR2/sYCeYu V0cXZGIO8UdKjOmyjwK4S2IBLaZWOlEHIDAOzPQ9nKtMzjlUjqLZ74nB7VXHS6yCxq9Z Ujpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888652; x=1699493452; 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=fDB1iCB7dFrTdi+sskzC1+DL914HNFrtvGBOgbigGUk=; b=Cc5yBSM19sa5gstztDIMjmbMSyVCvP9dgDIj6JIHpxyYVuWX3hyqLhTGcgSCrzK/tv 1/T73HVBcUR9AA6ktstuHJheFWbZ4FQgXOVoethfUVROxIWEzeZh8eKZzaeSWXhoexj3 lqagbwJBKEvg8FkbCZbDnMlHOdFH7try5zMsXXsGAOdMTiufjPybI0Dh3SS6dCBYaW5e Ca+pp+Jtl6YNw7IxfFkgQ/ukCQt+eNSJekRkJN/uIson1TfQxrHU3yKBqUVW3Wna7rvf 5R0TqlknvAE6zCRHBXhoFLm1ypig3latYpqXG6kcV1P2H6RrCWQ+ufEacqV+UDA4nrPS F2vg== X-Gm-Message-State: AOJu0YwEbXgaYiYMdouTtd8qFaYRedspLDKZTz4/r/TMaVhyYfVm/nGf 4rd5H3gQaX32vpGK/Ws2WGDGgwAF0YH3PRSoRrk= X-Received: by 2002:a05:6808:44:b0:3ad:ffa4:e003 with SMTP id v4-20020a056808004400b003adffa4e003mr19039829oic.33.1698888651965; Wed, 01 Nov 2023 18:30:51 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 38/88] target/hppa: Drop attempted gdbstub support for hppa64 Date: Wed, 1 Nov 2023 18:29:26 -0700 Message-Id: <20231102013016.369010-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.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, T_SCC_BODY_TEXT_LINE=-0.01 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 There is no support for hppa64 in gdb. Any attempt to provide the data for the larger hppa64 registers results in an error from gdb. Mask CR_SAR writes to the width of the register: 5 or 6 bits. Signed-off-by: Richard Henderson --- target/hppa/gdbstub.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/target/hppa/gdbstub.c b/target/hppa/gdbstub.c index 48a514384f..4a965b38d7 100644 --- a/target/hppa/gdbstub.c +++ b/target/hppa/gdbstub.c @@ -21,11 +21,16 @@ #include "cpu.h" #include "gdbstub/helpers.h" +/* + * GDB 15 only supports PA1.0 via the remote protocol, and ignores + * any provided xml. Which means that any attempt to provide more + * data results in "Remote 'g' packet reply is too long". + */ + int hppa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) { - HPPACPU *cpu = HPPA_CPU(cs); - CPUHPPAState *env = &cpu->env; - target_ureg val; + CPUHPPAState *env = cpu_env(cs); + uint32_t val; switch (n) { case 0: @@ -139,24 +144,13 @@ int hppa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) break; } - if (TARGET_REGISTER_BITS == 64) { - return gdb_get_reg64(mem_buf, val); - } else { - return gdb_get_reg32(mem_buf, val); - } + return gdb_get_reg32(mem_buf, val); } int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) { - HPPACPU *cpu = HPPA_CPU(cs); - CPUHPPAState *env = &cpu->env; - target_ureg val; - - if (TARGET_REGISTER_BITS == 64) { - val = ldq_p(mem_buf); - } else { - val = ldl_p(mem_buf); - } + CPUHPPAState *env = cpu_env(cs); + uint32_t val = ldl_p(mem_buf); switch (n) { case 0: @@ -166,7 +160,7 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->gr[n] = val; break; case 32: - env->cr[CR_SAR] = val; + env->cr[CR_SAR] = val & (hppa_is_pa20(env) ? 63 : 31); break; case 33: env->iaoq_f = val; @@ -278,5 +272,5 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) } break; } - return sizeof(target_ureg); + return 4; } From patchwork Thu Nov 2 01:29:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740384 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595421wrv; Wed, 1 Nov 2023 18:38:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1cIh3qU6yn23JqwEy4jnycmdb91Iq5dcqLTt7sIgXu/d3Gk5sES+b3M/Xzcq4fzIYnUlb X-Received: by 2002:a05:6214:f0b:b0:66d:5cfe:82a6 with SMTP id gw11-20020a0562140f0b00b0066d5cfe82a6mr13165881qvb.27.1698889136357; Wed, 01 Nov 2023 18:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889136; cv=none; d=google.com; s=arc-20160816; b=igfo/9YGEW51h1maxp4/pEp2MskpqcGu+Sk/nb/unEovaAVZRvpmEV0kAWa8+AY5q/ 9nFR+0UtvOcTHigCytEnwhwHZ0md9IGQ/D93rXotAf8H7coc0vSRPmtDB92sadNm7rqP NMdC2bhrWDA0udjkUHJYkPR1hwra+1iwbhY5avNODDMIbV/IdAtJVaEZKU9OZUUHTfdY n6Lhsm4XUbD5B0irE/ED6s4VaomIimIH0HvvegQ+W4pHvvzx/+hXqAEhuHezPVCvMNv5 Sx70vyIiXnqwNFijth15Uu3Rde/UScXgJq2LXTOdBGUUQLAl10J7mfRyasmp5emMuDht eLfA== 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=mF9dOeZxo2aOz0Qybb3Ky4+BLIWImu3Ncx4MvbmRDnU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=qXQA+Dfx2O4esSTS1wA65KdUb41kQGK0TBG24tLSdPZ6E0F1zRx6/wLrcdPNtLYUdu ekmN+eXnTRDFDdYy3Ui+MFZl8vV7frrFzTBFXQ/6av30SzWRvV8RgN+nDVLkDToSautv K97wT8w5ujEiwxL1lMgOLYj25PKlw02rnKdnDX5MVIlle00ymOtmwfa/VEV0scYPhs6g fzwBAADwNNjE2zYN8Jr+xVKL8W+ytsJjIZbXxq4G3pn8xv799fobMncgLHeJ3wO2W96h HvLTGXL649stMp1vy+CcfXGAfTlMPGCIxuh2f7xEt9X2TykWkOo/IT01Rv+hFb0JYFLB epkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kASNu/ZT"; 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 t19-20020a056214119300b0065b05c86102si3513769qvv.272.2023.11.01.18.38.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:56 -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="kASNu/ZT"; 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 1qyMYq-0006iX-0u; Wed, 01 Nov 2023 21:31:52 -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 1qyMXv-0005o0-M4 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:31:19 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXu-0001fD-1D for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:55 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6bd73395bceso407124b3a.0 for ; Wed, 01 Nov 2023 18:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888653; x=1699493453; 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=mF9dOeZxo2aOz0Qybb3Ky4+BLIWImu3Ncx4MvbmRDnU=; b=kASNu/ZTeckSFF/zlvi9DQHC2qzkN+GVx1AXUgt46pJnHnvUiRnOHiSlv3ZbdhbKLh /4ZAnJs3e7L7hDftnDZhwcfoYvKOVd19+bmp/Bmv2a+tMxfqhHnec6EsapB18ZOE4VYy zDrH7U/eWceg3wg3S4MD1JmNYEecKqRE0WXYRuKSwkgcAoyHstA1C2IkvlTU/l3TKxLu GDKWGdY9Kd5Vc5/lCOAwlv2Fm0xdpbrnaLiuPlVSd96MWq3VZw2az8KldQsxW7je10KG Kq4GyhoW9e7gkE5uzCi6h7wr5K+eVRjwsFSfCjdQwVToUMRa4i/Xuc6qVot0HQPJ/Wdc z4IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888653; x=1699493453; 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=mF9dOeZxo2aOz0Qybb3Ky4+BLIWImu3Ncx4MvbmRDnU=; b=SMpnEcmjkMUBsrsmcVtzB54yy2DQMwcqkR8kMQ1M4iomrSRz44da6NmflDBh9KHa4z hKzCIiQDe2N3c8qlhRyi6blWBihfYZe3lsyed39jOM/CPFKse2pjOa5xKvnGnlFVyrvx e5zn4kq30ofNRdtzbpyhQh4V2TMAAK85SarlbIbcpe98FvVYim7dKlsp/tvOgkjHQjrY +o16LX9NXzcSZNO4xbJS211ppLsXhIcH34A2RUwciNiAQeRlSsXa9DzMY1jxdJzCSy4m r92NR9RjgfMz06HDJ7gw1fUSFNgXB4e3i4NJ6R4MZLY5vmpIyVDHb8jObavr20cZOgbR kRog== X-Gm-Message-State: AOJu0Yzj4gvRFeAXiUX8CPOB4ljPKc5ds6EooK1OSMWhuo2kTwpbWEqq 8vkjej0irKXKFgWyGROv7x3AtbWrNh02bKig+gg= X-Received: by 2002:a05:6a00:1949:b0:68a:5cf8:dae4 with SMTP id s9-20020a056a00194900b0068a5cf8dae4mr10429269pfk.3.1698888652796; Wed, 01 Nov 2023 18:30:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 39/88] target/hppa: Remove TARGET_HPPA64 Date: Wed, 1 Nov 2023 18:29:27 -0700 Message-Id: <20231102013016.369010-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Allow both user-only and system mode to run pa2.0 cpus. Avoid creating a separate qemu-system-hppa64 binary; force the qemu-hppa binary to use TARGET_ABI32. Signed-off-by: Richard Henderson --- configs/targets/hppa-linux-user.mak | 1 + target/hppa/cpu-param.h | 23 +++++++---------------- target/hppa/cpu.h | 9 --------- target/hppa/cpu.c | 2 -- target/hppa/translate.c | 2 -- 5 files changed, 8 insertions(+), 29 deletions(-) diff --git a/configs/targets/hppa-linux-user.mak b/configs/targets/hppa-linux-user.mak index 361ea39d71..8e0a80492f 100644 --- a/configs/targets/hppa-linux-user.mak +++ b/configs/targets/hppa-linux-user.mak @@ -1,4 +1,5 @@ TARGET_ARCH=hppa +TARGET_ABI32=y TARGET_SYSTBL_ABI=common,32 TARGET_SYSTBL=syscall.tbl TARGET_BIG_ENDIAN=y diff --git a/target/hppa/cpu-param.h b/target/hppa/cpu-param.h index c2791ae5f2..2fb8e7924b 100644 --- a/target/hppa/cpu-param.h +++ b/target/hppa/cpu-param.h @@ -8,26 +8,17 @@ #ifndef HPPA_CPU_PARAM_H #define HPPA_CPU_PARAM_H -#ifdef TARGET_HPPA64 -# define TARGET_LONG_BITS 64 -# define TARGET_REGISTER_BITS 64 -# define TARGET_VIRT_ADDR_SPACE_BITS 64 -# define TARGET_PHYS_ADDR_SPACE_BITS 64 -#elif defined(CONFIG_USER_ONLY) -# define TARGET_LONG_BITS 32 -# define TARGET_REGISTER_BITS 32 +#define TARGET_LONG_BITS 64 +#define TARGET_REGISTER_BITS 64 + +#if defined(CONFIG_USER_ONLY) && defined(TARGET_ABI32) +# define TARGET_PHYS_ADDR_SPACE_BITS 32 # define TARGET_VIRT_ADDR_SPACE_BITS 32 -# define TARGET_PHYS_ADDR_SPACE_BITS 32 #else -/* - * In order to form the GVA from space:offset, - * we need a 64-bit virtual address space. - */ -# define TARGET_LONG_BITS 64 -# define TARGET_REGISTER_BITS 32 +# define TARGET_PHYS_ADDR_SPACE_BITS 64 # define TARGET_VIRT_ADDR_SPACE_BITS 64 -# define TARGET_PHYS_ADDR_SPACE_BITS 32 #endif + #define TARGET_PAGE_BITS 12 #endif diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index cb838defb0..77ddb20ac2 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -120,11 +120,7 @@ #define PSW_T 0x01000000 #define PSW_S 0x02000000 #define PSW_E 0x04000000 -#ifdef TARGET_HPPA64 #define PSW_W 0x08000000 /* PA2.0 only */ -#else -#define PSW_W 0 -#endif #define PSW_Z 0x40000000 /* PA1.x only */ #define PSW_Y 0x80000000 /* PA1.x only */ @@ -137,13 +133,8 @@ #define PSW_SM_P PSW_P #define PSW_SM_Q PSW_Q /* Enable Interrupt State Collection */ #define PSW_SM_R PSW_R /* Enable Recover Counter Trap */ -#ifdef TARGET_HPPA64 #define PSW_SM_E 0x100 #define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */ -#else -#define PSW_SM_E 0 -#define PSW_SM_W 0 -#endif #define CR_RC 0 #define CR_PID1 8 diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 70ce0c3b99..9582619be2 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -252,12 +252,10 @@ static const TypeInfo hppa_cpu_type_infos[] = { .class_size = sizeof(HPPACPUClass), .class_init = hppa_cpu_class_init, }, -#ifdef TARGET_HPPA64 { .name = TYPE_HPPA64_CPU, .parent = TYPE_HPPA_CPU, }, -#endif }; DEFINE_TYPES(hppa_cpu_type_infos) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 41f4e06841..187d47f4c3 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2177,7 +2177,6 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) switch (ctl) { case CR_SAR: -#ifdef TARGET_HPPA64 if (a->e == 0) { /* MFSAR without ,W masks low 5 bits. */ tmp = dest_gpr(ctx, rt); @@ -2185,7 +2184,6 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) save_gpr(ctx, rt, tmp); goto done; } -#endif save_gpr(ctx, rt, cpu_sar); goto done; case CR_IT: /* Interval Timer */ From patchwork Thu Nov 2 01:29:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740354 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594376wrv; Wed, 1 Nov 2023 18:35:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc8JUI3NVRtnMaLuXdYkQA+bgrc/V/UDN5FSFdnZkldAv7/GPxP86S+II1+hl81ZfWkYtT X-Received: by 2002:a05:6214:19c1:b0:66d:a1dd:22af with SMTP id j1-20020a05621419c100b0066da1dd22afmr23403162qvc.11.1698888908991; Wed, 01 Nov 2023 18:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888908; cv=none; d=google.com; s=arc-20160816; b=yqgTG1LiParta3yklrpz7U2MfBX05PMq6T9mTnyTiHTtphMV9qIBX6ovixrlqXsMZD 4Qk8f6L5vZz4444fDv3eTKN81vDJRrCXSauFaApK3h7o/MAD7TjQVa7xqoOVJT75dJfA N2UfMgruF9eR36zDSEfVFdVR5BkAH9tncohiXw4JjHylu2+Iqh7CwZMU46ridgWZqw3u mO55UB+mtSWqYD89hRdplmXNbfk8c3KkArnqPtX1Qqtg1IpqsqvurwbWNtdXQKOzYE/h 8l3RTgyfDns/hV3P80ApCFQj25jdfMqh28XQ/CSQo2Wa4tCjO8oJ/qp8h21aiHEK/kvl RYkA== 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=4omnBr4R3fX8NCviq/DiarTTVj7DsLckzrEJ1GuQtfo=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=onAF74VyLQy2kgUjF2B8oYwmtI7LDUDs9bKEuNDRF2+7HPOP0Pkg/dvZy/TMQdqRvW wFdC6D2UrGYagwF8LbL8pwnSsSpxqYiof0wPlVb/thW9lj48Bx8jK3j4+3PYyGrDwWnc dVN1jJr/+AsIWMrw791Td6ieICFDHSKtieUCPsvbVUpfDklf30dl0QdJFm8p1DdsHOuS m2koiEz55KGc8lQTAgASGr0mo/XLC8UjGF0AHP6b2BwrcbdVzenQRZQEQMZxQ9iSnYhQ xiWzdzaKp69e+uNERFWyMAmIQkdTuuktYwUGEuUVk9i3n54swcpbgUsAVJjnZEl7T1Jw nu+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fYaPXWqn; 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 d16-20020a056214185000b0063f7d73dd87si3644780qvy.584.2023.11.01.18.35.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:35:08 -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=fYaPXWqn; 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 1qyMau-0006Jk-NO; Wed, 01 Nov 2023 21:34:00 -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 1qyMas-0006FA-M4 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:33:58 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMaq-0001uN-79 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:33:57 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cc1e1e74beso3387135ad.1 for ; Wed, 01 Nov 2023 18:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888834; x=1699493634; 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=4omnBr4R3fX8NCviq/DiarTTVj7DsLckzrEJ1GuQtfo=; b=fYaPXWqnP6+CnNjMhKjFTuh9lXN+XL5QicoXN3kjRIXvj5fdkC0TY2xFucqEY9NS15 /xkrrEN8DY5PFDUAxRUouwdZDCpD/+qepSZ+4mNGersDLZ/PLLV5mN+R1nWO5Ki1ljZR +P2DNYaFpjPsC7SlXlCzyTMbuq1a2Pnks0I0o5b3sW4ag6s+IfHKmmXDO4UjZP2ha1QO 2704B17DiLegMCGCD3FFE7XL29E2xWxt79VxWq+kg4BSBygfYarzXRPQHrRi/9BwX52B pUl27g7jV4CVG8PwdfENnUYrpaXdhDUDGEzL8DqhMq6EDjP4mDPuDHTjzekm82OYEzFf bF0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888834; x=1699493634; 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=4omnBr4R3fX8NCviq/DiarTTVj7DsLckzrEJ1GuQtfo=; b=m4atGMFZ7bZAqOITFN4XtX+BJtTWRyVt3RVRYrDa9/X5y5evkXADI6JVOQj24f7qdt Ebgww7Mclr/Sfn4K4LRWG79mzJW1ATa66+PyUmPfCuRVHOPa9o3Ct6W/9+QYx6PUMeUP NCYGkkOiYT/xMBbssU0BxzN6cNNTijdjdLJ9yBtRJlvkRbdcu3MfsiX+BwapBSg3LCcd 97gts31WNAWADwKt0acqFlHNSJAzntxxX4E+LuCC8TlSsF9ntcy0lSgDDk1BTaAvj6LJ mn3LsTkDqGDrXw3+1CmwyhyShYaeFTpce+7HLuXQmlBLJRex93b2XAheYbH3/5baWMnh kXfQ== X-Gm-Message-State: AOJu0Yy1wvPvQcgU5jRNWEoxAl/fQCBDJzcBaMb19LkwDrqwWPaurFBE ollr6gEHezl/3mVOcP944Tk8HY6ZnmDc9aKEbVw= X-Received: by 2002:a17:903:2594:b0:1c6:117b:7086 with SMTP id jb20-20020a170903259400b001c6117b7086mr15205713plb.5.1698888834030; Wed, 01 Nov 2023 18:33:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 40/88] target/hppa: Decode d for logical instructions Date: Wed, 1 Nov 2023 18:29:28 -0700 Message-Id: <20231102013016.369010-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 10 ++++++---- target/hppa/translate.c | 15 +++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index aebe03ccfd..26ca9f1063 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -61,6 +61,7 @@ &rr_cf t r cf &rrr_cf t r1 r2 cf +&rrr_cf_d t r1 r2 cf d &rrr_cf_sh t r1 r2 cf sh &rri_cf t r i cf @@ -73,6 +74,7 @@ @rr_cf ...... r:5 ..... cf:4 ....... t:5 &rr_cf @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf +@rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d @rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh @rrr_cf_sh0 ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 @@ -150,10 +152,10 @@ lci 000001 ----- ----- -- 01001100 0 t:5 # Arith/Log #### -andcm 000010 ..... ..... .... 000000 - ..... @rrr_cf -and 000010 ..... ..... .... 001000 - ..... @rrr_cf -or 000010 ..... ..... .... 001001 - ..... @rrr_cf -xor 000010 ..... ..... .... 001010 0 ..... @rrr_cf +andcm 000010 ..... ..... .... 000000 . ..... @rrr_cf_d +and 000010 ..... ..... .... 001000 . ..... @rrr_cf_d +or 000010 ..... ..... .... 001001 . ..... @rrr_cf_d +xor 000010 ..... ..... .... 001010 . ..... @rrr_cf_d uxor 000010 ..... ..... .... 001110 0 ..... @rrr_cf ds 000010 ..... ..... .... 010001 0 ..... @rrr_cf cmpclr 000010 ..... ..... .... 100010 0 ..... @rrr_cf diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 187d47f4c3..227d59b263 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1405,11 +1405,10 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, } static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, + TCGv_reg in2, unsigned cf, bool d, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg dest = dest_gpr(ctx, rt); - bool d = false; /* Perform the operation, and writeback. */ fn(dest, in1, in2); @@ -1422,7 +1421,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, } } -static bool do_log_reg(DisasContext *ctx, arg_rrr_cf *a, +static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg tcg_r1, tcg_r2; @@ -1432,7 +1431,7 @@ static bool do_log_reg(DisasContext *ctx, arg_rrr_cf *a, } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_log(ctx, a->t, tcg_r1, tcg_r2, a->cf, fn); + do_log(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, fn); return nullify_end(ctx); } @@ -2693,17 +2692,17 @@ static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf *a) return do_sub_reg(ctx, a, true, true, false); } -static bool trans_andcm(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_andcm(DisasContext *ctx, arg_rrr_cf_d *a) { return do_log_reg(ctx, a, tcg_gen_andc_reg); } -static bool trans_and(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_and(DisasContext *ctx, arg_rrr_cf_d *a) { return do_log_reg(ctx, a, tcg_gen_and_reg); } -static bool trans_or(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) { if (a->cf == 0) { unsigned r2 = a->r2; @@ -2755,7 +2754,7 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf *a) return do_log_reg(ctx, a, tcg_gen_or_reg); } -static bool trans_xor(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_xor(DisasContext *ctx, arg_rrr_cf_d *a) { return do_log_reg(ctx, a, tcg_gen_xor_reg); } From patchwork Thu Nov 2 01:29:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740364 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594775wrv; Wed, 1 Nov 2023 18:36:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwp7jpgptY4H3T/aJy8jSydtzdxEHwr6yekfFcPLGnJzqmUnsH3QVXc9hr5sOE+XA9wL36 X-Received: by 2002:a05:6214:21e3:b0:66d:2eb6:f3f6 with SMTP id p3-20020a05621421e300b0066d2eb6f3f6mr17073192qvj.32.1698888984950; Wed, 01 Nov 2023 18:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888984; cv=none; d=google.com; s=arc-20160816; b=uEWKuj85FjFizVvl/SfGAGWmuob6GntH1PCgoQ/rEq2ylmueIzeqtb04lAg6xwX9px pofF5ZTmc9GN75YCG3cEPA8ZoydshjnF8L1sRuhdgdCRBsQGG90RcYMOdDqZRK7T3uqt LRyCHQFF1B8WkHSxhW1skf1pGaeYjDbt0hgVGrc78TD7CrIFkU9+6WL+eZU1yPn7M8zt Qjcc1QIzaF1JXPogxpJMs27j3h74I5+Uv1NugDFB0iAp1i4R6u5gueYUla3qavUkbOkS 64SIddXF6224/qF1BrbRYzaMVTz55QmerxSOMO7VoIaSnuO9C7vMo2MEOKGTB290fo2R /qSQ== 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=ZQfRGRQVyJPekW6ejX/CWdupdE4Dg4Nz+X0zThatbog=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=NUDyZaHyCXblnlyH9EFk56gXtHxn5yUtsyZArDodLj1u5y2mZ6bTfodZkCE3UrnXzE vHlQO/qjd82/skMtub3Yy/r/LVhsY4trcxbVaApwi51TfGVsondcqRgH8ParIjdU5f0y DwxSdf6HEVD6cm0LVXM1Y3BVyekq725YUb4EaLzgPAgJhv4anr9cU9yAXxR4gZ9omRhQ ooTWL+KNgST2514Bss1miOv4MsW4FjCXx7OgP5apnab3SLtTz2Dy6AO8g+6/2cPElR4B Rasou+v/fbnovAs/WvZMGGcLbXh4R0wJvs5xt9l+9L9GfbW22xvzDFapjBQhPZjVe6x/ 16sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YpiJnVtH; 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 d12-20020a05621416cc00b0066d02306e73si3521394qvz.169.2023.11.01.18.36.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:36:24 -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=YpiJnVtH; 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 1qyMau-0006K1-WC; Wed, 01 Nov 2023 21:34:01 -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 1qyMas-0006Gf-Vo for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:33:59 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMaq-0001uR-Lj for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:33:58 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-53fa455cd94so320825a12.2 for ; Wed, 01 Nov 2023 18:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888835; x=1699493635; 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=ZQfRGRQVyJPekW6ejX/CWdupdE4Dg4Nz+X0zThatbog=; b=YpiJnVtH1zSC4/diGZzMjvvHtakFeaLC0/mzUpRrmQa5FQm70TScs9wjNBvZYxXVon PTTP8NhE08HbwS7ymsocIHhKKMS9o4cpUGSe5rs11kfBL7Ecw4b7vEO8FTTBszxHqc0K 0EGuFmEjaAOuyls9tglQ3W3Dddmrgo9oPnLQx248rodApGd0gLk6HgOgkGRud0jDj3cT 81TolzIKsLmnwaLrirMvBJvKeYRiGl+TuJ0KhlQ0i5CQW1b5oseZDLittORaWUihQyBo cMmYcA+v2XD16GHPvFcHVUp4zJbZHzPXeJo68PmJr3D3TpMRo2tcVVtifOTmlJHfZOsg RRvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888835; x=1699493635; 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=ZQfRGRQVyJPekW6ejX/CWdupdE4Dg4Nz+X0zThatbog=; b=L9G6RuvHNjwA1UfFnlw6ZZC0/SgbSdDtzUrZ4euZS47CFFmfJLcFmTJ30JtjPWVpiN wOQWlZic5MQ/3udMWRLCDj2/5uu50f5+bJTurF6hHPvExuFe/FxpM/8bnQAQypumSAFy MynbM5XcNLDDmHu2BorUrCRNDc+L/u2PwF1+qu6IqTjlZhkf6g8kGM9P+4RKoQ2OmrD/ TZl/k576P0peh8mg+aqkqYBajV6a+PvULyGTf6qRkvvMXk8En8lC8AEDtnXIC6omOOT1 sbkKfrqy1RsDVlliip+56J38wJyhfKlQhQ3B5R0QO2pNl4pUt8mkoN9WMw4fsMH5iaWJ hW6w== X-Gm-Message-State: AOJu0YwNxav6hgpbOhhOpfEvNGcjwpYd8Kqn35jBOpZQkyTnOnlwNVyb qYHbYqkoXS6KX2bMncwPK0BZc4p+zKDsgJENCxE= X-Received: by 2002:a05:6a21:328c:b0:159:b4ba:a5bf with SMTP id yt12-20020a056a21328c00b00159b4baa5bfmr17855351pzb.13.1698888834845; Wed, 01 Nov 2023 18:33:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 41/88] target/hppa: Decode d for unit instructions Date: Wed, 1 Nov 2023 18:29:29 -0700 Message-Id: <20231102013016.369010-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 14 +++++++------- target/hppa/translate.c | 25 ++++++++++++------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 26ca9f1063..03b1a11cac 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -59,7 +59,7 @@ # All insns that need to form a virtual address should use this set. &ldst t b x disp sp m scale size -&rr_cf t r cf +&rr_cf_d t r cf d &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d &rrr_cf_sh t r1 r2 cf sh @@ -72,7 +72,7 @@ # Format definitions #### -@rr_cf ...... r:5 ..... cf:4 ....... t:5 &rr_cf +@rr_cf_d ...... r:5 ..... cf:4 ...... d:1 t:5 &rr_cf_d @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d @rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh @@ -156,13 +156,13 @@ andcm 000010 ..... ..... .... 000000 . ..... @rrr_cf_d and 000010 ..... ..... .... 001000 . ..... @rrr_cf_d or 000010 ..... ..... .... 001001 . ..... @rrr_cf_d xor 000010 ..... ..... .... 001010 . ..... @rrr_cf_d -uxor 000010 ..... ..... .... 001110 0 ..... @rrr_cf +uxor 000010 ..... ..... .... 001110 . ..... @rrr_cf_d ds 000010 ..... ..... .... 010001 0 ..... @rrr_cf cmpclr 000010 ..... ..... .... 100010 0 ..... @rrr_cf -uaddcm 000010 ..... ..... .... 100110 0 ..... @rrr_cf -uaddcm_tc 000010 ..... ..... .... 100111 0 ..... @rrr_cf -dcor 000010 ..... 00000 .... 101110 0 ..... @rr_cf -dcor_i 000010 ..... 00000 .... 101111 0 ..... @rr_cf +uaddcm 000010 ..... ..... .... 100110 . ..... @rrr_cf_d +uaddcm_tc 000010 ..... ..... .... 100111 . ..... @rrr_cf_d +dcor 000010 ..... 00000 .... 101110 . ..... @rr_cf_d +dcor_i 000010 ..... 00000 .... 101111 . ..... @rr_cf_d add 000010 ..... ..... .... 0110.. - ..... @rrr_cf_sh add_l 000010 ..... ..... .... 1010.. 0 ..... @rrr_cf_sh diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 227d59b263..a0785bb32c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1436,12 +1436,11 @@ static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, } static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool is_tc, + TCGv_reg in2, unsigned cf, bool d, bool is_tc, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg dest; DisasCond cond; - bool d = false; if (cf == 0) { dest = dest_gpr(ctx, rt); @@ -2772,7 +2771,7 @@ static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf *a) return nullify_end(ctx); } -static bool trans_uxor(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_uxor(DisasContext *ctx, arg_rrr_cf_d *a) { TCGv_reg tcg_r1, tcg_r2; @@ -2781,11 +2780,11 @@ static bool trans_uxor(DisasContext *ctx, arg_rrr_cf *a) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, false, tcg_gen_xor_reg); + do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, false, tcg_gen_xor_reg); return nullify_end(ctx); } -static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf *a, bool is_tc) +static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) { TCGv_reg tcg_r1, tcg_r2, tmp; @@ -2796,21 +2795,21 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf *a, bool is_tc) tcg_r2 = load_gpr(ctx, a->r2); tmp = tcg_temp_new(); tcg_gen_not_reg(tmp, tcg_r2); - do_unit(ctx, a->t, tcg_r1, tmp, a->cf, is_tc, tcg_gen_add_reg); + do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_reg); return nullify_end(ctx); } -static bool trans_uaddcm(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a) { return do_uaddcm(ctx, a, false); } -static bool trans_uaddcm_tc(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_uaddcm_tc(DisasContext *ctx, arg_rrr_cf_d *a) { return do_uaddcm(ctx, a, true); } -static bool do_dcor(DisasContext *ctx, arg_rr_cf *a, bool is_i) +static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) { TCGv_reg tmp; @@ -2821,19 +2820,19 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf *a, bool is_i) if (!is_i) { tcg_gen_not_reg(tmp, tmp); } - tcg_gen_andi_reg(tmp, tmp, 0x11111111); + tcg_gen_andi_reg(tmp, tmp, (target_ureg)0x1111111111111111ull); tcg_gen_muli_reg(tmp, tmp, 6); - do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, false, + do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, a->d, false, is_i ? tcg_gen_add_reg : tcg_gen_sub_reg); return nullify_end(ctx); } -static bool trans_dcor(DisasContext *ctx, arg_rr_cf *a) +static bool trans_dcor(DisasContext *ctx, arg_rr_cf_d *a) { return do_dcor(ctx, a, false); } -static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf *a) +static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf_d *a) { return do_dcor(ctx, a, true); } From patchwork Thu Nov 2 01:29:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740368 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595030wrv; Wed, 1 Nov 2023 18:37:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9wRPkm6a8MgYxg7FzLauClXwZ1PNhydJw/7ZIA55zSzJC4nLsj/6eIBDBi00xCKTtscDf X-Received: by 2002:a05:620a:1488:b0:76e:f73d:65ae with SMTP id w8-20020a05620a148800b0076ef73d65aemr5727120qkj.6.1698889050945; Wed, 01 Nov 2023 18:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889050; cv=none; d=google.com; s=arc-20160816; b=DeM2F/WCfF7/1YRfasGvjpNs5Xj0vWSenuAD1h2iB48gqh4uBizolvqCKiPP6Ke0bO 212Ax9BX953gEnnlWcWYVRz4cVSSpNFucrQx2uhbmUotR6HJgB+1raz+rt/dBbUC+yMs zuNue9vVUEtiI83Cgsr9NAWcasfVx4MtUWAg4BbZ8aiSfk5qbhgHZcao71GDb/boQOwZ IYsrwblF44H8uKbBtvvY+6nrpH8eSpta7UcvVOSud5LDq3Isc09iednFoTpPKDVnBJJr PiioOGbQh0uPqoy9EIwquFXxklcuj7AvvqprVIC8wuornYfZxu3UO2mFOzohlwkP551e Mmbw== 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=RQKqVWPtgxXGrzYjTuQHxTd6qyqCynIOEiRaLSJd7Dw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=NgnFutG1+UkqINxWjWZRG800d+Y0Q0nkuO5y4z2TzJeYkCmLal0c89yhWzZ0Rx3c8h Jf4Q273RxHfN8ctnmJkcazrEzHX/hb4YYrG0lA3qmP3XposllJ86QbICXAS96QroE4Ls GS3l3vOlX1BVaDc3ke1NaRdzQXDVLrCmUxWmldSRpseM6jSCbl0uILQfgt/96LZvHf0L kF3S7fd2lu8OmQfAlX+ZCXw0vgRdcCyVXPXcbVipDWLrNBT2pltMTtRcje5zsW/ryhFn R+8qpeTH9sPO5RZ2fA3WazW2LqvihL9k65zvu4MMVAypji9MbAFY7fxSxT1kriQDkGZC VmEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SsGvkUDv; 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 k22-20020a05620a415600b0077891ebc8d0si3773615qko.626.2023.11.01.18.37.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37:30 -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=SsGvkUDv; 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 1qyMb6-0006VD-BZ; Wed, 01 Nov 2023 21:34:13 -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 1qyMau-0006K6-Jt for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:00 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMar-0001uW-D4 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:00 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1cc30bf9e22so3685745ad.1 for ; Wed, 01 Nov 2023 18:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888836; x=1699493636; 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=RQKqVWPtgxXGrzYjTuQHxTd6qyqCynIOEiRaLSJd7Dw=; b=SsGvkUDv2Vp3254YMNwPHbQtqOenG/DnwtTl/gxfbdzIX90NGKjVIncn/t4j2g+w8A QGZW7B9ZUQbEInPEjh2737urDOKDcjNvBLiFlNCEQNt67wgx+8Nn0SzXi7twgMheNwvv sCuxlZ7fjIixv+DyrCs3JssYoFXTzJaCWLn2SO31WVBIyu7YVOBUvnIGi1avf4iv343n vmtbU0CWhE9JWPY2NxB4yF5rtNYdHqbsVwlPAhji26ESodqVNs+dIf0eUrDH4WM0F/Wu FCS6Mxw+/gqtfRRPlyzcEbkWvSRFza9BIYP7GKVuW3pjpizOcmV9mHqTlJk4XAs0Whlw 0WYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888836; x=1699493636; 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=RQKqVWPtgxXGrzYjTuQHxTd6qyqCynIOEiRaLSJd7Dw=; b=mgE+RUZpC/BffuYH/IkX5R2wK7/B5K/+c3cFrbEPYNTJOfeQFYXBSHPiJ4oKK+b9R/ f6fMXAAiFHdgmposjsYB3HjzdHKxVf++KnNXO2DA/VtHEOkALFQ9MAUIjlYcB+BNJ3bc yM0alS6HBdx8JfrrqzEVOQ3OaoP4aTtvSIKniY0F78L7zieEmYt8hMEyf3qW/gZmuKZ8 9PUbfkTb6IvGrGZj7ENwTjF8GNQ0NmY/2sXszIUNPf/LCOnGGtC0yAgFGiHdxgPi41Co NUI+wYPVEi3e8GLfoKwmqJvYZoZJRz7RsyU6mzaEBsJO9XRtDavZtPfqvLIPFbU4i7Dw edYg== X-Gm-Message-State: AOJu0YwVbsWqjvl0XIznxrz0J3U6DJgASxIw/MGbQ71Oj92MNLSR6fVH 96FdmQRZQQQmMqqMpWmjyimMWFt9KX4C8BQDnbA= X-Received: by 2002:a17:902:e848:b0:1c2:193e:1126 with SMTP id t8-20020a170902e84800b001c2193e1126mr9708350plg.28.1698888835765; Wed, 01 Nov 2023 18:33:55 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 42/88] target/hppa: Decode d for cmpclr instructions Date: Wed, 1 Nov 2023 18:29:30 -0700 Message-Id: <20231102013016.369010-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 6 ++++-- target/hppa/translate.c | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 03b1a11cac..d4a03b0299 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -64,6 +64,7 @@ &rrr_cf_d t r1 r2 cf d &rrr_cf_sh t r1 r2 cf sh &rri_cf t r i cf +&rri_cf_d t r i cf d &rrb_c_f disp n c f r1 r2 &rib_c_f disp n c f r i @@ -78,6 +79,7 @@ @rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh @rrr_cf_sh0 ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 +@rri_cf_d ...... r:5 t:5 cf:4 d:1 ........... &rri_cf_d i=%lowsign_11 @rrb_cf ...... r2:5 r1:5 c:3 ........... n:1 . \ &rrb_c_f disp=%assemble_12 @@ -158,7 +160,7 @@ or 000010 ..... ..... .... 001001 . ..... @rrr_cf_d xor 000010 ..... ..... .... 001010 . ..... @rrr_cf_d uxor 000010 ..... ..... .... 001110 . ..... @rrr_cf_d ds 000010 ..... ..... .... 010001 0 ..... @rrr_cf -cmpclr 000010 ..... ..... .... 100010 0 ..... @rrr_cf +cmpclr 000010 ..... ..... .... 100010 . ..... @rrr_cf_d uaddcm 000010 ..... ..... .... 100110 . ..... @rrr_cf_d uaddcm_tc 000010 ..... ..... .... 100111 . ..... @rrr_cf_d dcor 000010 ..... 00000 .... 101110 . ..... @rr_cf_d @@ -189,7 +191,7 @@ addi_tc_tsv 101100 ..... ..... .... 1 ........... @rri_cf subi 100101 ..... ..... .... 0 ........... @rri_cf subi_tsv 100101 ..... ..... .... 1 ........... @rri_cf -cmpiclr 100100 ..... ..... .... 0 ........... @rri_cf +cmpiclr 100100 ..... ..... .... . ........... @rri_cf_d #### # Index Mem diff --git a/target/hppa/translate.c b/target/hppa/translate.c index a0785bb32c..8301d007ff 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1377,11 +1377,10 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) } static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf) + TCGv_reg in2, unsigned cf, bool d) { TCGv_reg dest, sv; DisasCond cond; - bool d = false; dest = tcg_temp_new(); tcg_gen_sub_reg(dest, in1, in2); @@ -2758,7 +2757,7 @@ static bool trans_xor(DisasContext *ctx, arg_rrr_cf_d *a) return do_log_reg(ctx, a, tcg_gen_xor_reg); } -static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf_d *a) { TCGv_reg tcg_r1, tcg_r2; @@ -2767,7 +2766,7 @@ static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf *a) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_cmpclr(ctx, a->t, tcg_r1, tcg_r2, a->cf); + do_cmpclr(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d); return nullify_end(ctx); } @@ -2925,7 +2924,7 @@ static bool trans_subi_tsv(DisasContext *ctx, arg_rri_cf *a) return do_sub_imm(ctx, a, true); } -static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf *a) +static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) { TCGv_reg tcg_im, tcg_r2; @@ -2935,7 +2934,7 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf *a) tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); - do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf); + do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf, a->d); return nullify_end(ctx); } From patchwork Thu Nov 2 01:29:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740372 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595088wrv; Wed, 1 Nov 2023 18:37:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGS6RlNMv4FlD4DIWqG9fV0v42Di+yoTLd9Uflsr/HSfcXzFmNUiCAaKBG6mQ9TzwF5cZUz X-Received: by 2002:a05:6214:5289:b0:66d:2090:d22 with SMTP id kj9-20020a056214528900b0066d20900d22mr21181250qvb.35.1698889066078; Wed, 01 Nov 2023 18:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889066; cv=none; d=google.com; s=arc-20160816; b=NbKJjYia6pTwcYPWJtfyFBr+LQYT+V8u3wspeRLRTiROksm/keTZhBnxcAPzmpe7H0 be5rSzAq9Gjdwr/Xrcfs04jdaCYddhzAY/d1DDa6IlG2B10w9BoDD0YVJhzQ28zqLwvw ifsdAhlf9+UUo+avkVWdKF7LUt+0pI4GuebxoKqqzL2utUWd+L2ha7Mk81Ra9mgM01xT Smvud+Jx8/ImXC4xirnce8oq26ZkB3XIRQCvDgFQoPqdH3rt0JfcT2m7lqymff6Jm8g+ acNvnnZB6ZSuFdxZeDHTWN0Y6ihlxYFoYq7CYXsTkBEX2jf0RfVmJssXIsS9Xa5C6Vhm +MhA== 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=yLd8W3zal3J+slwE0L+I0m/NAcKeikLDIlYBd/HWxR0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=GzRBrugNnH+sfAfrKoMH3mfChFZKqF8JZIte6pk7M1ovYjFYa47af4j/e2JrvoUpvp 7s6En3lEvgBdEqrnHVSjswUrhwjm3m6x0eg7IY8KpgUaZYzdCNL/rXMcgDwAuDttQ7Vd 3mt2bT3lSqHC93mvd43Fz6DpLUbho8j2rDkbhlDpcK4kKnuIg2a480mwUDs0FAUPWMBv sicUZ5oO++BvFCh8xbHsFY6oebts2SGQdree3U+Tanuui2xG7z25Mo/PR7NNL2ymQhRm VYk/7dyRkOdwdHGXMFc9rw2m5YUodjblv3g0eySRDGSQNyfkostG3F6X+OGPJxGYwVLp zWOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wpALjXFn; 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 c1-20020a0ceb41000000b0066d110cd0a3si3563597qvq.375.2023.11.01.18.37.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37:46 -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=wpALjXFn; 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 1qyMaz-0006P0-7L; Wed, 01 Nov 2023 21:34:05 -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 1qyMau-0006K5-IX for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:00 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMas-0001ue-Fb for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:00 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cacde97002so3129145ad.2 for ; Wed, 01 Nov 2023 18:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888836; x=1699493636; 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=yLd8W3zal3J+slwE0L+I0m/NAcKeikLDIlYBd/HWxR0=; b=wpALjXFnp42Si7tKtYZZY5VDwqodObUyWdFmecX8iKygVnC6rw7xJbPiiAwzdjC7LL ZEOmNGRMJdVxnR78LjN7715dEyDXWzNsNnTX2/F1h3XRaNhzOonX0Zezz1S13fs9uKEc WF4nHhCQTXNW/EMUYGXCin6QjLvtH1wRaP4Sh1GITzfSxCr+j1FlH5VPo4yzjMp2eR/b WGbRGDUdXPkqywodOzjmmEaU+gy6br2Z12xo91NiZu6WJ8GlVPFo1crV59aifTH0o85p ndZnCGNhwfVE+0OnpC1eE2cYhJRSZcqs+WAQDavY0tJhN9ztAZC6ySevCONLow9Av0YL 9qQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888836; x=1699493636; 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=yLd8W3zal3J+slwE0L+I0m/NAcKeikLDIlYBd/HWxR0=; b=jKVGUKILaZW1UbCj27LYZgwNWthzIovV0dLJe9Xp3P7lyfYi3o6yMOO2rU1qj5p2v0 uZpc80EM/uDDrr6pxHbJu2YjyLHtbZJmvMM/NFQbyVgtwgyEkHgiKmHqSypuFtA7KeMX quelQzBOmv58emhglsphn8Kr2/FTAbTllkFLYlbp7vRawKuUXC8YOigdoppSVbWnUyDQ CArT3aB3ZHjka+4icLqYr58iXDmLv4y+2zEgP5nXT9Wf1LLPB7ABd0ua51UDhqunav7t IeL6499rVSf+4vsujIg0ck+M4Vlp91j4dmW67fRfyZyVjTGOnBl9JXwnmGGfS2+yBzz8 rtnw== X-Gm-Message-State: AOJu0Yzzvrp+Z7kGlQIhFnEILhExbSljlyHM3RoT+GJ8Bhq+PYr4pbwy GXda14swFaSyHwzqJiZqz/1gHH8V9OPyIGp74xY= X-Received: by 2002:a17:902:f28b:b0:1ca:8169:e853 with SMTP id k11-20020a170902f28b00b001ca8169e853mr12631480plc.4.1698888836481; Wed, 01 Nov 2023 18:33:56 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 43/88] target/hppa: Decode d for add instructions Date: Wed, 1 Nov 2023 18:29:31 -0700 Message-Id: <20231102013016.369010-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 16 ++++++++-------- target/hppa/translate.c | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index d4a03b0299..0f29869949 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -62,7 +62,7 @@ &rr_cf_d t r cf d &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d -&rrr_cf_sh t r1 r2 cf sh +&rrr_cf_d_sh t r1 r2 cf d sh &rri_cf t r i cf &rri_cf_d t r i cf d @@ -76,8 +76,8 @@ @rr_cf_d ...... r:5 ..... cf:4 ...... d:1 t:5 &rr_cf_d @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d -@rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh -@rrr_cf_sh0 ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf_sh sh=0 +@rrr_cf_d_sh ...... r2:5 r1:5 cf:4 .... sh:2 d:1 t:5 &rrr_cf_d_sh +@rrr_cf_d_sh0 ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 @rri_cf_d ...... r:5 t:5 cf:4 d:1 ........... &rri_cf_d i=%lowsign_11 @@ -166,11 +166,11 @@ uaddcm_tc 000010 ..... ..... .... 100111 . ..... @rrr_cf_d dcor 000010 ..... 00000 .... 101110 . ..... @rr_cf_d dcor_i 000010 ..... 00000 .... 101111 . ..... @rr_cf_d -add 000010 ..... ..... .... 0110.. - ..... @rrr_cf_sh -add_l 000010 ..... ..... .... 1010.. 0 ..... @rrr_cf_sh -add_tsv 000010 ..... ..... .... 1110.. 0 ..... @rrr_cf_sh -add_c 000010 ..... ..... .... 011100 0 ..... @rrr_cf_sh0 -add_c_tsv 000010 ..... ..... .... 111100 0 ..... @rrr_cf_sh0 +add 000010 ..... ..... .... 0110.. . ..... @rrr_cf_d_sh +add_l 000010 ..... ..... .... 1010.. . ..... @rrr_cf_d_sh +add_tsv 000010 ..... ..... .... 1110.. . ..... @rrr_cf_d_sh +add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 +add_c_tsv 000010 ..... ..... .... 111100 . ..... @rrr_cf_d_sh0 sub 000010 ..... ..... .... 010000 - ..... @rrr_cf sub_tsv 000010 ..... ..... .... 110000 0 ..... @rrr_cf diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 8301d007ff..2f5cc597ad 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1186,12 +1186,11 @@ static TCGv_reg do_sub_sv(DisasContext *ctx, TCGv_reg res, static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg in2, unsigned shift, bool is_l, - bool is_tsv, bool is_tc, bool is_c, unsigned cf) + bool is_tsv, bool is_tc, bool is_c, unsigned cf, bool d) { TCGv_reg dest, cb, cb_msb, cb_cond, sv, tmp; unsigned c = cf >> 1; DisasCond cond; - bool d = false; dest = tcg_temp_new(); cb = NULL; @@ -1256,7 +1255,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, ctx->null_cond = cond; } -static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_sh *a, +static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_d_sh *a, bool is_l, bool is_tsv, bool is_tc, bool is_c) { TCGv_reg tcg_r1, tcg_r2; @@ -1266,7 +1265,8 @@ static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_sh *a, } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_add(ctx, a->t, tcg_r1, tcg_r2, a->sh, is_l, is_tsv, is_tc, is_c, a->cf); + do_add(ctx, a->t, tcg_r1, tcg_r2, a->sh, is_l, + is_tsv, is_tc, is_c, a->cf, a->d); return nullify_end(ctx); } @@ -1280,7 +1280,8 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, } tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); - do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf); + /* All ADDI conditions are 32-bit. */ + do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf, false); return nullify_end(ctx); } @@ -2635,27 +2636,27 @@ static bool trans_lci(DisasContext *ctx, arg_lci *a) return true; } -static bool trans_add(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, false, false, false); } -static bool trans_add_l(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_l(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, true, false, false, false); } -static bool trans_add_tsv(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_tsv(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, true, false, false); } -static bool trans_add_c(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_c(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, false, false, true); } -static bool trans_add_c_tsv(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_c_tsv(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, true, false, true); } From patchwork Thu Nov 2 01:29:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740386 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595700wrv; Wed, 1 Nov 2023 18:40:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtlLu4zGQPdLmbPd8YBmnqXk5DVaOObukuv3uY+6vo0gdPWDOP3vkeWilFRu+oArmU3g1+ X-Received: by 2002:a05:620a:29c5:b0:776:fba6:da64 with SMTP id s5-20020a05620a29c500b00776fba6da64mr20505946qkp.22.1698889202476; Wed, 01 Nov 2023 18:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889202; cv=none; d=google.com; s=arc-20160816; b=bLbo1gSWjK2ykM5E2zYMwUqPQIFh7hpgJmD8vZGbIwfQebU3tbx6183UoCZF0WiAVi tOSAjpUkvY5nsZ9/HB7Cf7N2Fs7b2+7wtYOFPPtG9JdBLZRQH+s5LIk0NrBa47sqQlmx t/O1cGoi7o3bXogAQwzd7922kqA4e0zBWPb0sw9h442w4DLO1XvjlVwhxLc1DyQKBfD0 atF6JXsfpM4mFd8o5rUyoHcL2OyFK3hQR30L4ET9II5OHep4RKbFaR+whYTwrpgD36X6 v2NOnnnYc7T9XNz9OEwK1gYKIWHhBkX2w/FmF8go3fyU3PasA/g8HKVsjdtJjZvtCZoF hNEw== 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=we3IFCWv2xg8MNB7vl19STMFoB0LdqgzaOSIdpBMD+0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=sHKiYS7CWcYK81QbdT0f9OVKBttR5fQiv+SuLmvroe+9f9sUt/hoEl3iQwlVtQ/503 o5MJvlA4xHT+6stDVxFiHFe9oJkQsziv8s/KZKF/q4aqqNN6aY9LAL0FHPbXm+orKko4 96GdxuXMhaWO28lRoNkSK1xr1sMrkN5MY/nKco1ZjgWf9j7QGLLaa7bUC1FGdelDxjke 1MJvsYrgjVRhRjtIRO4zPPtvnOg8UU43Ii/1O4QXO70AnAflxs3HTiyv4ybzdNtZ4lIW FhTwkudhDmr6GwyxdKTEvigAB/VQ/uBQbnFGmtdNjPsHfD0Fpyn3mj9MUOSO2hwJ2eJs hlpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P/AgMfm1"; 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 o24-20020a05620a131800b007758f5499b0si3505940qkj.426.2023.11.01.18.40.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:40:02 -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="P/AgMfm1"; 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 1qyMb9-0006XM-Ke; Wed, 01 Nov 2023 21:34:17 -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 1qyMau-0006KL-Vz for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:01 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMas-0001ur-PV for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:00 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c9c5a1b87bso3069335ad.3 for ; Wed, 01 Nov 2023 18:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888837; x=1699493637; 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=we3IFCWv2xg8MNB7vl19STMFoB0LdqgzaOSIdpBMD+0=; b=P/AgMfm1MgmWulvR46wML7t7WcNaMGndyDq5JF/Mo2r0sVTxnNcq9l+pVtEOqOVwr8 wTUZLjCSlnIfZaDKXX7kSLQPu+nTzLHHnjOw0bU/Fl+nikmHjKzR2z0EAEuA9kOElznf Qzj8bb5YrP+OzZSGZfL/Tq/vdbvQXr0QUbASgPCC44DURkPpzEH4s82g3fzfbCAZ6044 OfrO/XI4InkUgGT9O1qo0hi9FiqCabF9/KONCfwSG+ZBG07/Sd1eVPhiXBe0MR7jLDfw Dxp/Ckpc8OMDBBtD35ALxO5bU4J08NrgejTFG2JuwVZRlUnCQ0bN5ZvvUscYA5fEzCUJ Waug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888837; x=1699493637; 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=we3IFCWv2xg8MNB7vl19STMFoB0LdqgzaOSIdpBMD+0=; b=Z8IXVT8OIxwkvHK+Aa9UO+CHIao6pDZeQtUAc7MpHMlfR5Ak4gVfeLG8niAx56z+EQ Y/B3ZqvFRmdooTyKh2iaCAu6Mn8PmX33ow0V8cO85aXRaVbDHZp95MUFKsv8+N2prPHR fFxQZVtvIxru4u+1Jz4gZLzwxMcezwkhWvPQ1xUNQdBZwDbAzIrZxZvlDhgNACdgrAV0 p00fVHmAwQFjm2viCQQlFiFLofsrP0HciLJ0yujJvz1Bz2KGv2BNaouhw2BJoFAu/h/a e8xUtd/ko8434DL4httLFON+vC5uXhFpa9Bfz9zDysSqZjmF8ElPASCqtFCPNc2Hl6bI q4FQ== X-Gm-Message-State: AOJu0Ywf0CCwwxJzGWtiOt8gIKtJzw5O9cALOMAPqUAkCfmxVmsGwEwg hua1ShOuK6lxu9ul2RK+F1TQWjVPWdupt73WSjg= X-Received: by 2002:a17:902:8216:b0:1cc:15ec:3f53 with SMTP id x22-20020a170902821600b001cc15ec3f53mr13534094pln.36.1698888837299; Wed, 01 Nov 2023 18:33:57 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 44/88] target/hppa: Decode d for sub instructions Date: Wed, 1 Nov 2023 18:29:32 -0700 Message-Id: <20231102013016.369010-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 12 ++++++------ target/hppa/translate.c | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 0f29869949..ad454adcbb 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -172,12 +172,12 @@ add_tsv 000010 ..... ..... .... 1110.. . ..... @rrr_cf_d_sh add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 add_c_tsv 000010 ..... ..... .... 111100 . ..... @rrr_cf_d_sh0 -sub 000010 ..... ..... .... 010000 - ..... @rrr_cf -sub_tsv 000010 ..... ..... .... 110000 0 ..... @rrr_cf -sub_tc 000010 ..... ..... .... 010011 0 ..... @rrr_cf -sub_tsv_tc 000010 ..... ..... .... 110011 0 ..... @rrr_cf -sub_b 000010 ..... ..... .... 010100 0 ..... @rrr_cf -sub_b_tsv 000010 ..... ..... .... 110100 0 ..... @rrr_cf +sub 000010 ..... ..... .... 010000 . ..... @rrr_cf_d +sub_tsv 000010 ..... ..... .... 110000 . ..... @rrr_cf_d +sub_tc 000010 ..... ..... .... 010011 . ..... @rrr_cf_d +sub_tsv_tc 000010 ..... ..... .... 110011 . ..... @rrr_cf_d +sub_b 000010 ..... ..... .... 010100 . ..... @rrr_cf_d +sub_b_tsv 000010 ..... ..... .... 110100 . ..... @rrr_cf_d ldil 001000 t:5 ..................... i=%assemble_21 addil 001010 r:5 ..................... i=%assemble_21 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2f5cc597ad..f2b2933c88 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1287,12 +1287,11 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg in2, bool is_tsv, bool is_b, - bool is_tc, unsigned cf) + bool is_tc, unsigned cf, bool d) { TCGv_reg dest, sv, cb, cb_msb, zero, tmp; unsigned c = cf >> 1; DisasCond cond; - bool d = false; dest = tcg_temp_new(); cb = tcg_temp_new(); @@ -1350,7 +1349,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, ctx->null_cond = cond; } -static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf *a, +static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tsv, bool is_b, bool is_tc) { TCGv_reg tcg_r1, tcg_r2; @@ -1360,7 +1359,7 @@ static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf *a, } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_sub(ctx, a->t, tcg_r1, tcg_r2, is_tsv, is_b, is_tc, a->cf); + do_sub(ctx, a->t, tcg_r1, tcg_r2, is_tsv, is_b, is_tc, a->cf, a->d); return nullify_end(ctx); } @@ -1373,7 +1372,8 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) } tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); - do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf); + /* All SUBI conditions are 32-bit. */ + do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf, false); return nullify_end(ctx); } @@ -2661,32 +2661,32 @@ static bool trans_add_c_tsv(DisasContext *ctx, arg_rrr_cf_d_sh *a) return do_add_reg(ctx, a, false, true, false, true); } -static bool trans_sub(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, false, false, false); } -static bool trans_sub_tsv(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_tsv(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, true, false, false); } -static bool trans_sub_tc(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_tc(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, false, false, true); } -static bool trans_sub_tsv_tc(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_tsv_tc(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, true, false, true); } -static bool trans_sub_b(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_b(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, false, true, false); } -static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, true, true, false); } From patchwork Thu Nov 2 01:29:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740421 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp598299wrv; Wed, 1 Nov 2023 18:50:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVTLtD7myVLUuftOXkNmOJUVzWwh73xDHF/RGSaQH55V4lFxX3lR/9PhudCu83/TOb3dow X-Received: by 2002:ac8:5bc2:0:b0:41b:7774:96bc with SMTP id b2-20020ac85bc2000000b0041b777496bcmr21717907qtb.10.1698889808769; Wed, 01 Nov 2023 18:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889808; cv=none; d=google.com; s=arc-20160816; b=nakB4pBdbwqT73JI2/ZRMue0qFO7IN41deZLosFvjc1ohn1KGP8z16jQGeq/rMsU/A elQQgK7MlrG/QxY7do5Tl/rov9kzbPjMGOvDq5oDptcXSWJ25T3jsg9XCp/Gaqe7BEOE 0mrQS1tLRbPC04bOPVBM3xm1MtkzQlw2wDfvuxipRWo+3Zyqsg8r6jJjh1L9EUe0UF18 4rVtDVds4f4+9jrMjyO3xH2UWeCx/qu6Ppn7GubTXHYSWJg+0pl0W8qUbOspvdi1+9wF EVJJwx18FhNHg/yr8sAKoeTFW8XlC6yx02ZZYMG3Y0QrMUMmbHkXadMxKe3CNp+T2zcb f0sw== 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=wrEK8meCb9Gn67PXtTISMWJ2KT8p8ZhsOvKemM4KQPs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=nBMWQ7fizI3/29yOEB7s8uZpxG4blU7MmpYs5GNbSDwe1IB8F1NyG1OC2WrAvP0yy7 3sxOPOzPnGWVga8cVoft1BoPsq8JmZEkf8qPoH4MWmTlFCMWYoTVPI7dMqCh9NZxTP+x R+OSAj92G3linuN5XdIugtELVxit2CMvzGuCcpUzwjDib2EBLl/daN5ReGkHN2xGumg9 enRqP+9TaFvGEF4Nu+vlYcNhx6EBOREczV+q9Gr+uA/1bfVybz8E2s1Eex8xR4T6IlC9 2fusDd4/SXKnPLqvEk6z8jtPSgYDgrLQ55V21NoCiR/1Lcri4AhVRnCbcbwLuHCTt4y2 EhGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zwI1bgZt; 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 v8-20020a05622a130800b00403ae9e8b08si3681441qtk.369.2023.11.01.18.50.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:50:08 -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=zwI1bgZt; 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 1qyMca-000081-Hj; Wed, 01 Nov 2023 21:35:44 -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 1qyMaw-0006O5-Em for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:03 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMau-0001v0-OW for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:02 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1cc34c3420bso3089645ad.3 for ; Wed, 01 Nov 2023 18:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888838; x=1699493638; 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=wrEK8meCb9Gn67PXtTISMWJ2KT8p8ZhsOvKemM4KQPs=; b=zwI1bgZtrGbLN1qL2NBr71Yq+ZyBJLDpb51sVkZeX5nTLR/2NRUU63x6IYuQ0ffhBQ wzPTZYfvT6XqAR6gb7fGo5JrS2yqDyACXH9SpATPnzP4wL+2+AKeQdPRByeXG35o7Lga ZvBo545FozYNgI/3eoo2x8bUapAWBmg2E8cWvnEVlbVEVA6uHGjbMB0PSQc4i2uBk2mx an7HwivZ4qaDSxuZhdxUNnpbFUNAGUuvxJunrE3yCWvLFhTpjAtZ5rt12Nfg/KpuLN5X ZfyKMEda1HzfsK8HnIZFlYo27coR2femTlYOhqyQLtTWBUA+8PKs17NSnh2agwxtbFao QeYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888838; x=1699493638; 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=wrEK8meCb9Gn67PXtTISMWJ2KT8p8ZhsOvKemM4KQPs=; b=BbbmaciCI2mVniUX2lFgGcFbQ0Gtb930rBG+RO5JYqi1A3akWi3jJVOSWp7sEjetQ7 jjS6uDsWBfs1KQ7COELo7OmOaaaxTTtOS4pVmC+oaYT3qiqctmFY8nRWaV2q1mOb63f3 qFZgApqvX2d5YKG/DR9VpkymeYSWE2uPj6ncPc/vZyay/N4oJtFmhtq2IyUpswqzxB8h wj6R/4lXYxaJg4IrF18LMz+BzdcznuFnumSwDq2Etdq9wEEpNqd3BQk6wQlmVjHXg5QT gxkknNywph4SOHaoYP8vucP1hNHkFCHV3h2Q2Qu+WGGiOvep8jLNnUEXdfpwQQibnbUS 4UZQ== X-Gm-Message-State: AOJu0Yz4smQkJkoP4WdFTx53/EfpP6i3ELJw03zjRtK91E0ONTIMS80Q uaprzHuYwap6Sfh+f6yqLKGidiizkAitLecz8co= X-Received: by 2002:a17:902:dac4:b0:1cc:51b8:80f7 with SMTP id q4-20020a170902dac400b001cc51b880f7mr9421558plx.26.1698888838115; Wed, 01 Nov 2023 18:33:58 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 45/88] target/hppa: Decode d for bb instructions Date: Wed, 1 Nov 2023 18:29:33 -0700 Message-Id: <20231102013016.369010-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Manipulate the shift count so that the bit to be tested is always placed at the MSB. Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 4 ++-- target/hppa/translate.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index ad454adcbb..b185523021 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -290,8 +290,8 @@ fmpysub_d 100110 ..... ..... ..... ..... 1 ..... @mpyadd # Conditional Branches #### -bb_sar 110000 00000 r:5 c:1 10 ........... n:1 . disp=%assemble_12 -bb_imm 110001 p:5 r:5 c:1 10 ........... n:1 . disp=%assemble_12 +bb_sar 110000 00000 r:5 c:1 1 d:1 ........... n:1 . disp=%assemble_12 +bb_imm 110001 p:5 r:5 c:1 1 d:1 ........... n:1 . disp=%assemble_12 movb 110010 ..... ..... ... ........... . . @rrb_cf f=0 movbi 110011 ..... ..... ... ........... . . @rib_cf f=0 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f2b2933c88..e326f63866 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3172,13 +3172,12 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) { TCGv_reg tmp, tcg_r; DisasCond cond; - bool d = false; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - if (cond_need_ext(ctx, d)) { + if (cond_need_ext(ctx, a->d)) { /* Force shift into [32,63] */ tcg_gen_ori_reg(tmp, cpu_sar, 32); tcg_gen_shl_reg(tmp, tcg_r, tmp); @@ -3194,14 +3193,13 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) { TCGv_reg tmp, tcg_r; DisasCond cond; - bool d = false; int p; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - p = a->p | (cond_need_ext(ctx, d) ? 32 : 0); + p = a->p | (cond_need_ext(ctx, a->d) ? 32 : 0); tcg_gen_shli_reg(tmp, tcg_r, p); cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); From patchwork Thu Nov 2 01:29:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740377 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595284wrv; Wed, 1 Nov 2023 18:38:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIxJzczV0ffyZwRod6gKbf6pzCSl7FxR4LOhyPZyrCCid+sQYvoVwd7jvYrT86o4Lg8wqn X-Received: by 2002:ac8:574f:0:b0:417:fa13:a8f7 with SMTP id 15-20020ac8574f000000b00417fa13a8f7mr11651611qtx.4.1698889105327; Wed, 01 Nov 2023 18:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889105; cv=none; d=google.com; s=arc-20160816; b=BpYWW//RpjiWtzh7fgccrYndbrc9FyS+upXo6cMBX03wQ2PG314weWR3zl4//4o8hD oQbwWh4IrLC6y33XRvz0Amk5OYD6Kv3JWyI5r4+baeZpy6ApfXy2EJjAhtS0V2wqWnt/ kcTy7z3j+iJ3y06l8f6GIP1PY8lNDvdoT3+pocDlqZ68GWgVFGonkyY3hyE/4o+1Edgz s8hpm3NTzRNVW7ZYUou8Axlsr138zNKB4QhtiA6SSb4nPdPFo8pRPnbBHeaKKMw+Rg4R r/hZxG4lkYpb8P0A7PihP0RxTn5VFbBJInUSNDMKeVUoNCeRxXkn18FHdgVrDreRocWQ V7Kg== 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=jn/tiXGq8rOEHtW5BliLo3GxJCO/SJOx7jptFAyyAyI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=sZUK3Snmd5n60YMG9F6qdBE6pOWZOwjOe9Ap3BEQXc8A+U/WOrZPRuypoO+iRbFhyU tMRf/IYvPzuv+r1N71OT2g6nyhjqR8Jj+ErUcJrhEpmRnvLGed9KKmUmFuwgnIO5k8b1 09Pm7LPf85yhyg4/G/xQKTh5bc3hFNk6eh+D6oCvvFUcZewaiPUku7LllKnnvwhAqOz8 qOct5OmzseRhB+OT/4JO38ergmFHZtqUKAdKBJJofyjIreJacjgdQFTYCKJL0EjP3KQ/ q1YjqjV+rdyEU17mnMM2T5gLCTMZwqGSTJKhoJCsU7ElNfxKKP66kCOu4Q35Ny9ue3Qd TbNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vUy4sRRY; 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 k13-20020a05622a03cd00b00403bfdaa607si3478331qtx.777.2023.11.01.18.38.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:25 -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=vUy4sRRY; 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 1qyMbs-0007Aq-RH; Wed, 01 Nov 2023 21:35:00 -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 1qyMaw-0006O6-JG for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:03 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMau-0001vA-Lk for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:02 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1cc30bf9e22so3686035ad.1 for ; Wed, 01 Nov 2023 18:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888839; x=1699493639; 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=jn/tiXGq8rOEHtW5BliLo3GxJCO/SJOx7jptFAyyAyI=; b=vUy4sRRYcq5Ov9KLe9CVeiQJVuKYsl24qrgiyZ0XfemCEAN+BhAWIOKeYshnjx/h5Z TGdOCRxchqUZMLF+qPR35ZhIRnaT/FatpbreNfYdqxa7XyqGr24h86dS5dRP+mpYp9a4 tVqtkIG1gvhMEZb5+O6YhMQQcroLX13ZZE9DW51emr0efd+kSWe3VoC9IJc9+NiVAgbE H8Z+ty+YwQGYwts7TYQT9cDEHsfRPUxICMwgVLd79da7BETumdt/JTZtZdz/4HaLjmoT 7P3kF5416klf4UTtKA6SiCwIL1ygi4yxCw1IRe9NzRXQ/ji3Xh7n4gh5kPlqIEoW0xgj tJEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888839; x=1699493639; 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=jn/tiXGq8rOEHtW5BliLo3GxJCO/SJOx7jptFAyyAyI=; b=h2B0gDcrgi72SfITkMBLYAOtR9D4MxI2ypAvYoRi7Y2gipxB4Qr8J2Nbfez63MNuET Y2/X+IB0lR4tvbbNQUHhh18iyOtZkQ5Xo8xKwbS/P6gMuTc4DzmUkNw5KXfAwz7vxniz ZJMs+QwEhcPsume3UV46WiOVsSL5x4RjyhGxFwa0AbT2twNei0TsMKR2Bgd2oGnQg0Dt VvAuSgI8k8LBVKz8NFXEsvM8VEOi1OfOkw87doD5HqcV45jNz9H9oYTMavwBREP0Xhtv PzzHzgeB99m5dwsj7pA9T1dP1q3cmIlfA0oH9sXtbRokrTNNMRgkL9S77fS0op1au9Ot /8yQ== X-Gm-Message-State: AOJu0YxsjrnoLhCUHmEyD5UZD+xyHFSgZQYU30l9dLFrX2hcSz181auq sM3wPYg4cmcG9+ZTBdT5NmFEtzmglO7zekhuim0= X-Received: by 2002:a17:902:da8d:b0:1cc:42d0:dbc5 with SMTP id j13-20020a170902da8d00b001cc42d0dbc5mr9840243plx.13.1698888838936; Wed, 01 Nov 2023 18:33:58 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 46/88] target/hppa: Decode d for cmpb instructions Date: Wed, 1 Nov 2023 18:29:34 -0700 Message-Id: <20231102013016.369010-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 9 +++++++-- target/hppa/translate.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index b185523021..fc327e2bb3 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -67,6 +67,7 @@ &rri_cf_d t r i cf d &rrb_c_f disp n c f r1 r2 +&rrb_c_d_f disp n c d f r1 r2 &rib_c_f disp n c f r i #### @@ -83,6 +84,8 @@ @rrb_cf ...... r2:5 r1:5 c:3 ........... n:1 . \ &rrb_c_f disp=%assemble_12 +@rrb_cdf ...... r2:5 r1:5 c:3 ........... n:1 . \ + &rrb_c_d_f disp=%assemble_12 @rib_cf ...... r:5 ..... c:3 ........... n:1 . \ &rib_c_f disp=%assemble_12 i=%im5_16 @@ -296,8 +299,10 @@ bb_imm 110001 p:5 r:5 c:1 1 d:1 ........... n:1 . disp=%assemble_12 movb 110010 ..... ..... ... ........... . . @rrb_cf f=0 movbi 110011 ..... ..... ... ........... . . @rib_cf f=0 -cmpb 100000 ..... ..... ... ........... . . @rrb_cf f=0 -cmpb 100010 ..... ..... ... ........... . . @rrb_cf f=1 +cmpb 100000 ..... ..... ... ........... . . @rrb_cdf d=0 f=0 +cmpb 100010 ..... ..... ... ........... . . @rrb_cdf d=0 f=1 +cmpb 100111 ..... ..... ... ........... . . @rrb_cdf d=1 f=0 +cmpb 101111 ..... ..... ... ........... . . @rrb_cdf d=1 f=1 cmpbi 100001 ..... ..... ... ........... . . @rib_cf f=0 cmpbi 100011 ..... ..... ... ........... . . @rib_cf f=1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index e326f63866..6cd06fbc0d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3091,11 +3091,10 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a) } static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, - unsigned c, unsigned f, unsigned n, int disp) + unsigned c, unsigned f, bool d, unsigned n, int disp) { TCGv_reg dest, in2, sv; DisasCond cond; - bool d = false; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); @@ -3113,14 +3112,19 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } nullify_over(ctx); - return do_cmpb(ctx, a->r2, load_gpr(ctx, a->r1), a->c, a->f, a->n, a->disp); + return do_cmpb(ctx, a->r2, load_gpr(ctx, a->r1), + a->c, a->f, a->d, a->n, a->disp); } static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) { nullify_over(ctx); - return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); + return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), + a->c, a->f, false, a->n, a->disp); } static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, From patchwork Thu Nov 2 01:29:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740410 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597353wrv; Wed, 1 Nov 2023 18:46:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9pGkC6l0oXqdvWRT886cU/tystv7Nxllu/BhIgo/AciY3ZaY6sLdoXSB0CLf9eqf9tWU0 X-Received: by 2002:a1f:2302:0:b0:49e:3f5:7678 with SMTP id j2-20020a1f2302000000b0049e03f57678mr12952667vkj.10.1698889582829; Wed, 01 Nov 2023 18:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889582; cv=none; d=google.com; s=arc-20160816; b=d1Aqm5Eyt+1a7GGs3Ci+EwpY1hDa1+6AFQFr2+e3fE14EFxF6KGDcCYKz2Ld5eaVoG Npyy2n68c3DHNKmvhDGcWhENILUuNTu7BQjWbjiqYH76LXK7lYjzoVI454hjS/npT8D+ w5GPrnh+FQ2yh6l2TTdXeXVX94Myp4BA2W5JEIN1iCKJuOJ5de5u5B4p/heNJeYwiYEe +itFXE8HBQueJHPYIN7ObWBoO7PPXAtmUk2+1SHm9UUZEk4YnS7sA6isnNsTodwLzD59 3I8TvuCWg52xUlumD5A/TDCfuJHc5dXarapqiWF82z1b9Gubjom55+ISVT8BXduohTo3 8hCQ== 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=pIuthBYkKwOmsBB1Uq0crYfKMoKtW6F7fMd/Il2eA/A=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=lztuyx3iwsqwnYkU/QH9tUiYwq23kAmXtL+OqJMnNEBMMkydeHAq6Kg/FzG/ZKz02X /1Y3FnhpF5YWZPj8CLyaxB6IUr6xmJrOnNak6AzA0ic23I/M5ZaERDUzMblqGfM4FJ2H ZD4QjovKbDGFFsBEg3DXP2h/J3KY7yFE59cAZ1sVJC4924zyPZ7C4hJxeqp0up80FbK2 ob7kMgdLhu7mzWbD1QMxUFPNoj5raHqv7duJrIYrlZEnydumASTaet+HKJC/TV1QSCsj oSSLcl/JUPdsYPATDi04vKFL//C/DCtwhdftFgdyGs0odOgLwjh0fZsQZu7+E9iLMlgQ 52Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iHQlFS6a; 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 i7-20020a05620a0a0700b0077898244b50si3468561qka.119.2023.11.01.18.46.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:46:22 -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=iHQlFS6a; 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 1qyMcn-0001AH-Ci; Wed, 01 Nov 2023 21:35:57 -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 1qyMaw-0006O7-M9 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:04 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMau-0001vG-U1 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:02 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1cc5fa0e4d5so3627775ad.0 for ; Wed, 01 Nov 2023 18:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888839; x=1699493639; 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=pIuthBYkKwOmsBB1Uq0crYfKMoKtW6F7fMd/Il2eA/A=; b=iHQlFS6aJx9e6rFNrll7NzmgCyIKxM4MuOl7NFYgy3e2opRtPZiGQTVYSjG1Zc4uVO gIKRcrvTokQARS5dxRpCzKuhSwuM4ykTMmhT4ZVVGYvNxa/l5cR3mSDttzNn0Cr2YHVk 6rvoENrOPL65CS2QjMzEEJVpkIg7d6wCZ75HNwNRQhIBjr6+IHpGXT63wsUBM1GVZrv5 eTkQJagRvfm8fqhE06aXoruUH09xSn/Zkor+yMh+ZBUeXQkmqxxk5R6kQgUqPy+TEutS a7rWVwmd7ac9i++V7sJNyC3sTc5y7TlVZLOZC5p0BZi2UHwE/Y77ZnKcWdVs6VjfCivq xPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888839; x=1699493639; 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=pIuthBYkKwOmsBB1Uq0crYfKMoKtW6F7fMd/Il2eA/A=; b=tlTSqbOnHFiKkBEfmNMHLNbrKvJ2IyevQJEhSQB3KYD4ZhqB44MN9t84dlGpZ23niW eBxN9IatEghYMZEIPzg+G+JS3asQ7jAXi3X3fHekHxCNv/k2Q594+6+3Dmcn6EPy2kTK TO1/HT3odniVRs4WaCoUH92wwKomDpkv45NMqKfhBdZKDX+LUANeiMrLpZyCUVberEMh EdJEN5WZee7y6cl7/qdMoB0uPGq+Q5w0ozXAOmrfE/KP3oF1zCCpzOE3vKI46fkq/jJm FgB7yZGaGsDszSW0j9tn4K+KVFaeVEuXGHK7X9a0Pzh6suHfrAo90TiGbPk4Xh7gPQ4s JzFQ== X-Gm-Message-State: AOJu0YwgDfkXrGPEr9iLWPsC7mij06i7ZFNqPew2vqrbpGDuVwk20MGF 8dpxFAT0gqp2lU1Yy9K5lKzh1WJ+8zCKv3258z0= X-Received: by 2002:a17:902:d50d:b0:1cc:339b:62af with SMTP id b13-20020a170902d50d00b001cc339b62afmr17258524plg.16.1698888839657; Wed, 01 Nov 2023 18:33:59 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:33:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 47/88] target/hppa: Decode CMPIB double-word Date: Wed, 1 Nov 2023 18:29:35 -0700 Message-Id: <20231102013016.369010-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 10 ++++++++-- target/hppa/translate.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index fc327e2bb3..48f09c9b06 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -51,6 +51,7 @@ %pos_to_m 0:1 !function=pos_to_m %neg_to_m 0:1 !function=neg_to_m %a_to_m 2:1 !function=neg_to_m +%cmpbid_c 13:2 !function=cmpbid_c #### # Argument set definitions @@ -69,6 +70,7 @@ &rrb_c_f disp n c f r1 r2 &rrb_c_d_f disp n c d f r1 r2 &rib_c_f disp n c f r i +&rib_c_d_f disp n c d f r i #### # Format definitions @@ -88,6 +90,8 @@ &rrb_c_d_f disp=%assemble_12 @rib_cf ...... r:5 ..... c:3 ........... n:1 . \ &rib_c_f disp=%assemble_12 i=%im5_16 +@rib_cdf ...... r:5 ..... c:3 ........... n:1 . \ + &rib_c_d_f disp=%assemble_12 i=%im5_16 #### # System @@ -303,8 +307,10 @@ cmpb 100000 ..... ..... ... ........... . . @rrb_cdf d=0 f=0 cmpb 100010 ..... ..... ... ........... . . @rrb_cdf d=0 f=1 cmpb 100111 ..... ..... ... ........... . . @rrb_cdf d=1 f=0 cmpb 101111 ..... ..... ... ........... . . @rrb_cdf d=1 f=1 -cmpbi 100001 ..... ..... ... ........... . . @rib_cf f=0 -cmpbi 100011 ..... ..... ... ........... . . @rib_cf f=1 +cmpbi 100001 ..... ..... ... ........... . . @rib_cdf d=0 f=0 +cmpbi 100011 ..... ..... ... ........... . . @rib_cdf d=0 f=1 +cmpbi 111011 r:5 ..... f:1 .. ........... n:1 . \ + &rib_c_d_f d=1 disp=%assemble_12 c=%cmpbid_c i=%im5_16 addb 101000 ..... ..... ... ........... . . @rrb_cf f=0 addb 101010 ..... ..... ... ........... . . @rrb_cf f=1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6cd06fbc0d..7f767fea64 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -329,6 +329,12 @@ static int expand_shl11(DisasContext *ctx, int val) return val << 11; } +/* Translate CMPI doubleword conditions to standard. */ +static int cmpbid_c(DisasContext *ctx, int val) +{ + return val ? val : 4; /* 0 == "*<<" */ +} + /* Include the auto-generated decoder. */ #include "decode-insns.c.inc" @@ -3122,9 +3128,12 @@ static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a) static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } nullify_over(ctx); return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), - a->c, a->f, false, a->n, a->disp); + a->c, a->f, a->d, a->n, a->disp); } static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, From patchwork Thu Nov 2 01:29:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740373 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595104wrv; Wed, 1 Nov 2023 18:37:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVqCDJb9eP8DmPqe/COFPcDpFNyLsONd1iKoljpd0vwxhRr1czA56cW9Nm2sgj7uYQTVhy X-Received: by 2002:a05:620a:2ae9:b0:77a:1cc0:6e5c with SMTP id bn41-20020a05620a2ae900b0077a1cc06e5cmr13303978qkb.21.1698889069951; Wed, 01 Nov 2023 18:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889069; cv=none; d=google.com; s=arc-20160816; b=wWbC5e6LowQad1vX915VBeiy0KXo2wSnWQ6UwHeGBiXeYW2mu3IAYtdLMZ7ML5EKS/ +Tm4motkzd5AWg5oxEJc1JUxnQ3Q/GLpwI0hH3PJygbVEWv7LZgpuH6rPX6x3ICJNS3Q 24xozdu2TGb01BcxoEBWlIj6vSmHI0gMKiwEL5mBfGYJVwmi8GlrtNZT5wbQR5pMJqaS rQ9iGsO7WYXFxEWfBSw0x6Q6BpP8+sX8gKRPvOVKNSa3oqDPnKBSZigb4ZcXiUA+KkkC Uk7yiZizdpqJuCciAcBqJqUCaD27tPIUvx5+qkmPDwtnRnWJXcHnmQjeTpjfpzYOh082 zPJA== 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=Qv/a5qw7IRMvc9+1bsPwBvAxjMkczYjB4ck+5MvAjzA=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=G2HjYetFzc6zGnt5mOLrC0wQhtfcGLw3tbyBGjb3GdRWq6PNhWXyk4LWzKuxLZT80p qsrwtK1+EJmvSBwYuRS5kHp7V4tZSJZPZ9z5tcop4ybykdATpek7oARY8EQ4Yi8TSu/a xqNbOYnh0C0jdFzs0g6R8tK05PPZqWjsWAxZDkcMWJt2eV+tU6ZfXRZa+9Cbj31V8+C5 5Eg+jiKZ2AZbtBY5WhpXyjkwe2uVjrb7dmnzQB99p7AUCvZTNKSQ/lrEUJZQAHylkmqm iV7A8+nmLnsxW0JIJm95Jv/PPgXqGj50K9TcZhTBBJvr8DBVHL9dIMff8o21/KJBlRG+ DFGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RSqI8Wn/"; 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 ty5-20020a05620a3f4500b00773fa71cbb8si3438699qkn.512.2023.11.01.18.37.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37:49 -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="RSqI8Wn/"; 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 1qyMcm-000165-Vc; Wed, 01 Nov 2023 21:35:57 -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 1qyMay-0006OV-1P for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:04 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMaw-0001vd-Ku for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:03 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5ab94fc098cso298532a12.1 for ; Wed, 01 Nov 2023 18:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888840; x=1699493640; 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=Qv/a5qw7IRMvc9+1bsPwBvAxjMkczYjB4ck+5MvAjzA=; b=RSqI8Wn/LNxAn1kHwFTf8Cgu3c6ZcUurxNRACwJ6OkYzRv2+ywQ2bFNXJXC0M6F1hi XzXe3Iv3K+YTDygHw2cRJ2iXaYd7sPTLLQL+lNVENnzznRG/0fqnJrqg2qnjn62mPRWf zhdgU0FoOa92TghtCkNoBdDAq/QT4pqH2Kj24v/qClYbjanguLOgDt6Ak/N9IxJIPYK/ k6xyHCjjkwtT/xfhHoPod3nnz1MkcCsSEcZWqe18ZMqmQukWrTFPt2uO68BqE/tLIxH8 vhpYCtPiqKgllNhwK/tUzOgwKNUe6WLSH4lkGNlaFl8kFoNkew8fs/pI29ADMpTO268Y ziDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888840; x=1699493640; 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=Qv/a5qw7IRMvc9+1bsPwBvAxjMkczYjB4ck+5MvAjzA=; b=IPpqaQxBP7rnmVMFtCpA0RU1M3vJy5aRWgPiv32TUGC/sp5BOYNTb2hwqcUWG4xhU5 QrJst92brgRkHU4dqHscOxBgpPMOnqOgJ4OXTxYXE4HgAs2SvdDqgMKlhG/+0WtVWAac tJHrJKAaxIifSpelWHsd13gnoN6HR6T8pWFRe9x6+vP35RNR8JRWDRFjfdVe+754qM6m QM+Uz+kxoqLzcZaIxADI/OvvnzyGTSw4WYUF2ezZQOCegnCDsN4UlKDcUjiVmIsYC4wd OtLAEBcymGo0duwXVBAXLYmGirW8kzC1IFLsv7wwOGzi7Ct7PLm4uZsSsKxicNIB2ZK6 Rr8A== X-Gm-Message-State: AOJu0YyUvsDZ77IVQGCAL57QdaVd2EoB7fghZJneSVGWRFh3adkqbi67 ZuequMrvUz58wTUKA3UVpwurW3i8lCNFhXOWnp4= X-Received: by 2002:a17:902:d2c7:b0:1cc:4efc:c87d with SMTP id n7-20020a170902d2c700b001cc4efcc87dmr11620470plc.55.1698888840490; Wed, 01 Nov 2023 18:34:00 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 48/88] target/hppa: Decode ADDB double-word Date: Wed, 1 Nov 2023 18:29:36 -0700 Message-Id: <20231102013016.369010-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/translate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 7f767fea64..1b4fa401ba 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3143,6 +3143,17 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, DisasCond cond; bool d = false; + /* + * For hppa64, the ADDB conditions change with PSW.W, + * dropping ZNV, SV, OD in favor of double-word EQ, LT, LE. + */ + if (ctx->tb_flags & PSW_W) { + d = c >= 5; + if (d) { + c &= 3; + } + } + in2 = load_gpr(ctx, r); dest = tcg_temp_new(); sv = NULL; From patchwork Thu Nov 2 01:29:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740403 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596655wrv; Wed, 1 Nov 2023 18:43:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvTCMTaHtlDZgp+1orJC/R3czi7lbT7YO4ft1cDTxxVGHeNSCaa7BARqa+sAjWVNOvxHvj X-Received: by 2002:a05:620a:28c2:b0:76c:b3cb:a9e5 with SMTP id l2-20020a05620a28c200b0076cb3cba9e5mr21340409qkp.51.1698889421814; Wed, 01 Nov 2023 18:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889421; cv=none; d=google.com; s=arc-20160816; b=OcrzrQg2FVLieyZGmguQxJxpxmsn3byC+Y/nlOw9cldlJxJkX/ZKuZWNePHdjRBlvf Vye4e+wCJ1uIJ07BgI3kUv8rAzy5egGPTK0IxKQSOA1xc9hUCROT14+8fqbyVmm019ip ubEVVDsYlx9p8wKERAoCEZHbdGIBaLimzTNr2F1DCeTO4Icklcfmw+trpoUCBIcdhrFh BGiQRYASSwbis+/tv/JQAZvD0KnS3jOytInYMO0kpBAcxT6eqB4hTGSU4B5HySUNnje/ RgB01z1lamVg8WF7Mme531zzFf56oDfWo3aUgljGEgD5VyRZe3jy/gRwpJSVkraTZ4Sj W5Yg== 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=zniar5iOVmkHT6sPS3/xZSKtl5AO6s48Oy/l+P1MmPo=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=qHLKaThZUmY9wkaOQ/pza+tedbR4lmt7iluGC/KrFG5nb4uGr/nhKbF6t1r3VvgCS8 QtL7x68v9n1pTBEYoO/mn4PqJMU0trS2/XKC7pjwdHv4Je3ZVp0oTTJ/LcPx5cAKcCXO 12/lLhUEkL2Cvp+TO5A1QQvvFhc7iazI+1gRu8esO3WufWBWotonQjDmvSU3ZPpNTYpm YLvUpQX46Yy47Nnwe2GRbk3gaUTvOecDWvss5kQZMUL9GnKRwCPL8UiKs1g0IVUwAY7y jdK9AThOSey2lCrDuqqggNXEUSE7Q5/KYluE+9q3R2CvVJQsl6OMxZBofp/AUL86fCQ6 aWjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pd6h8QmW; 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 ri3-20020a05620a8f8300b0077701e9f752si3466080qkn.749.2023.11.01.18.43.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:43:41 -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=pd6h8QmW; 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 1qyMbD-0006YO-0P; Wed, 01 Nov 2023 21:34:19 -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 1qyMay-0006OY-5H for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:05 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMaw-0001vk-Gs for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:03 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6c3077984e8so471049b3a.0 for ; Wed, 01 Nov 2023 18:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888841; x=1699493641; 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=zniar5iOVmkHT6sPS3/xZSKtl5AO6s48Oy/l+P1MmPo=; b=pd6h8QmWmi7+C6XLrV4We8/g/WzQMFVGmNVoYypKHI0WLE+uqKU7n8NPuIdk4selrB 3irNyZCrTfuptOIO4fbH79jodCbUShb77mAfgKoCDTw17jwBt81KEaEcTxOBWgOHNLWm WPLfACuT7H8Y9bBrEn0z2Rw0IDGR8XKW4xGjLTuBGk6olVXZ9buo1wZDoYJa1c/+Bdwb czcHQk4isE961ErLfnrRLbGurITgBQOWrMQhZhkicJSNUWP3ycP2vT2rQMMT3fq/EVNb zD+eutCRemYZReAuhaHE9NFoC0NA/HG8JyUeZ3Dp9xhxUFqlysqjf19+LD0qn+vw+7Mi AopA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888841; x=1699493641; 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=zniar5iOVmkHT6sPS3/xZSKtl5AO6s48Oy/l+P1MmPo=; b=q5VINDsmkTzTCMzM6rgRSwspdtxZc+Pjqeuy18o5bBkT4pmjrbFk/DPyLm6fQR2gw1 DaDLjqGFzVT6OEV29rpMaaIvP3S0BUonFVTczN//4wfznjq62DiSkALMqKOKuBcobgBN SsuLoLMkvfk3daeJCRpd3WCdse9r0VD227pL8sRFuTS6dUKOPI7hx43tee96C1v436Hk sBR1OclTURUPIu4QzoUQGuuTjzHBuQl3QsxB4i4jyxZOJmUj5+rfFJmyhrOwvhO/bBOh jpsU/MCN3oOWxIt9J6I5vKwx7PoNk6E4gxe5QYDIUeIcGR+8LStdmF5pUY9RfU+6wPVR eXBQ== X-Gm-Message-State: AOJu0Yz+9awLH2jJotxPnVIkyspc9ttXE4mlqWWR50FYNoqP6oci4Myk n/4qL9OddVBFljVOTSRLBi/BoHOkVQqdYk6Dh5k= X-Received: by 2002:a05:6300:800a:b0:180:f0ed:2992 with SMTP id an10-20020a056300800a00b00180f0ed2992mr7743302pzc.51.1698888841198; Wed, 01 Nov 2023 18:34:01 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 49/88] target/hppa: Implement LDD, LDCD, LDDA, STD, STDA Date: Wed, 1 Nov 2023 18:29:37 -0700 Message-Id: <20231102013016.369010-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 15 +++++++++++---- target/hppa/translate.c | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 48f09c9b06..33eec3f4c3 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -215,9 +215,14 @@ ld 000011 ..... ..... .. . 0 -- 00 size:2 ...... @ldstx st 000011 ..... ..... .. . 1 -- 10 size:2 ...... @stim5 ldc 000011 ..... ..... .. . 1 -- 0111 ...... @ldim5 size=2 ldc 000011 ..... ..... .. . 0 -- 0111 ...... @ldstx size=2 +ldc 000011 ..... ..... .. . 1 -- 0101 ...... @ldim5 size=3 +ldc 000011 ..... ..... .. . 0 -- 0101 ...... @ldstx size=3 lda 000011 ..... ..... .. . 1 -- 0110 ...... @ldim5 size=2 lda 000011 ..... ..... .. . 0 -- 0110 ...... @ldstx size=2 +lda 000011 ..... ..... .. . 1 -- 0100 ...... @ldim5 size=3 +lda 000011 ..... ..... .. . 0 -- 0100 ...... @ldstx size=3 sta 000011 ..... ..... .. . 1 -- 1110 ...... @stim5 size=2 +sta 000011 ..... ..... .. . 1 -- 1111 ...... @stim5 size=3 stby 000011 b:5 r:5 sp:2 a:1 1 -- 1100 m:1 ..... disp=%im5_0 @fldstwx ...... b:5 x:5 sp:2 scale:1 ....... m:1 ..... \ @@ -244,6 +249,8 @@ fstd 001011 ..... ..... .. . 1 -- 100 0 . ..... @fldstdi # Offset Mem #### +@ldstim11 ...... b:5 t:5 sp:2 .............. \ + &ldst disp=%assemble_11a m=%ma2_to_m x=0 scale=0 size=3 @ldstim14 ...... b:5 t:5 sp:2 .............. \ &ldst disp=%lowsign_14 x=0 scale=0 m=0 @ldstim14m ...... b:5 t:5 sp:2 .............. \ @@ -275,11 +282,11 @@ fstw 011110 b:5 ..... sp:2 .............. \ fstw 011111 b:5 ..... sp:2 ...........0.. \ &ldst disp=%assemble_12a t=%rm64 m=0 x=0 scale=0 size=2 -fldd 010100 b:5 t:5 sp:2 .......... .. 1 . \ - &ldst disp=%assemble_11a m=%ma2_to_m x=0 scale=0 size=3 +ld 010100 ..... ..... .. ............0. @ldstim11 +fldd 010100 ..... ..... .. ............1. @ldstim11 -fstd 011100 b:5 t:5 sp:2 .......... .. 1 . \ - &ldst disp=%assemble_11a m=%ma2_to_m x=0 scale=0 size=3 +st 011100 ..... ..... .. ............0. @ldstim11 +fstd 011100 ..... ..... .. ............1. @ldstim11 #### # Floating-point Multiply Add diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1b4fa401ba..4562f865f4 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2972,6 +2972,10 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) TCGv_reg zero, dest, ofs; TCGv_tl addr; + if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + return gen_illegal(ctx); + } + nullify_over(ctx); if (a->m) { From patchwork Thu Nov 2 01:29:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740395 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596183wrv; Wed, 1 Nov 2023 18:41:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHimOQHyeKq56+El+4vWn5J7Vwf5eDLvHw6UPbwBhuYpVl+yqjMuP81Dpbm8O3ohLHfN/pf X-Received: by 2002:a05:620a:3189:b0:77a:282:bfb2 with SMTP id bi9-20020a05620a318900b0077a0282bfb2mr20535534qkb.8.1698889315969; Wed, 01 Nov 2023 18:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889315; cv=none; d=google.com; s=arc-20160816; b=TXWsQECXo1Z+6PQhtoU93feC8/u6xLuP9y/He5RI3+pmIKwsH8wG/948AnLsM8nhyE 7vuRPujLNl47kDiP2giUhwuYdF5UCZS9e7ufxnvnzjqeMHFRDb2+UR+IKz+q3RHMctw6 A39mgu61p1DTXlMkuAqm++8m5xmxBu9eK7+7nxs8wqZ6uw+i69Fb30z5JorzBx02Nozv qOkIZ2RmAdMYGL5V48MCQI401kmhDtPOMtStUlxWJKKsURUSi2M9ZVsQrLpp8GLLNUI1 HxZ4LfVW/EiRA01RTSJ2dWZtGCNMhJv1dcYp3opYOpjNjXc/43nrO9NpVuT+Rt0BSX5S rRcQ== 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=wtKfWdXFSNlzbjUD16+VR+PXfcJkhL8owsB0fGI5Ev0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=QrdAcIzh1LDtKtqoPotYYZ/1nQ1sPOYG2rm4c6By2j6seZ47BnVglJUDzs7m3OhuIC FnAyr3mH5yyS/sHCgLg4trCMKdQaRlbYu46OuD29RIK//XCbV38iQo/goTiJwKoba/rm zis29rYhlqZXRh3wrawDv4vfY1KbB0tzjem5WObQpVf6fLvmR/IIpb9MY7xTe5PhdENx 9UcjK3jtOQSAF35/fyebOulGGoesc5ixcL7sRJSnq10df5R/Z2e2r2Py+PcnIpEDWCXb DcXAboLT6lQ5swLPm+WDYEZ8Szcaxo7fnpSeHHBD3lktd0RPFu1Ee78qebHkcwn8lZg2 +GhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LNz3tzyP; 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 o3-20020a05620a2a0300b0077771ab761bsi3812836qkp.35.2023.11.01.18.41.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:41:55 -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=LNz3tzyP; 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 1qyMbs-00078Q-EM; Wed, 01 Nov 2023 21:35:00 -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 1qyMaz-0006QO-Mj for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:06 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMax-0001w9-Ag for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:05 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cc29f39e7aso3058815ad.0 for ; Wed, 01 Nov 2023 18:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888842; x=1699493642; 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=wtKfWdXFSNlzbjUD16+VR+PXfcJkhL8owsB0fGI5Ev0=; b=LNz3tzyPQWdHxOx1hFRTN5s9jVkE2K7v64juYYhQkTLDpZt6OBAy66Lg0uUyZDMYkX m2C3HN+Z6ta1dUHCRANdq+y6YVtk+IPagzDZwP5rcphxLfP5gCxaKaWN+Mnu0i7tfGQI tW3lTe4ZoJTKKpgPUxrO24Jlik1I14kMazwgBtLZXSVjXVr9+juOuOaSkTB2KxMO0JPE FRcfZ4YwoTeKaqMCEJZqa4wSOpVKaLvKAUYE/bpZzpAWJ9+cUwHKWQgVoJCwc9JDdNl3 DSWrIDtUYcHjzfTNvWG5gIHkbS/NDAl/ACAh4NToFqBcrUeNNSFgGIByiObeAsqSwS7D xpvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888842; x=1699493642; 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=wtKfWdXFSNlzbjUD16+VR+PXfcJkhL8owsB0fGI5Ev0=; b=RXRPTnqZ1WKnREWC6TyOF45icBbQPms+leyAgT8Kfb/9Oy2Fe7jUGJ1FlinUYEYcO+ Fw0FYj1Ne4SJDZMvXZTnmyYWr+ngxePqEj2AOAWWt/6Ccnx2gtcQjvrfCzJYgk2T2Zpo pnEdQ0m0HsADS6rypjAnAWTcLadq+O85JYcBzODyz8e9kb30X01J6ZZN3FLfwVCtFEHF 3gpzMR9jUMMF5oiJUsZYj0nAlN+CxCojA11sUlGxeHujA04oJJ+eghLzzczJWbdzCMqX VuWEr1yam0m2pwglxWMuz3DXhzqMUVObKmtcPwgTqP2ECIx7Yj6MRvCFvPxlxSqHawQ/ kaqQ== X-Gm-Message-State: AOJu0Yzd6E23diezFPnGd25+wbPNr9gDaMRef14JCkgAAPobyECuZe6H fviDUtFv4IfdeiUutQjqgkeQt3qsmMPv3Gfr8U4= X-Received: by 2002:a17:902:ce81:b0:1cc:53ed:cc78 with SMTP id f1-20020a170902ce8100b001cc53edcc78mr10039355plg.15.1698888842015; Wed, 01 Nov 2023 18:34:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 50/88] target/hppa: Implement DEPD, DEPDI Date: Wed, 1 Nov 2023 18:29:38 -0700 Message-Id: <20231102013016.369010-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 19 ++++++++-- target/hppa/translate.c | 80 +++++++++++++++++++++++++++------------- 2 files changed, 69 insertions(+), 30 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 33eec3f4c3..12684b590e 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -46,6 +46,10 @@ %im5_0 0:s1 1:4 %im5_16 16:s1 17:4 +%len5 0:5 !function=assemble_6 +%len6_8 8:1 0:5 !function=assemble_6 +%len6_12 12:1 0:5 !function=assemble_6 +%cpos6_11 11:1 5:5 %ma_to_m 5:1 13:1 !function=ma_to_m %ma2_to_m 2:2 !function=ma_to_m %pos_to_m 0:1 !function=pos_to_m @@ -334,10 +338,17 @@ shrpw_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 extrw_sar 110100 r:5 t:5 c:3 10 se:1 00000 clen:5 extrw_imm 110100 r:5 t:5 c:3 11 se:1 pos:5 clen:5 -depw_sar 110101 t:5 r:5 c:3 00 nz:1 00000 clen:5 -depw_imm 110101 t:5 r:5 c:3 01 nz:1 cpos:5 clen:5 -depwi_sar 110101 t:5 ..... c:3 10 nz:1 00000 clen:5 i=%im5_16 -depwi_imm 110101 t:5 ..... c:3 11 nz:1 cpos:5 clen:5 i=%im5_16 +dep_sar 110101 t:5 r:5 c:3 00 nz:1 00 000 ..... d=0 len=%len5 +dep_sar 110101 t:5 r:5 c:3 00 nz:1 1. 000 ..... d=1 len=%len6_8 +dep_imm 110101 t:5 r:5 c:3 01 nz:1 cpos:5 ..... d=0 len=%len5 +dep_imm 111100 t:5 r:5 c:3 .. nz:1 ..... ..... \ + d=1 len=%len6_12 cpos=%cpos6_11 +depi_sar 110101 t:5 ..... c:3 10 nz:1 d:1 . 000 ..... \ + i=%im5_16 len=%len6_8 +depi_imm 110101 t:5 ..... c:3 11 nz:1 cpos:5 ..... \ + d=0 i=%im5_16 len=%len5 +depi_imm 111101 t:5 ..... c:3 .. nz:1 ..... ..... \ + d=1 i=%im5_16 len=%len6_12 cpos=%cpos6_11 #### # Branch External diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4562f865f4..ea2150cc55 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -329,6 +329,17 @@ static int expand_shl11(DisasContext *ctx, int val) return val << 11; } +static int assemble_6(DisasContext *ctx, int val) +{ + /* + * Officially, 32 * x + 32 - y. + * Here, x is already in bit 5, and y is [4:0]. + * Since -y = ~y + 1, in 5 bits 32 - y => y ^ 31 + 1, + * with the overflow from bit 4 summing with x. + */ + return (val ^ 31) + 1; +} + /* Translate CMPI doubleword conditions to standard. */ static int cmpbid_c(DisasContext *ctx, int val) { @@ -3404,17 +3415,23 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) return nullify_end(ctx); } -static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) +static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) { - unsigned len = 32 - a->clen; + unsigned len, width; target_sreg mask0, mask1; TCGv_reg dest; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - if (a->cpos + len > 32) { - len = 32 - a->cpos; + + len = a->len; + width = a->d ? 64 : 32; + if (a->cpos + len > width) { + len = width - a->cpos; } dest = dest_gpr(ctx, a->t); @@ -3423,11 +3440,8 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) if (a->nz) { TCGv_reg src = load_gpr(ctx, a->t); - if (mask1 != -1) { - tcg_gen_andi_reg(dest, src, mask1); - src = dest; - } - tcg_gen_ori_reg(dest, src, mask0); + tcg_gen_andi_reg(dest, src, mask1); + tcg_gen_ori_reg(dest, dest, mask0); } else { tcg_gen_movi_reg(dest, mask0); } @@ -3436,22 +3450,28 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } -static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) +static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) { unsigned rs = a->nz ? a->t : 0; - unsigned len = 32 - a->clen; + unsigned len, width; TCGv_reg dest, val; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - if (a->cpos + len > 32) { - len = 32 - a->cpos; + + len = a->len; + width = a->d ? 64 : 32; + if (a->cpos + len > width) { + len = width - a->cpos; } dest = dest_gpr(ctx, a->t); @@ -3466,26 +3486,26 @@ static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } -static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, - unsigned nz, unsigned clen, TCGv_reg val) +static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, + bool d, bool nz, unsigned len, TCGv_reg val) { unsigned rs = nz ? rt : 0; - unsigned len = 32 - clen; + unsigned widthm1 = d ? 63 : 31; TCGv_reg mask, tmp, shift, dest; - unsigned msb = 1U << (len - 1); + target_ureg msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); shift = tcg_temp_new(); tmp = tcg_temp_new(); /* Convert big-endian bit numbering in SAR to left-shift. */ - tcg_gen_andi_reg(shift, cpu_sar, 31); - tcg_gen_xori_reg(shift, shift, 31); + tcg_gen_andi_reg(shift, cpu_sar, widthm1); + tcg_gen_xori_reg(shift, shift, widthm1); mask = tcg_temp_new(); tcg_gen_movi_reg(mask, msb + (msb - 1)); @@ -3503,25 +3523,33 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (c) { - ctx->null_cond = do_sed_cond(ctx, c, false, dest); + ctx->null_cond = do_sed_cond(ctx, c, d, dest); } return nullify_end(ctx); } -static bool trans_depw_sar(DisasContext *ctx, arg_depw_sar *a) +static bool trans_dep_sar(DisasContext *ctx, arg_dep_sar *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, load_gpr(ctx, a->r)); + return do_dep_sar(ctx, a->t, a->c, a->d, a->nz, a->len, + load_gpr(ctx, a->r)); } -static bool trans_depwi_sar(DisasContext *ctx, arg_depwi_sar *a) +static bool trans_depi_sar(DisasContext *ctx, arg_depi_sar *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, tcg_constant_reg(a->i)); + return do_dep_sar(ctx, a->t, a->c, a->d, a->nz, a->len, + tcg_constant_reg(a->i)); } static bool trans_be(DisasContext *ctx, arg_be *a) From patchwork Thu Nov 2 01:29:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740378 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595316wrv; Wed, 1 Nov 2023 18:38:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjeBT1Z65dgvHgu3WK4OLMn0j09TLm+sU7qs0ORs2pl08FVVaM7l7GKFRXCZ9+6v9GVK8i X-Received: by 2002:ac8:7d44:0:b0:415:138e:d858 with SMTP id h4-20020ac87d44000000b00415138ed858mr20664143qtb.60.1698889111342; Wed, 01 Nov 2023 18:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889111; cv=none; d=google.com; s=arc-20160816; b=HT7QeE7q4ZWDoeVHlMh1wPL6iUfyHs4BtL3qgGEnAIZJafa0ckUKJyoY6M6zdBC3q/ /8jGBTdKM3OQzTfOcf/ID73nfCTujtHVxQIKdYhGqMWntNtehmV5jlU3rnz5yk+xDC8d SEWrF8UAKMOt4uWDPGTz0tZR6CslcZ0OPnqCCC3kkrol3lPaJtjcGcwibGEutczoSze7 +MiNxCB4x1RO9joBozYOg1hBjCTe3rrK5B7U8Fqx2qNSvP8/t1XugJaelzA/5aXgTAqo 9OpkY1HjBG+9hnWKHKvcGPOv0jz9Q5Uokw86nUX87OpHeX5YFonnpyjebUYY7D4JreY9 xTWQ== 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=oL/Q9k4VdGpuvjlQ5aW5bW/J8E3SoDMupdQ5tQzg65o=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=MU7EVVbvOsaXG9IaIuP6Sb1V6qswbc7mZ0IuMG1fCLASKLAu9mKP3xm8ipiIy8V/ch 3AJjrfZP7HIYRPfYdyOzvow5cbfRFo3h+f0rByaBMXYKqEBG8I3kzeEiwKtqgDVStH0B HqBAjZHLUUwNcEDVn3fGLDa675aSXw4HhkJm1MJ6dpZbXoNjjRo30O/4/39aDvDmJu3K OQF1ALQce7A52g+hVr4qdrx9NI8F6YyGJOHspCDqk/X2+5TLiBSmJ1yjI1OnVDgJ1A8v UDlJLjQ87f8Cq/qYQjVWLHJx2ubUDhF8JD72bssEZZP/cn14ylF6Wwa1e8d4IzMx5Ypg 4dHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eH3k9t69; 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 s6-20020a05622a1a8600b0040538e3e2e4si3834430qtc.266.2023.11.01.18.38.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:31 -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=eH3k9t69; 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 1qyMbN-0006fX-UZ; Wed, 01 Nov 2023 21:34:30 -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 1qyMaz-0006QP-Ox for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:06 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMay-0001wE-2b for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:05 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cc5916d578so3297185ad.2 for ; Wed, 01 Nov 2023 18:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888842; x=1699493642; 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=oL/Q9k4VdGpuvjlQ5aW5bW/J8E3SoDMupdQ5tQzg65o=; b=eH3k9t69KZ/8pNWKRsDkCSTcprj9rzumLOWCsLtP2avJ4HoGkmOY8+u7JIEjRBL61I Fonty8K50pyJADJzn3ESOxgmCn+x7jPB7djQ8SR+tOnv34I8zRP7oReXxwMbPWB1fzD9 hIlx3Y7XelvhkE3el77owhkVGDCUyiyppre1hL4YofDbkdWR7lCKPMs+dGdCJ5lCLUU9 MNuMogAtppoKDbPKwjM5JJ217q5VYnH8e6aVVl1fnOlCczHIzpBRZFQqVAxsbKnXFjTe C+u26Xo0DftqFwjRdZaGiiSphwb4IS3PjWbZRzvu/FAAHl2cOULmRldLmfyZn3Dl5YzN 0poQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888842; x=1699493642; 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=oL/Q9k4VdGpuvjlQ5aW5bW/J8E3SoDMupdQ5tQzg65o=; b=Va/mHt5zkGhBeA3iH1acX+dY1ctaQW5Q8Siez7F2+vAlxvOi8ZDNZVli7SZnuA1SJB DH4Ol7H3Y58fpKKg73t6dK+APPOuaJY51U/mn4EnQSpLu9wpAH+vUr6blwB9Ey7RiXYr IZIIDVw0Zx9HtG1a5TQZBkga1DN0937Zo3lZcwSheTLWSGErRCeIS6EcWxP/slEtOq9N Uu5F6RhLOvOIba2MHYWJK7nxSk7xvnEh6rbdNnHRMfIY+dqzP89XgFpJ1CtBnHkVikxk Lct17jJEgIrgxz8EVAT2JAGrLfGPfvZPzadijGcNoUS4ZUdpd2wFYp6rcvgkWKP1oSQ7 OeOA== X-Gm-Message-State: AOJu0YyluM7QqxoppYVRNtgwXODu6aI/ZH0aCgzshpEnspBiGN9YuMrv iexDR+mdXtJTAQ9GY95dh3mlhpve2Dsl4FXX+lc= X-Received: by 2002:a17:902:d144:b0:1ca:28f3:5690 with SMTP id t4-20020a170902d14400b001ca28f35690mr15738759plt.46.1698888842727; Wed, 01 Nov 2023 18:34:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 51/88] target/hppa: Implement EXTRD Date: Wed, 1 Nov 2023 18:29:39 -0700 Message-Id: <20231102013016.369010-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 7 +++++-- target/hppa/translate.c | 42 +++++++++++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 12684b590e..7b51f39b9e 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -335,8 +335,11 @@ addbi 101011 ..... ..... ... ........... . . @rib_cf f=1 shrpw_sar 110100 r2:5 r1:5 c:3 00 0 00000 t:5 shrpw_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 -extrw_sar 110100 r:5 t:5 c:3 10 se:1 00000 clen:5 -extrw_imm 110100 r:5 t:5 c:3 11 se:1 pos:5 clen:5 +extr_sar 110100 r:5 t:5 c:3 10 se:1 00 000 ..... d=0 len=%len5 +extr_sar 110100 r:5 t:5 c:3 10 se:1 1. 000 ..... d=1 len=%len6_8 +extr_imm 110100 r:5 t:5 c:3 11 se:1 pos:5 ..... d=0 len=%len5 +extr_imm 110110 r:5 t:5 c:3 .. se:1 ..... ..... \ + d=1 len=%len6_12 pos=%cpos6_11 dep_sar 110101 t:5 r:5 c:3 00 nz:1 00 000 ..... d=0 len=%len5 dep_sar 110101 t:5 r:5 c:3 00 nz:1 1. 000 ..... d=1 len=%len6_8 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ea2150cc55..533e29879e 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3354,11 +3354,14 @@ static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) return nullify_end(ctx); } -static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) +static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) { - unsigned len = 32 - a->clen; + unsigned widthm1 = a->d ? 63 : 31; TCGv_reg dest, src, tmp; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } @@ -3368,36 +3371,53 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) tmp = tcg_temp_new(); /* Recall that SAR is using big-endian bit numbering. */ - tcg_gen_andi_reg(tmp, cpu_sar, 31); - tcg_gen_xori_reg(tmp, tmp, 31); + tcg_gen_andi_reg(tmp, cpu_sar, widthm1); + tcg_gen_xori_reg(tmp, tmp, widthm1); if (a->se) { + if (!a->d) { + tcg_gen_ext32s_reg(dest, src); + src = dest; + } tcg_gen_sar_reg(dest, src, tmp); - tcg_gen_sextract_reg(dest, dest, 0, len); + tcg_gen_sextract_reg(dest, dest, 0, a->len); } else { + if (!a->d) { + tcg_gen_ext32u_reg(dest, src); + src = dest; + } tcg_gen_shr_reg(dest, src, tmp); - tcg_gen_extract_reg(dest, dest, 0, len); + tcg_gen_extract_reg(dest, dest, 0, a->len); } save_gpr(ctx, a->t, dest); /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } -static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) +static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) { - unsigned len = 32 - a->clen; - unsigned cpos = 31 - a->pos; + unsigned len, cpos, width; TCGv_reg dest, src; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } + len = a->len; + width = a->d ? 64 : 32; + cpos = width - 1 - a->pos; + if (cpos + len > width) { + len = width - cpos; + } + dest = dest_gpr(ctx, a->t); src = load_gpr(ctx, a->r); if (a->se) { @@ -3410,7 +3430,7 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } From patchwork Thu Nov 2 01:29:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740425 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp598548wrv; Wed, 1 Nov 2023 18:51:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPGEnCR9obBYwIZLFFCIHu9mNWRlgTFMNE940MO3iy/Q9OK052a1mwQXBSLI4okTcAs9SK X-Received: by 2002:a05:620a:2a11:b0:778:8b53:cda2 with SMTP id o17-20020a05620a2a1100b007788b53cda2mr20837438qkp.23.1698889869879; Wed, 01 Nov 2023 18:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889869; cv=none; d=google.com; s=arc-20160816; b=f4fF3hRKifsrVUrBtf9X9LdHL96e1h7UYkudoEczjdzvdiC1YdQFXKm4Ia5fiDJP41 Je0nV3TvpTXCTP5A0CiGX5ExknuLXXWH2UOF5Xlm7LiVtnIi2oHsJ906VqqQ5L9hXRvl 36+AGmqymhMmwttqjBmEBlZ1BrjGi33niWEDdxZpDWib4b8DA2WrKQ80ztRSbwY0jBRP TEomjI/mcjfpaBYH63fqQFLCmSDHys3D7MGjlTTknZwCZHK1g6tNrVvpqnv1YOhna662 XSCDl8FfasGqpqUG70pTD5ThzESB/chT7EcUILAPp02LvIXSF4hCvpnARUA2l7hZrdqj te+Q== 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=V7KRVnVGnodF7hrNMTwH9K0ltpiIRZaSKr/Oi8z+/YM=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=IE27+YSfpuFfDAskvNS3ThUukL+4lmcXH02pb5YvRtUH9EI/R4IRwrcoCwkoCU0+IY einxRryTkCT6lFg7BLiGKtOa6k9zd6aQOr9NZPIJtOKg7fGQsm0bTzPEKSkPxFJiJXst EeXQueqQ1OdqmzTYASx7AKw/aGj3nkBVyqjCEx7jITSk1zYqGWp4ql1gnUAFMHSLlM7D mBB/v5oqBYQ1x6eyYRCzhvvyXXH1jWlIBulmAk+97Qv4/YYYnvNKGScMrcJX/DcUqSOP b3K6EqvIlnt+UYVGjSq9NvjB1ldszHcy1tsOU+wR0511qStpQkPd6rW2INhHErVNtwaR UMNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5Hj2QeW; 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 l22-20020a05620a28d600b007706c5a23f6si3917662qkp.175.2023.11.01.18.51.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:51:09 -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=x5Hj2QeW; 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 1qyMbx-0007Js-CQ; Wed, 01 Nov 2023 21:35:05 -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 1qyMb0-0006Qo-Ry for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:07 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMaz-0001wS-01 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:06 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-692c02adeefso468158b3a.3 for ; Wed, 01 Nov 2023 18:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888843; x=1699493643; 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=V7KRVnVGnodF7hrNMTwH9K0ltpiIRZaSKr/Oi8z+/YM=; b=x5Hj2QeW0N74RM/T/DIr7+cXlxLB6WjPlX7DHL9vQsg62rdSnAYapLvrlms9BU74SB QcXLY0jNBzXq0Ytk+GAb6IDxQ/7rBxRb3QdytmeYL59zdHmOC6WD6ag8sRQI4hukPgp5 jBoTRRUAF/o/OR70Wf39MVWNE6LvocX9gdisg2CcC8rAyYMrtbz22vdAsgGC8pcezJI5 MPsKDrihJYuhgBv3bFYIyv5E4XvQUsBhwJAPX/hWouKWd77RsTbQ4eNCsFhan7Pqtkta R2cv/K76UdydfWyEBj3vNxGTF8UU4L6PCC5tKc85o/eIkl9EI+ot18vkAkOLsgU3VYjP vuaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888843; x=1699493643; 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=V7KRVnVGnodF7hrNMTwH9K0ltpiIRZaSKr/Oi8z+/YM=; b=Vv8sOzNMlDI4lozPJhPuhRXjzeWI2IH//6+az4tRMy7ZN0foLgy3gL92rUHaXbjVwE aSvOwJsKpSuEKoYxrLcJDiy7ZoFvlhAHJAx1ukF1RNGeFVCzJaF4nbh8UNCXOOX/y2dp Jsvb+tENw8zfTk4AGpfR0Gdax2SoRU6r8HHeWR+ei0SR2uJr8yH1QZ2p6WFYuDAwOq4c DSvd1KIjslAQt/7+L8nB/K3acg0VlPpctAXidP/YqT1OfQ/20YjFCznyBV8H8VEM5DgZ VdaZpeF48vYc+AsWnNYL553BO9VRXIlfgs+lU1JxFbOC+SLNyPpWcSiJwVSgtXpuIXCS 2JXg== X-Gm-Message-State: AOJu0Yzks9952F+Eh9Ns7bPHI4RUEKJu3AizC6txXEwqFNK1xYhUkYzF qewjDybIJ3vwIJ/iTPpK5RIWBjAwMZdkETYMaKI= X-Received: by 2002:a05:6a20:918d:b0:13f:1622:29de with SMTP id v13-20020a056a20918d00b0013f162229demr16640527pzd.7.1698888843453; Wed, 01 Nov 2023 18:34:03 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 52/88] target/hppa: Implement SHRPD Date: Wed, 1 Nov 2023 18:29:40 -0700 Message-Id: <20231102013016.369010-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 6 ++- target/hppa/translate.c | 97 ++++++++++++++++++++++++++++------------ 2 files changed, 72 insertions(+), 31 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 7b51f39b9e..6f0c3f6ea5 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -332,8 +332,10 @@ addbi 101011 ..... ..... ... ........... . . @rib_cf f=1 # Shift, Extract, Deposit #### -shrpw_sar 110100 r2:5 r1:5 c:3 00 0 00000 t:5 -shrpw_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 +shrp_sar 110100 r2:5 r1:5 c:3 00 0 d:1 0000 t:5 +shrp_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 d=0 +shrp_imm 110100 r2:5 r1:5 c:3 0. 1 ..... t:5 \ + d=1 cpos=%cpos6_11 extr_sar 110100 r:5 t:5 c:3 10 se:1 00 000 ..... d=0 len=%len5 extr_sar 110100 r:5 t:5 c:3 10 se:1 1. 000 ..... d=1 len=%len6_8 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 533e29879e..897b44d7e3 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3279,34 +3279,64 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) return do_cbranch(ctx, a->disp, a->n, &cond); } -static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) +static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) { - TCGv_reg dest; + TCGv_reg dest, src2; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } dest = dest_gpr(ctx, a->t); + src2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { - tcg_gen_ext32u_reg(dest, load_gpr(ctx, a->r2)); - tcg_gen_shr_reg(dest, dest, cpu_sar); + if (a->d) { + tcg_gen_shr_reg(dest, src2, cpu_sar); + } else { + TCGv_reg tmp = tcg_temp_new(); + + tcg_gen_ext32u_reg(dest, src2); + tcg_gen_andi_reg(tmp, cpu_sar, 31); + tcg_gen_shr_reg(dest, dest, tmp); + } } else if (a->r1 == a->r2) { - TCGv_i32 t32 = tcg_temp_new_i32(); - TCGv_i32 s32 = tcg_temp_new_i32(); + if (a->d) { + tcg_gen_rotr_reg(dest, src2, cpu_sar); + } else { + TCGv_i32 t32 = tcg_temp_new_i32(); + TCGv_i32 s32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, load_gpr(ctx, a->r2)); - tcg_gen_trunc_reg_i32(s32, cpu_sar); - tcg_gen_rotr_i32(t32, t32, s32); - tcg_gen_extu_i32_reg(dest, t32); + tcg_gen_trunc_reg_i32(t32, src2); + tcg_gen_trunc_reg_i32(s32, cpu_sar); + tcg_gen_andi_i32(s32, s32, 31); + tcg_gen_rotr_i32(t32, t32, s32); + tcg_gen_extu_i32_reg(dest, t32); + } } else { - TCGv_i64 t = tcg_temp_new_i64(); - TCGv_i64 s = tcg_temp_new_i64(); + TCGv_reg src1 = load_gpr(ctx, a->r1); - tcg_gen_concat_reg_i64(t, load_gpr(ctx, a->r2), load_gpr(ctx, a->r1)); - tcg_gen_extu_reg_i64(s, cpu_sar); - tcg_gen_shr_i64(t, t, s); - tcg_gen_trunc_i64_reg(dest, t); + if (a->d) { + TCGv_reg t = tcg_temp_new(); + TCGv_reg n = tcg_temp_new(); + + tcg_gen_xori_reg(n, cpu_sar, 63); + tcg_gen_shl_reg(t, src2, n); + tcg_gen_shli_reg(t, t, 1); + tcg_gen_shr_reg(dest, src1, cpu_sar); + tcg_gen_or_reg(dest, dest, t); + } else { + TCGv_i64 t = tcg_temp_new_i64(); + TCGv_i64 s = tcg_temp_new_i64(); + + tcg_gen_concat_reg_i64(t, src2, src1); + tcg_gen_extu_reg_i64(s, cpu_sar); + tcg_gen_andi_i64(s, s, 31); + tcg_gen_shr_i64(t, t, s); + tcg_gen_trunc_i64_reg(dest, t); + } } save_gpr(ctx, a->t, dest); @@ -3318,31 +3348,40 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) return nullify_end(ctx); } -static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) +static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) { - unsigned sa = 31 - a->cpos; + unsigned width, sa; TCGv_reg dest, t2; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } + width = a->d ? 64 : 32; + sa = width - 1 - a->cpos; + dest = dest_gpr(ctx, a->t); t2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { - tcg_gen_extract_reg(dest, t2, sa, 32 - sa); - } else if (TARGET_REGISTER_BITS == 32) { + tcg_gen_extract_reg(dest, t2, sa, width - sa); + } else if (width == TARGET_REGISTER_BITS) { tcg_gen_extract2_reg(dest, t2, cpu_gr[a->r1], sa); - } else if (a->r1 == a->r2) { - TCGv_i32 t32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, t2); - tcg_gen_rotri_i32(t32, t32, sa); - tcg_gen_extu_i32_reg(dest, t32); } else { - TCGv_i64 t64 = tcg_temp_new_i64(); - tcg_gen_concat_reg_i64(t64, t2, cpu_gr[a->r1]); - tcg_gen_shri_i64(t64, t64, sa); - tcg_gen_trunc_i64_reg(dest, t64); + assert(!a->d); + if (a->r1 == a->r2) { + TCGv_i32 t32 = tcg_temp_new_i32(); + tcg_gen_trunc_reg_i32(t32, t2); + tcg_gen_rotri_i32(t32, t32, sa); + tcg_gen_extu_i32_reg(dest, t32); + } else { + TCGv_i64 t64 = tcg_temp_new_i64(); + tcg_gen_concat_reg_i64(t64, t2, cpu_gr[a->r1]); + tcg_gen_shri_i64(t64, t64, sa); + tcg_gen_trunc_i64_reg(dest, t64); + } } save_gpr(ctx, a->t, dest); From patchwork Thu Nov 2 01:29:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740387 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595701wrv; Wed, 1 Nov 2023 18:40:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwV1EQqnnYv8wI32Z6XIR0SzLEVqT5qGKtGQxgJrQd/2y2bj7UwYAFyly/0qghGXT6sqAb X-Received: by 2002:a05:620a:4482:b0:779:db5e:6656 with SMTP id x2-20020a05620a448200b00779db5e6656mr21317813qkp.4.1698889202495; Wed, 01 Nov 2023 18:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889202; cv=none; d=google.com; s=arc-20160816; b=VY5cpC6Lou5hljRRG/QgP/twec1HGVlaKJRAEnn+V+UdMMntMvTqOvlODSe8V+RRUo PxaOmUzaoQ37zhjx5Dz0NrXyGk9utMlXX5BGWUbQQpc4pNO4p5i4PgEYD55dj614b2IA PdRuRdvpuWVFBiPMT0V2i9aYMHCiVHkJFTH0TjxY3Y09cpX+c+okKaGzbgd+vnAUbb38 gqejHlD03Rb6OpEdwNi9mwTEASWCbhPI7OjBMRJg7bZZ7OONDB0nExbEzcguByATit+I rOTrzCmJZ7lBrkYvPIRwbpFOJRs6e0lWbVuFQsoga8PjnoEdc2U8Hbc065U4TLaUJ9WF pVgQ== 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=ZCnWYkK+U1pZwjN+BpVp2KIVyq7cUxKa4TKDY4mlg8c=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=zrfK4Gz4soBVG67DNhZDX7vBMK4JCKkqKBt/kATzas94HPXtqPoP3tTaFT/Qs9RpMU XkmhnE5pshgsLA1D5gt22gOx+vU8JA8sqqxRBgcWY0TlC35JWR2fbBKKAYHEGN9AchXD q2Eep6wjraSFgvsY1aLDM/sdk4mE1ApcCSwxtgAkYyeiVFPuhqiYqXXnUchWqs4wlxa0 eJjDKiqxkfnEY9n2duTAP8ngr6XYASTCQn4zXBYt86B411mM9puctNWNE48YwooSt9wu vkQAIOY/uV26rWqoBN7Fu/MQ2ehRTWBRVyyEWqw0FImaJwfnY7se64Td6CmWVagEFwWg J3vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WSMzlmBF; 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 i7-20020a05620a248700b00775ed1e2820si3642893qkn.323.2023.11.01.18.40.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:40:02 -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=WSMzlmBF; 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 1qyMbv-0007JS-Pv; Wed, 01 Nov 2023 21:35:04 -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 1qyMb1-0006Qv-8R for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:07 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMaz-0001wc-Oh for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:07 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1cc2f17ab26so3324855ad.0 for ; Wed, 01 Nov 2023 18:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888844; x=1699493644; 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=ZCnWYkK+U1pZwjN+BpVp2KIVyq7cUxKa4TKDY4mlg8c=; b=WSMzlmBFWbaTNiHJpJ7az+9GYY/XDjW1VJR3IywlMO9hFRs4rVocdD9rxw9CfZn3f6 1OwYYnYKkMzALn9ZNzR93zVBkQTH/9tGiKdEH3bzXzQeQ3VJ5pSKDxzdWmjGS6IhAlOd Xaqk1awhB1Rf0rQltculmD39bmwf30M3VYgveCmGHSfwFfyts31kKTkHBhirB+wN15df C7pk6Lddbj536sAucBIGkUeb4BVQFDadxtygUqDRR8Xp2YOw3V0WioH8jaeGiWqAIKkU Rgr1Jy6VPSVVNGi68FswAKPcIbYcudOsx+vIn8hwxy4b0gc0DWlBmGspt1EXq/IWFq/S rPZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888844; x=1699493644; 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=ZCnWYkK+U1pZwjN+BpVp2KIVyq7cUxKa4TKDY4mlg8c=; b=wwRlvduEq6pml9ErbtGSkq5NLmMUoQyRfeFWSjvus0h/6o6gnC5CU3H7aZR28HRLwx kxsCm8nHNj/AqZAQAiCUXTDFY7nqae3EDezhJ+rxTnazu2lBDX5KrOsVlj6/D3ZO7swT 1kQv3XjOLRTrgdV5A6RPph5WI3hyyPm4GQCQyHYSC++O9WJjiHduO/2im0mAfscPNqaK M6ZIC9IBq46OKmU+92oJK9rFkbgdHfPMIgGksa48T8RyKEpNi2Wgw9pOITX9/6EbBBk/ 2aw/jONnlei13qeVAnnBTsUFSosuZM94hnK/AM9HQIzC8TYNI9l/j4UGAlzgI++lAdWE xF9w== X-Gm-Message-State: AOJu0YxXRySAzYwbvqMyjAR4pjaOGdjyLwnANxc0mf4rGNBb2XgMfuGj SJV5fsbtU5/dL36pJmPjp/aJfiRv+c3dYmTNXGc= X-Received: by 2002:a17:902:e809:b0:1cc:6d2c:fb59 with SMTP id u9-20020a170902e80900b001cc6d2cfb59mr6171084plg.28.1698888844257; Wed, 01 Nov 2023 18:34:04 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 53/88] target/hppa: Implement CLRBTS, POPBTS, PUSHBTS, PUSHNOM Date: Wed, 1 Nov 2023 18:29:41 -0700 Message-Id: <20231102013016.369010-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 2 ++ target/hppa/translate.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 6f0c3f6ea5..ba7731b517 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -381,6 +381,8 @@ bl 111010 ..... ..... 101 ........... n:1 . &BL l=2 \ disp=%assemble_22 b_gate 111010 ..... ..... 001 ........... . . @bl blr 111010 l:5 x:5 010 00000000000 n:1 0 +nopbts 111010 00000 00000 010 0---------1 0 1 # clrbts/popbts +nopbts 111010 00000 ----- 010 00000000000 0 1 # pushbts/pushnom bv 111010 b:5 x:5 110 00000000000 n:1 0 bve 111010 b:5 00000 110 10000000000 n:1 - l=0 bve 111010 b:5 00000 111 10000000000 n:1 - l=2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 897b44d7e3..91249d89ca 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3782,6 +3782,12 @@ static bool trans_bve(DisasContext *ctx, arg_bve *a) #endif } +static bool trans_nopbts(DisasContext *ctx, arg_nopbts *a) +{ + /* All branch target stack instructions implement as nop. */ + return ctx->is_pa20; +} + /* * Float class 0 */ From patchwork Thu Nov 2 01:29:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740385 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595415wrv; Wed, 1 Nov 2023 18:38:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHO1hAUCaZF8/Z/H7zNqcpgySz8NBNSdN5VmUoaR2riFWNSrOoNSyunf/Evb1ZJsSnbouCK X-Received: by 2002:a05:6214:2b05:b0:66d:18ab:b482 with SMTP id jx5-20020a0562142b0500b0066d18abb482mr23716482qvb.63.1698889135632; Wed, 01 Nov 2023 18:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889135; cv=none; d=google.com; s=arc-20160816; b=ODxXGJ3AXAVu0ySYNfIDNQW97JKzLDPyxbG8ugBE7U8ljHjemt60COZaMklvh2wZzg IimZtx8zeEWKma1Q9MVJDe3jv1GXMyVW9QecLgC12fIEQi8pd1NEEX0Aq2m8xVvYWCbd tzAZqr4U4vGxBPPgSobermGe8uhlBI7gE4DYR3KFAgCzLtr+AkiEdaLV20IjOxgt0USV Zm8nZMEoVtmJcqiRk01CLYIcLIiZ33iMkwP4csfv0IQPwv5wcjunNxY8BF6go5UejKNA WKtcH/OUTKPB3Z5i8/nOO9Hvt0aFeSFntjfcHuOm2eJDdLoc4QLtLNL6F9Iz2fLiu4KK lthg== 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=9RvtTlFNNWCEOZgJIZtJEKBeoV+IetUrnsa+fT4YgGk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=fuCcgBqCxEda605Nz++7qbT8jlClVcZqgQ8b+NUvRbpDi6QkiMu9YCqNAmQ6co20TH MTYT3zIT/iyVMYtTxgVfO7Hxy0E8qt1wZaQYOQqpht5ofd5ht52/nuC5tX4oKtxIxIZ1 C8Gm3nQ5duHp9bpUxNT3F7+DJbKS/JhhAAG734sxFzSxDTVBX288X4Y77eV/Qr5nMp/H vsrud+kRchqhEMfrvDlyRqXlsr1gB8NqHo8/14qRNJKZE52gfYNSpZkBr9IFFOOw42Qa BAxC3LZUeFnMZ31rreQQ1KYZSkmCidZ7JotdCnCTpbxNKTrB4qAQDgovd45BQ4hGzNe6 HRdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TvyS/dMd"; 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 u1-20020a0cee81000000b0066d09b83e67si3413737qvr.484.2023.11.01.18.38.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:55 -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="TvyS/dMd"; 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 1qyMbL-0006ea-0O; Wed, 01 Nov 2023 21:34:28 -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 1qyMb2-0006Rg-K0 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:09 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb0-0001wn-Hy for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:08 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5bcf83a8f6cso299972a12.2 for ; Wed, 01 Nov 2023 18:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888845; x=1699493645; 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=9RvtTlFNNWCEOZgJIZtJEKBeoV+IetUrnsa+fT4YgGk=; b=TvyS/dMdNiQYnw7n9clcsABTnmGpSy4V68GRwHNT5WrF3CS5fr5Lhipa1IGX9AJvFV N3oJD1kIXRkc8hl5rwnMfGsOonUU/HX4ikXyl8G6+xtIzQgfIoqnCYCvO37K+71ibO6c xc4FBNarzCjg2/5UyuUvOYb2JfgFCqPWxFZGNmJYFtZTR50qG2lYiy77100shTG9DovY VcTq7LqMPARJrXIRPfmc7TP20xRjg41DsxuSbTXjFRyatd8Z9N9qFXquJfHVMBZK4sv3 7GHh9Rg6goWxWAzfMmjg4WDXA371J3T0lZCnYiebGAxuNl+M6CAn1OFNdu2JcG6sDEYv bzHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888845; x=1699493645; 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=9RvtTlFNNWCEOZgJIZtJEKBeoV+IetUrnsa+fT4YgGk=; b=vua8YIkMlsOxl9NrIX37x4wjIEg6a+KIo4tE4DY7soOv3XFHgjSSUUJ/TDb8g/74ct F1GtHLuN0ho3gxgE9ushWHw8P7OsYvTiFoZhwnfXpuUCT6xeZdynbOfzFFL59YJvUDnm KgvxEC5hed2i4w5bpEw/VTVsCSgxuEkoKsqUFygizM8zVfbzklHSUETO0G+rOF+aLpwp QaYmZqpPFkXga6TMHM0NgLKCywoPwsut9V8XLEFT+oc8OklWIrm34IdVbRz8ZnSbVxn7 eVqqJ2n2/9+DwgnyYSV7KQYUMv/U1xYDeNBIT+M/foSaPj2yoXKhiKNM3BGDoXpRNlIM bvAw== X-Gm-Message-State: AOJu0YxfEU5mjlHMpr64FZMo4BE1WcFkDV3QJMkzYIQIaP66LtK4NNeS O7/KToYntX1R94mqBKwm5u2lcdhPqhKR3prmcVU= X-Received: by 2002:a05:6a20:3d82:b0:17b:689e:c751 with SMTP id s2-20020a056a203d8200b0017b689ec751mr15609338pzi.5.1698888844915; Wed, 01 Nov 2023 18:34:04 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 54/88] target/hppa: Implement STDBY Date: Wed, 1 Nov 2023 18:29:42 -0700 Message-Id: <20231102013016.369010-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/helper.h | 5 ++ target/hppa/insns.decode | 1 + target/hppa/op_helper.c | 178 +++++++++++++++++++++++++++++++++++++-- target/hppa/translate.c | 31 +++++++ 4 files changed, 210 insertions(+), 5 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 647f043c85..9920d38ded 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -16,6 +16,11 @@ DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_b, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_e, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) + DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index ba7731b517..9d8c6a1a16 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -228,6 +228,7 @@ lda 000011 ..... ..... .. . 0 -- 0100 ...... @ldstx size=3 sta 000011 ..... ..... .. . 1 -- 1110 ...... @stim5 size=2 sta 000011 ..... ..... .. . 1 -- 1111 ...... @stim5 size=3 stby 000011 b:5 r:5 sp:2 a:1 1 -- 1100 m:1 ..... disp=%im5_0 +stdby 000011 b:5 r:5 sp:2 a:1 1 -- 1101 m:1 ..... disp=%im5_0 @fldstwx ...... b:5 x:5 sp:2 scale:1 ....... m:1 ..... \ &ldst t=%rt64 disp=0 size=2 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 837e2b3117..94c9ca5858 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -56,11 +56,11 @@ void HELPER(tcond)(CPUHPPAState *env, target_ureg cond) } } -static void atomic_store_3(CPUHPPAState *env, target_ulong addr, - uint32_t val, uintptr_t ra) +static void atomic_store_mask32(CPUHPPAState *env, target_ulong addr, + uint32_t val, uint32_t mask, uintptr_t ra) { int mmu_idx = cpu_mmu_index(env, 0); - uint32_t old, new, cmp, mask, *haddr; + uint32_t old, new, cmp, *haddr; void *vaddr; vaddr = probe_access(env, addr, 3, MMU_DATA_STORE, mmu_idx, ra); @@ -81,6 +81,35 @@ static void atomic_store_3(CPUHPPAState *env, target_ulong addr, } } +static void atomic_store_mask64(CPUHPPAState *env, target_ulong addr, + uint64_t val, uint64_t mask, + int size, uintptr_t ra) +{ +#ifdef CONFIG_ATOMIC64 + int mmu_idx = cpu_mmu_index(env, 0); + uint64_t old, new, cmp, *haddr; + void *vaddr; + + vaddr = probe_access(env, addr, size, MMU_DATA_STORE, mmu_idx, ra); + if (vaddr == NULL) { + cpu_loop_exit_atomic(env_cpu(env), ra); + } + haddr = (uint64_t *)((uintptr_t)vaddr & -8); + + old = *haddr; + while (1) { + new = be32_to_cpu((cpu_to_be32(old) & ~mask) | (val & mask)); + cmp = qatomic_cmpxchg__nocheck(haddr, old, new); + if (cmp == old) { + return; + } + old = cmp; + } +#else + cpu_loop_exit_atomic(env_cpu(env), ra); +#endif +} + static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, bool parallel, uintptr_t ra) { @@ -94,7 +123,7 @@ static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, case 1: /* The 3 byte store must appear atomic. */ if (parallel) { - atomic_store_3(env, addr, val, ra); + atomic_store_mask32(env, addr, val, 0x00ffffffu, ra); } else { cpu_stb_data_ra(env, addr, val >> 16, ra); cpu_stw_data_ra(env, addr + 1, val, ra); @@ -106,6 +135,62 @@ static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, } } +static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val, + bool parallel, uintptr_t ra) +{ + switch (addr & 7) { + case 7: + cpu_stb_data_ra(env, addr, val, ra); + break; + case 6: + cpu_stw_data_ra(env, addr, val, ra); + break; + case 5: + /* The 3 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask32(env, addr, val, 0x00ffffffu, ra); + } else { + cpu_stb_data_ra(env, addr, val >> 16, ra); + cpu_stw_data_ra(env, addr + 1, val, ra); + } + break; + case 4: + cpu_stl_data_ra(env, addr, val, ra); + break; + case 3: + /* The 5 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr, val, 0x000000ffffffffffull, 5, ra); + } else { + cpu_stb_data_ra(env, addr, val >> 32, ra); + cpu_stl_data_ra(env, addr + 1, val, ra); + } + break; + case 2: + /* The 6 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr, val, 0x0000ffffffffffffull, 6, ra); + } else { + cpu_stw_data_ra(env, addr, val >> 32, ra); + cpu_stl_data_ra(env, addr + 2, val, ra); + } + break; + case 1: + /* The 7 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr, val, 0x00ffffffffffffffull, 7, ra); + } else { + cpu_stb_data_ra(env, addr, val >> 48, ra); + cpu_stw_data_ra(env, addr + 1, val >> 32, ra); + cpu_stl_data_ra(env, addr + 3, val, ra); + } + break; + default: + cpu_stl_data_ra(env, addr, val, ra); + break; + } +} + void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) { do_stby_b(env, addr, val, false, GETPC()); @@ -117,6 +202,17 @@ void HELPER(stby_b_parallel)(CPUHPPAState *env, target_ulong addr, do_stby_b(env, addr, val, true, GETPC()); } +void HELPER(stdby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) +{ + do_stdby_b(env, addr, val, false, GETPC()); +} + +void HELPER(stdby_b_parallel)(CPUHPPAState *env, target_ulong addr, + target_ureg val) +{ + do_stdby_b(env, addr, val, true, GETPC()); +} + static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val, bool parallel, uintptr_t ra) { @@ -124,7 +220,68 @@ static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val, case 3: /* The 3 byte store must appear atomic. */ if (parallel) { - atomic_store_3(env, addr - 3, val, ra); + atomic_store_mask32(env, addr - 3, val, 0xffffff00u, ra); + } else { + cpu_stw_data_ra(env, addr - 3, val >> 16, ra); + cpu_stb_data_ra(env, addr - 1, val >> 8, ra); + } + break; + case 2: + cpu_stw_data_ra(env, addr - 2, val >> 16, ra); + break; + case 1: + cpu_stb_data_ra(env, addr - 1, val >> 24, ra); + break; + default: + /* Nothing is stored, but protection is checked and the + cacheline is marked dirty. */ + probe_write(env, addr, 0, cpu_mmu_index(env, 0), ra); + break; + } +} + +static void do_stdby_e(CPUHPPAState *env, target_ulong addr, uint64_t val, + bool parallel, uintptr_t ra) +{ + switch (addr & 7) { + case 7: + /* The 7 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr - 7, val, + 0xffffffffffffff00ull, 7, ra); + } else { + cpu_stl_data_ra(env, addr - 7, val >> 32, ra); + cpu_stw_data_ra(env, addr - 3, val >> 16, ra); + cpu_stb_data_ra(env, addr - 1, val >> 8, ra); + } + break; + case 6: + /* The 6 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr - 6, val, + 0xffffffffffff0000ull, 6, ra); + } else { + cpu_stl_data_ra(env, addr - 6, val >> 32, ra); + cpu_stw_data_ra(env, addr - 2, val >> 16, ra); + } + break; + case 5: + /* The 5 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr - 5, val, + 0xffffffffff000000ull, 5, ra); + } else { + cpu_stl_data_ra(env, addr - 5, val >> 32, ra); + cpu_stb_data_ra(env, addr - 1, val >> 24, ra); + } + break; + case 4: + cpu_stl_data_ra(env, addr - 4, val >> 32, ra); + break; + case 3: + /* The 3 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask32(env, addr - 3, val, 0xffffff00u, ra); } else { cpu_stw_data_ra(env, addr - 3, val >> 16, ra); cpu_stb_data_ra(env, addr - 1, val >> 8, ra); @@ -155,6 +312,17 @@ void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, do_stby_e(env, addr, val, true, GETPC()); } +void HELPER(stdby_e)(CPUHPPAState *env, target_ulong addr, target_ureg val) +{ + do_stdby_e(env, addr, val, false, GETPC()); +} + +void HELPER(stdby_e_parallel)(CPUHPPAState *env, target_ulong addr, + target_ureg val) +{ + do_stdby_e(env, addr, val, true, GETPC()); +} + void HELPER(ldc_check)(target_ulong addr) { if (unlikely(addr & 0xf)) { diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 91249d89ca..e16b1c5399 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3052,6 +3052,37 @@ static bool trans_stby(DisasContext *ctx, arg_stby *a) return nullify_end(ctx); } +static bool trans_stdby(DisasContext *ctx, arg_stby *a) +{ + TCGv_reg ofs, val; + TCGv_tl addr; + + nullify_over(ctx); + + form_gva(ctx, &addr, &ofs, a->b, 0, 0, a->disp, a->sp, a->m, + ctx->mmu_idx == MMU_PHYS_IDX); + val = load_gpr(ctx, a->r); + if (a->a) { + if (tb_cflags(ctx->base.tb) & CF_PARALLEL) { + gen_helper_stdby_e_parallel(tcg_env, addr, val); + } else { + gen_helper_stdby_e(tcg_env, addr, val); + } + } else { + if (tb_cflags(ctx->base.tb) & CF_PARALLEL) { + gen_helper_stdby_b_parallel(tcg_env, addr, val); + } else { + gen_helper_stdby_b(tcg_env, addr, val); + } + } + if (a->m) { + tcg_gen_andi_reg(ofs, ofs, ~7); + save_gpr(ctx, a->b, ofs); + } + + return nullify_end(ctx); +} + static bool trans_lda(DisasContext *ctx, arg_ldst *a) { int hold_mmu_idx = ctx->mmu_idx; From patchwork Thu Nov 2 01:29:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740423 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp598446wrv; Wed, 1 Nov 2023 18:50:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkE+Vhz6uwAmmMbuiRw/mJjWo38TWIqNQgOf6N+5gF6iF8OHO75Cs7wmKROtXQzJgSzYJb X-Received: by 2002:a05:6214:4012:b0:66d:11fd:c9c4 with SMTP id kd18-20020a056214401200b0066d11fdc9c4mr18439467qvb.46.1698889843320; Wed, 01 Nov 2023 18:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889843; cv=none; d=google.com; s=arc-20160816; b=Uwz0wjUE+BnKUoy33P1QsO80zu3bpiXz/mfb3qzD4tLevBHXblzY7CVZ4jX8ADQjMu NPbg7F+RFJg1A7QWMC/i/qZ8DxViFaWeuJ75yzGOFhBPwk10b12IqyCbOstTV7cZzIUW BfIicEvebnj6MUbUxVqFvG3GB8nbuH7d+Jk36GeKL0fQVDQtYflc4yllr7urWgODZyl6 4mrPPaaY+FVcm0Su+2QRy4BPepf/DuCvz1wGKRdtIiz+uU9hKyxXi/rcSzqi2oWiBAN1 UsB30O8vODLQDEpwRnzeLbK7Xw6hzPPukSQtNPCY2awFrUfSLVuujDpMlpZctJoFuQ6G nFBA== 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=aI6+kytQPkdhBU7NzYvCZ/HQ2OkcLrTJZGXElUg607g=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=lcHYut+K8AgZcwkq4yGmzZvcQGVeS5NG2z6wk+2EYsLbSkemsIl2ZuDqbYi66GpSBP FrNHdmaYNXWY0Ei7g4w0CSN6Q9rALRaOa07iEolk2vUbbYmVOY+cFbR01rXXKYxN2KQo tTb/qpF/0WRWR8odoH4l+PIx+jrlMZ0CMctfGtcnLBb5EZKCoULlOaVgJAX3451+tGtZ XiqAS2ovuklu7kWujmfob98xkJFh2Ytj+/mmGN3MPN9GPHSPe/IFBtJ6Z919pCn4qj2w CGz7Q+WKA3xW2bXnz8bJ8GxuGotgFKsObBsOQoFft1qj0Nm3ZuFOPEscfNWphpEaF0oU 6bTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mAj9vkOW; 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 cy16-20020a05621418d000b0065b14c19db6si3663790qvb.288.2023.11.01.18.50.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:50:43 -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=mAj9vkOW; 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 1qyMba-0006uo-9W; Wed, 01 Nov 2023 21:34:43 -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 1qyMb2-0006Rk-Rw for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:09 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb0-0001wz-R2 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:08 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c9b7c234a7so3426625ad.3 for ; Wed, 01 Nov 2023 18:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888845; x=1699493645; 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=aI6+kytQPkdhBU7NzYvCZ/HQ2OkcLrTJZGXElUg607g=; b=mAj9vkOWiEQdSgb9QUVOXmTONFgwV0A56eZldvldPMNt6B8SijHB0BdzWK8kOChdet znLX8MtO/q3+/nCy7yoGmnxkvdfn2ymPRbGAJzBZsoDPAOCzgRkktZyUL0h8sP8WBxQY xSrbuVqxwZnjGWFrB6PUNw8hhoWaPDzSkTfCvcz83M2zxI31sHEi5M1sd2P1Ri0kgbi7 C9L/reiA6cudEQR67f/tcoG1Esx7hxVY6TloqeMGrBjgUlRePHEOFNC9bs2m6+zYCzzX BYuGYYk3aYCw+y4uK2aA/PweXx8G/Rd1JIZuBBmh4rVxp14O0PycGnwaDfZtVIL7JKvp 0j9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888845; x=1699493645; 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=aI6+kytQPkdhBU7NzYvCZ/HQ2OkcLrTJZGXElUg607g=; b=PQnrFRTpzWAq9GY3oNcHAdQilyQlu+uiJinaObI2oRVkf3GlDqxeboY+2lkPlja0+b N/uZ9UjoMm2mePYBV/2Xxy3Vhy+d7zLcxSE2FNsk/yQg6wcDfAWMZHtwXeFHiMKitGC0 LXZpIpmZyxh49Zr/3wSsAowfFJeFY//BJieLUK2N/z89b/j6UuDJWdTXrxU73nEJ0lHu 9v3pqjh0wSXXiF3ar1Dib5Hrvu/iXK/vCHQCXp65ijGyxzo7IvTtsKmpJmG92JAYa5sN 08UKif7ula6Z16h2wrHrnVRIXJtn5ZQlL5scl/YUlu+zpynn9VV7qF/Zi9nfkJI1xiLY zXXg== X-Gm-Message-State: AOJu0YxVPlRA3RhLALN4fAQwNhObBudqWww/iW2Iv/G5Afqm0yMoz34P /FP0bcqb4b3g1uCIJ7//sPUNGikraRt40Zz9rIE= X-Received: by 2002:a17:903:c4:b0:1cc:3b86:cfc5 with SMTP id x4-20020a17090300c400b001cc3b86cfc5mr11095325plc.4.1698888845603; Wed, 01 Nov 2023 18:34:05 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 55/88] target/hppa: Implement IDTLBT, IITLBT Date: Wed, 1 Nov 2023 18:29:43 -0700 Message-Id: <20231102013016.369010-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Rename the existing insert tlb helpers to emphasize that they are for pa1.1 cpus. Implement a combined i/d tlb for pa2.0. Still missing is the new 'P' tlb bit. Signed-off-by: Richard Henderson --- target/hppa/helper.h | 6 ++-- target/hppa/insns.decode | 4 +++ target/hppa/mem_helper.c | 61 ++++++++++++++++++++++++++++++++++++---- target/hppa/translate.c | 42 +++++++++++++++++++++++---- 4 files changed, 100 insertions(+), 13 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 9920d38ded..0b346e24f3 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -94,8 +94,10 @@ DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tr) DEF_HELPER_FLAGS_2(write_eirr, TCG_CALL_NO_RWG, void, env, tr) DEF_HELPER_FLAGS_2(write_eiem, TCG_CALL_NO_RWG, void, env, tr) DEF_HELPER_FLAGS_2(swap_system_mask, TCG_CALL_NO_RWG, tr, env, tr) -DEF_HELPER_FLAGS_3(itlba, TCG_CALL_NO_RWG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(itlbp, TCG_CALL_NO_RWG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(itlba_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(idtlbt_pa20, TCG_CALL_NO_RWG, void, env, tr, tr) +DEF_HELPER_FLAGS_3(iitlbt_pa20, TCG_CALL_NO_RWG, void, env, tr, tr) DEF_HELPER_FLAGS_2(ptlb, TCG_CALL_NO_RWG, void, env, tl) DEF_HELPER_FLAGS_1(ptlbe, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tr, env, tl) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 9d8c6a1a16..820049b0c5 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -145,6 +145,7 @@ nop_addrx 000001 ..... ..... -- 01001110 . 00000 @addrx # pdc probe 000001 b:5 ri:5 sp:2 imm:1 100011 write:1 0 t:5 +# pa1.x tlb insert instructions ixtlbx 000001 b:5 r:5 sp:2 0100000 addr:1 0 00000 data=1 ixtlbx 000001 b:5 r:5 ... 000000 addr:1 0 00000 \ sp=%assemble_sr3x data=0 @@ -152,6 +153,9 @@ ixtlbx 000001 b:5 r:5 ... 000000 addr:1 0 00000 \ # pcxl and pcxl2 Fast TLB Insert instructions ixtlbxf 000001 00000 r:5 00 0 data:1 01000 addr:1 0 00000 +# pa2.0 tlb insert idtlbt and iitlbt instructions +ixtlbt 000001 r2:5 r1:5 000 data:1 100000 0 00000 # idtlbt + pxtlbx 000001 b:5 x:5 sp:2 0100100 local:1 m:1 ----- data=1 pxtlbx 000001 b:5 x:5 ... 000100 local:1 m:1 ----- \ sp=%assemble_sr3x data=0 diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 420b43a0f6..d5d2d62f4a 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -344,7 +344,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, } /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ -void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { HPPATLBEntry *ent; @@ -365,7 +365,8 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) trace_hppa_tlb_itlba(env, ent, ent->itree.start, ent->itree.last, ent->pa); } -static void set_access_bits(CPUHPPAState *env, HPPATLBEntry *ent, target_ureg reg) +static void set_access_bits_pa11(CPUHPPAState *env, HPPATLBEntry *ent, + target_ureg reg) { ent->access_id = extract32(reg, 1, 18); ent->u = extract32(reg, 19, 1); @@ -383,20 +384,70 @@ static void set_access_bits(CPUHPPAState *env, HPPATLBEntry *ent, target_ureg re } /* Insert (Insn/Data) TLB Protection. Note this is PA 1.1 only. */ -void HELPER(itlbp)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { HPPATLBEntry *ent = env->tlb_partial; if (ent) { env->tlb_partial = NULL; if (ent->itree.start <= addr && addr <= ent->itree.last) { - set_access_bits(env, ent, reg); + set_access_bits_pa11(env, ent, reg); return; } } qemu_log_mask(LOG_GUEST_ERROR, "ITLBP not following ITLBA\n"); } +static void itlbt_pa20(CPUHPPAState *env, target_ureg r1, + target_ureg r2, vaddr va_b) +{ + HPPATLBEntry *ent; + vaddr va_e; + uint64_t va_size; + int mask_shift; + + mask_shift = 2 * (r1 & 0xf); + va_size = TARGET_PAGE_SIZE << mask_shift; + va_b &= -va_size; + va_e = va_b + va_size - 1; + + hppa_flush_tlb_range(env, va_b, va_e); + ent = hppa_alloc_tlb_ent(env); + + ent->itree.start = va_b; + ent->itree.last = va_e; + ent->pa = (r1 << 7) & (TARGET_PAGE_MASK << mask_shift); + ent->t = extract64(r2, 61, 1); + ent->d = extract64(r2, 60, 1); + ent->b = extract64(r2, 59, 1); + ent->ar_type = extract64(r2, 56, 3); + ent->ar_pl1 = extract64(r2, 54, 2); + ent->ar_pl2 = extract64(r2, 52, 2); + ent->u = extract64(r2, 51, 1); + /* o = bit 50 */ + /* p = bit 49 */ + ent->access_id = extract64(r2, 1, 31); + ent->entry_valid = 1; + + interval_tree_insert(&ent->itree, &env->tlb_root); + trace_hppa_tlb_itlba(env, ent, ent->itree.start, ent->itree.last, ent->pa); + trace_hppa_tlb_itlbp(env, ent, ent->access_id, ent->u, + ent->ar_pl2, ent->ar_pl1, ent->ar_type, + ent->b, ent->d, ent->t); +} + +void HELPER(idtlbt_pa20)(CPUHPPAState *env, target_ureg r1, target_ureg r2) +{ + vaddr va_b = deposit64(env->cr[CR_IOR], 32, 32, env->cr[CR_ISR]); + itlbt_pa20(env, r1, r2, va_b); +} + +void HELPER(iitlbt_pa20)(CPUHPPAState *env, target_ureg r1, target_ureg r2) +{ + vaddr va_b = deposit64(env->cr[CR_IIAOQ], 32, 32, env->cr[CR_IIASQ]); + itlbt_pa20(env, r1, r2, va_b); +} + /* Purge (Insn/Data) TLB. This is explicitly page-based, and is synchronous across all processors. */ static void ptlb_work(CPUState *cpu, run_on_cpu_data data) @@ -563,7 +614,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) btlb->itree.start = virt_page << TARGET_PAGE_BITS; btlb->itree.last = btlb->itree.start + len * TARGET_PAGE_SIZE - 1; btlb->pa = phys_page << TARGET_PAGE_BITS; - set_access_bits(env, btlb, env->gr[20]); + set_access_bits_pa11(env, btlb, env->gr[20]); btlb->t = 0; btlb->d = 1; } else { diff --git a/target/hppa/translate.c b/target/hppa/translate.c index e16b1c5399..fcea715e7d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2514,6 +2514,9 @@ static bool trans_probe(DisasContext *ctx, arg_probe *a) static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) { + if (ctx->is_pa20) { + return false; + } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY TCGv_tl addr; @@ -2524,9 +2527,9 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) form_gva(ctx, &addr, &ofs, a->b, 0, 0, 0, a->sp, 0, false); reg = load_gpr(ctx, a->r); if (a->addr) { - gen_helper_itlba(tcg_env, addr, reg); + gen_helper_itlba_pa11(tcg_env, addr, reg); } else { - gen_helper_itlbp(tcg_env, addr, reg); + gen_helper_itlbp_pa11(tcg_env, addr, reg); } /* Exit TB for TLB change if mmu is enabled. */ @@ -2572,6 +2575,9 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) */ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) { + if (ctx->is_pa20) { + return false; + } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY TCGv_tl addr, atl, stl; @@ -2583,8 +2589,6 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) * FIXME: * if (not (pcxl or pcxl2)) * return gen_illegal(ctx); - * - * Note for future: these are 32-bit systems; no hppa64. */ atl = tcg_temp_new_tl(); @@ -2602,9 +2606,9 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) reg = load_gpr(ctx, a->r); if (a->addr) { - gen_helper_itlba(tcg_env, addr, reg); + gen_helper_itlba_pa11(tcg_env, addr, reg); } else { - gen_helper_itlbp(tcg_env, addr, reg); + gen_helper_itlbp_pa11(tcg_env, addr, reg); } /* Exit TB for TLB change if mmu is enabled. */ @@ -2615,6 +2619,32 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) #endif } +static bool trans_ixtlbt(DisasContext *ctx, arg_ixtlbt *a) +{ + if (!ctx->is_pa20) { + return false; + } + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + nullify_over(ctx); + { + TCGv_i64 src1 = load_gpr(ctx, a->r1); + TCGv_i64 src2 = load_gpr(ctx, a->r2); + + if (a->data) { + gen_helper_idtlbt_pa20(tcg_env, src1, src2); + } else { + gen_helper_iitlbt_pa20(tcg_env, src1, src2); + } + } + /* Exit TB for TLB change if mmu is enabled. */ + if (ctx->tb_flags & PSW_C) { + ctx->base.is_jmp = DISAS_IAQ_N_STALE; + } + return nullify_end(ctx); +#endif +} + static bool trans_lpa(DisasContext *ctx, arg_ldst *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); From patchwork Thu Nov 2 01:29:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740392 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596148wrv; Wed, 1 Nov 2023 18:41:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYfB0E5rISDswKVH1d5soKqsKJbEp4hzoGXgjyTXkIGy4uaRgXVSn5XWiKqmHM3Bl9FFyT X-Received: by 2002:ac8:5b87:0:b0:41c:d62b:fb51 with SMTP id a7-20020ac85b87000000b0041cd62bfb51mr6389939qta.26.1698889308120; Wed, 01 Nov 2023 18:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889308; cv=none; d=google.com; s=arc-20160816; b=i7UCA1Y0u01/GzzPSf5as4L5TKiZCvgwXzJ1dEIHokBVXSCrNcp/JfxIb71ieeoY2k 3Mw5nhPSD/by1HUMVfQoQf5R9JtSy2XeH7u4Ez8pRdTNh6n5YT/6E0/PWfFfQ2JXQxp2 pZZX7FXRFoG6Dj237yQ0hn6vrr5W3Nxm9QvcYYKvTPc7bqZvoeQz2/MIi1gvrd3VK3MQ u9WeLXKYkCJwzcjinDeupMuk/lMNpGNqmc2vDrBTkjTT0yc0tM39scpSab6BediaHPiA ck6MHiwsrhb4mFAkN8xMkXiy1wKzPaNxnd3+f/NvgHF6+/JFBwB13ApQAoM807fqvXN0 +kjg== 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=7uijs1bn5TXW8wsEr2aove5t1QenLBfPQgRPY54EFkA=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=DuSrPuvhPRlHcMY+CMZgH297/mS2QBeObQ7BnFSRCywun55Hiagc3Df6LGJfCBFU7k nJLDB6yiwcfwhB9OyOjZSfKRBYeltCMlkYTRxhp5KsgIs3Y+deohRsstPYiQ8rCpHHi9 fei2HYXC48aam1prcmovn9/wmVe8MMlaLgg08yOP/hFP7QMzxFR2Usr264eAMsroeA6N 1d0fXKH9Bug+G4J4bax1AuefTlUmeCTSgbHuvVzm5UEv/6wPptT/mTYanPHZUgmviuRx hUsCAPMUO2RLIB2hcmw3eU7a/BcqCbkX9kJzdtJlqgTcA9ShHkdywNowkTODTWizYOMc Cjaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=datj6WQI; 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 c17-20020a05622a059100b0041cc5e9877dsi3643749qtb.746.2023.11.01.18.41.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:41:48 -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=datj6WQI; 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 1qyMcW-00080r-3e; Wed, 01 Nov 2023 21:35:40 -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 1qyMb3-0006Ry-SQ for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:11 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb1-0001xB-Oc for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:09 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cc30bf9e22so3686485ad.1 for ; Wed, 01 Nov 2023 18:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888846; x=1699493646; 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=7uijs1bn5TXW8wsEr2aove5t1QenLBfPQgRPY54EFkA=; b=datj6WQIZmJbqOuVr6Uy39Ddm1TmGo16xJ9HrnGpO6ZCLjeBsjiTBA2nSJgOfbzh7T X6Uq+Op+KheTHoec7YXcJ9KPUxoSwpbFoCIIYXhtnTlDzd+FgOA5qm2Usx/dpgIsTWa5 gFqdZqyd5nDUx/PujjNEXdsGef6+Ii7lIl7HGGCsc4T2T6XW6JrDubtz4Ws3qyAsDetO djnDohBKxRnLvf9R+JViRdm4IlamUzxNZ7TWj5VBZvl4Hf6swWNH3DgUyz7wALt7z1F4 YxU83OW4+ND6YWtJPPsSmMq3lWFTVrUkIduX9k/QnFyjUAaOaoHChSP+BqT4N0vV7anL 0Hgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888846; x=1699493646; 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=7uijs1bn5TXW8wsEr2aove5t1QenLBfPQgRPY54EFkA=; b=kbnDkSbZ+BlgK0YyqEvHhxEBHNphhzwuwXcG2P4j2js0wI9CVZa/YKCTYHOXa5TKyR 7cOb5ouGyp9UBpB7SEz8hwbUAdMLjnX6fVJ/eOvshk0PtWcdemGLsKySgDewVU5Y2D44 X3yvDudcA8CSQRA5aCIMJqLjST4gweWwSKjJkf5jWqxAp/JFQNLhknb+Wb4pyiNGCZ7d ivbMGy77uwkGZ74ThcFCZvQklSodKqX3XPfnN4I3Fb1iWtGlV+HV5XRzSE3z4j1XnHop ZUp8JZVQivjFspXSLR2WZNR0LKYSfragKTLR3tOZr3L3I/O2MN9cXVh6Qji9IGD1Sgfl Ej3A== X-Gm-Message-State: AOJu0YzCrSe+DoiK1jNioCCJ/wPIoYO1z1AlWp7d/R+1/5mJAJNuDxZj ftyxLr4XYiH9YRSV2RKhl/+gSewhdyZ7hXW1prc= X-Received: by 2002:a17:902:dac9:b0:1cc:2518:ef02 with SMTP id q9-20020a170902dac900b001cc2518ef02mr6226228plx.14.1698888846418; Wed, 01 Nov 2023 18:34:06 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 56/88] hw/hppa: Use uint32_t instead of target_ureg Date: Wed, 1 Nov 2023 18:29:44 -0700 Message-Id: <20231102013016.369010-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, T_SCC_BODY_TEXT_LINE=-0.01 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 The size of target_ureg is going to change. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- hw/hppa/machine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 85682e6bab..1f09b4b490 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -391,9 +391,9 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) true, EM_PARISC, 0, 0); /* Unfortunately, load_elf sign-extends reading elf32. */ - firmware_entry = (target_ureg)firmware_entry; - firmware_low = (target_ureg)firmware_low; - firmware_high = (target_ureg)firmware_high; + firmware_entry = (uint32_t)firmware_entry; + firmware_low = (uint32_t)firmware_low; + firmware_high = (uint32_t)firmware_high; if (size < 0) { error_report("could not load firmware '%s'", firmware_filename); @@ -420,9 +420,9 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) true, EM_PARISC, 0, 0); /* Unfortunately, load_elf sign-extends reading elf32. */ - kernel_entry = (target_ureg) cpu_hppa_to_phys(NULL, kernel_entry); - kernel_low = (target_ureg)kernel_low; - kernel_high = (target_ureg)kernel_high; + kernel_entry = (uint32_t) cpu_hppa_to_phys(NULL, kernel_entry); + kernel_low = (uint32_t)kernel_low; + kernel_high = (uint32_t)kernel_high; if (size < 0) { error_report("could not load kernel '%s'", kernel_filename); From patchwork Thu Nov 2 01:29:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740402 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596393wrv; Wed, 1 Nov 2023 18:42:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGGZSFh7x7ab1fLx1OaFclFflwSNfATsfd6ZHzN6vSNXUssBauv0hGcCPiQkE2bGrnHMgc X-Received: by 2002:a05:620a:3859:b0:76e:f496:1928 with SMTP id po25-20020a05620a385900b0076ef4961928mr13349712qkn.72.1698889362182; Wed, 01 Nov 2023 18:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889362; cv=none; d=google.com; s=arc-20160816; b=bU/cOtivnGjQ7bP4juMYU8f3Ul0/YMM83mXz0TarUrKoC/ks0t5JUM/zSnVIxxvWWE NLNd7PlI/vMOgcToQHqnAvr0Edb7lyJE2GOaPYCf+SDeEoU3fpeVCDIk375dL68S4D0P x62BehcRyBHUsgJT+qbrOyqD7/5pQtx4WfueI4JVEDAWM/Thz5Bo5wNc21Lh6yjlod4/ Gc76YHVLeJoc55T9/xeetXz8rrd+U89e86RMurszCZzPoRc9+Fc41MgAUZqKZ82Agm/7 yDY0hccbOu5kOxgl2ANxrSRqd+kEuRFJvbJDZew2nnCSNginYde26ioLq2uwvhwDJRfp Mexw== 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=eE2aZpyuxb0N5OKnIBX+5KHEBhkmRjXaZfh5L77YXo0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=YvWE+N6RYR8Vjw1GpF7SC53BpuodD6bXhwECsF+pfvr6HBcskmQYtVqMyJwqChYY6+ VkBwbEbNPlaRW2+Ij3Ttvlgnm4B2eniTHj5FMv2qsToJShrIOYPvYPlKxiphqlOv4JPJ qlrhe6X5GyX3CMzyQ1rqxXOJjV4qdxP09XZv/sTb70P2e9Qigjg/z1hbTj+hnuD5VL34 lguwQBAQVS7r66uQIzAiUD2YG8osJNrBeDKsqlV6k7XgzK3/pwuM4glrpGOdE7ULdnWe muonH6no/yi5LGwtSKdnrdboR+uWHcAR8j5q2niSLEBKgslLYGaQ4gok14kOlsmvRDDP enqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yjosQc5G; 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 17-20020a05620a049100b007759c22e907si3532543qkr.142.2023.11.01.18.42.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42:42 -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=yjosQc5G; 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 1qyMbY-0006uJ-D2; Wed, 01 Nov 2023 21:34:41 -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 1qyMb7-0006XX-Ba for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:14 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb2-0001xN-Kw for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:13 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cc58219376so3532325ad.1 for ; Wed, 01 Nov 2023 18:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888847; x=1699493647; 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=eE2aZpyuxb0N5OKnIBX+5KHEBhkmRjXaZfh5L77YXo0=; b=yjosQc5Gl9dvI0Se8XjvNd68jfjmKRlk2ZS80DDbekkmsItxz6NSyg2U8v8YMBgdBz NyhJ4TAeR1eCMmKJycdnb+P2E6hlxRa6pFRGN959vvrbMIJEe4HUe7EVIlI7PNuvn28G NgQ/ck8nKmR+n2dej5EhAPAtiD7ovI2LihJRVHLu4gTma4BSBdQvBD4x5pWJKd8mpkrZ N//hZUVAXKa2n7Yuzd+dd1VhfbhLdmnt+H6Dmnx7jDDtvlSCw2WnDDqKrkQknXVy5G7E sUJe0CGrSqBew6Pzhv4pFnGD+R0Ms6c5vCB3qhp4l04oXssSjNZhfiycBd4AU8+SNjZf xd1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888847; x=1699493647; 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=eE2aZpyuxb0N5OKnIBX+5KHEBhkmRjXaZfh5L77YXo0=; b=U9Gcc/2oPmGZRmNlosMW5FLKwNSrGHjIgHpoNt41IZ2hIPkUNIJV8Nted+mg14p15+ hGFOtsR4RgBVIiuFQo26WvIX9yrwlavpLVFevwvV1YwdaQevBsY9tBsYIn8j7qc+l6fw clNlOSD+HGN/VqcCttuRL2mqI48WfXj/FxO1l9NmuW4X1gvP4RUVx6uKCWdYcSzi3PuZ hywPm8LLqBYWTs8sTqRkl5lije7J5WdiQzPsO6TXSL64fcCqMCFAOFiLLc6APPSgRMDP N57dlo9XZrlCC9k5W75nVI3XQ5grKAdb5bOH7UZDg+gSC+70QD3dZdPQ9nLruJk7C73M Ba3g== X-Gm-Message-State: AOJu0YxupSnIVNfBhwxPQ+7E4k2KCJmTNETuMzamVzzT9IEbdKOFgsKe WkNqqc5n7diqGOZuLQ22xetl7ynjkSP2UvNb0IE= X-Received: by 2002:a17:903:1246:b0:1c7:495c:87e0 with SMTP id u6-20020a170903124600b001c7495c87e0mr21245685plh.37.1698888847231; Wed, 01 Nov 2023 18:34:07 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 57/88] target/hppa: Remove TARGET_REGISTER_BITS Date: Wed, 1 Nov 2023 18:29:45 -0700 Message-Id: <20231102013016.369010-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Rely only on TARGET_LONG_BITS, fixed at 64, and hppa_is_pa20. Signed-off-by: Richard Henderson --- target/hppa/cpu-param.h | 1 - target/hppa/cpu.h | 50 ++++------- target/hppa/helper.h | 51 +++++------ target/hppa/cpu.c | 2 +- target/hppa/helper.c | 32 +++---- target/hppa/int_helper.c | 17 ++-- target/hppa/machine.c | 45 +++------- target/hppa/mem_helper.c | 16 ++-- target/hppa/op_helper.c | 30 +++---- target/hppa/sys_helper.c | 4 +- target/hppa/translate.c | 186 ++++++++------------------------------- 11 files changed, 135 insertions(+), 299 deletions(-) diff --git a/target/hppa/cpu-param.h b/target/hppa/cpu-param.h index 2fb8e7924b..6746869a3b 100644 --- a/target/hppa/cpu-param.h +++ b/target/hppa/cpu-param.h @@ -9,7 +9,6 @@ #define HPPA_CPU_PARAM_H #define TARGET_LONG_BITS 64 -#define TARGET_REGISTER_BITS 64 #if defined(CONFIG_USER_ONLY) && defined(TARGET_ABI32) # define TARGET_PHYS_ADDR_SPACE_BITS 32 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 77ddb20ac2..ea676ba062 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -154,25 +154,13 @@ #define CR_IPSW 22 #define CR_EIRR 23 -#if TARGET_REGISTER_BITS == 32 -typedef uint32_t target_ureg; -typedef int32_t target_sreg; -#define TREG_FMT_lx "%08"PRIx32 -#define TREG_FMT_ld "%"PRId32 -#else -typedef uint64_t target_ureg; -typedef int64_t target_sreg; -#define TREG_FMT_lx "%016"PRIx64 -#define TREG_FMT_ld "%"PRId64 -#endif - typedef struct HPPATLBEntry { union { IntervalTreeNode itree; struct HPPATLBEntry *unused_next; }; - target_ureg pa; + target_ulong pa; unsigned entry_valid : 1; @@ -187,16 +175,16 @@ typedef struct HPPATLBEntry { } HPPATLBEntry; typedef struct CPUArchState { - target_ureg iaoq_f; /* front */ - target_ureg iaoq_b; /* back, aka next instruction */ + target_ulong iaoq_f; /* front */ + target_ulong iaoq_b; /* back, aka next instruction */ - target_ureg gr[32]; + target_ulong gr[32]; uint64_t fr[32]; uint64_t sr[8]; /* stored shifted into place for gva */ - target_ureg psw; /* All psw bits except the following: */ - target_ureg psw_n; /* boolean */ - target_sreg psw_v; /* in most significant bit */ + target_ulong psw; /* All psw bits except the following: */ + target_ulong psw_n; /* boolean */ + target_long psw_v; /* in most significant bit */ /* Splitting the carry-borrow field into the MSB and "the rest", allows * for "the rest" to be deleted when it is unused, but the MSB is in use. @@ -205,8 +193,8 @@ typedef struct CPUArchState { * host has the appropriate add-with-carry insn to compute the msb). * Therefore the carry bits are stored as: cb_msb : cb & 0x11111110. */ - target_ureg psw_cb; /* in least significant bit of next nibble */ - target_ureg psw_cb_msb; /* boolean */ + target_ulong psw_cb; /* in least significant bit of next nibble */ + target_ulong psw_cb_msb; /* boolean */ uint64_t iasq_f; uint64_t iasq_b; @@ -214,9 +202,9 @@ typedef struct CPUArchState { uint32_t fr0_shadow; /* flags, c, ca/cq, rm, d, enables */ float_status fp_status; - target_ureg cr[32]; /* control registers */ - target_ureg cr_back[2]; /* back of cr17/cr18 */ - target_ureg shadow[7]; /* shadow registers */ + target_ulong cr[32]; /* control registers */ + target_ulong cr_back[2]; /* back of cr17/cr18 */ + target_ulong shadow[7]; /* shadow registers */ /* * ??? The number of entries isn't specified by the architecture. @@ -287,8 +275,8 @@ void hppa_translate_init(void); #define CPU_RESOLVING_TYPE TYPE_HPPA_CPU -static inline target_ulong hppa_form_gva_psw(target_ureg psw, uint64_t spc, - target_ureg off) +static inline target_ulong hppa_form_gva_psw(target_ulong psw, uint64_t spc, + target_ulong off) { #ifdef CONFIG_USER_ONLY return off; @@ -299,7 +287,7 @@ static inline target_ulong hppa_form_gva_psw(target_ureg psw, uint64_t spc, } static inline target_ulong hppa_form_gva(CPUHPPAState *env, uint64_t spc, - target_ureg off) + target_ulong off) { return hppa_form_gva_psw(env->psw, spc, off); } @@ -343,8 +331,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, which is the primary case we care about -- using goto_tb within a page. Failure is indicated by a zero difference. */ if (env->iasq_f == env->iasq_b) { - target_sreg diff = env->iaoq_b - env->iaoq_f; - if (TARGET_REGISTER_BITS == 32 || diff == (int32_t)diff) { + target_long diff = env->iaoq_b - env->iaoq_f; + if (diff == (int32_t)diff) { *cs_base |= (uint32_t)diff; } } @@ -358,8 +346,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, *pflags = flags; } -target_ureg cpu_hppa_get_psw(CPUHPPAState *env); -void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg); +target_ulong cpu_hppa_get_psw(CPUHPPAState *env); +void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong); void cpu_hppa_loaded_fr0(CPUHPPAState *env); #ifdef CONFIG_USER_ONLY diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 0b346e24f3..57ea5447b6 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -1,29 +1,20 @@ -#if TARGET_REGISTER_BITS == 64 -# define dh_alias_tr i64 -# define dh_typecode_tr dh_typecode_i64 -#else -# define dh_alias_tr i32 -# define dh_typecode_tr dh_typecode_i32 -#endif -#define dh_ctype_tr target_ureg - DEF_HELPER_2(excp, noreturn, env, int) -DEF_HELPER_FLAGS_2(tsv, TCG_CALL_NO_WG, void, env, tr) -DEF_HELPER_FLAGS_2(tcond, TCG_CALL_NO_WG, void, env, tr) +DEF_HELPER_FLAGS_2(tsv, TCG_CALL_NO_WG, void, env, tl) +DEF_HELPER_FLAGS_2(tcond, TCG_CALL_NO_WG, void, env, tl) -DEF_HELPER_FLAGS_3(stby_b, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stby_b, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tl) -DEF_HELPER_FLAGS_3(stdby_b, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stdby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stdby_e, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_b, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stdby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stdby_e, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) -DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32) +DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tl, env, tl, i32, i32) DEF_HELPER_FLAGS_1(loaded_fr0, TCG_CALL_NO_RWG, void, env) @@ -82,7 +73,7 @@ DEF_HELPER_FLAGS_4(fmpynfadd_s, TCG_CALL_NO_RWG, i32, env, i32, i32, i32) DEF_HELPER_FLAGS_4(fmpyfadd_d, TCG_CALL_NO_RWG, i64, env, i64, i64, i64) DEF_HELPER_FLAGS_4(fmpynfadd_d, TCG_CALL_NO_RWG, i64, env, i64, i64, i64) -DEF_HELPER_FLAGS_0(read_interval_timer, TCG_CALL_NO_RWG, tr) +DEF_HELPER_FLAGS_0(read_interval_timer, TCG_CALL_NO_RWG, tl) #ifndef CONFIG_USER_ONLY DEF_HELPER_1(halt, noreturn, env) @@ -90,17 +81,17 @@ DEF_HELPER_1(reset, noreturn, env) DEF_HELPER_1(getshadowregs, void, env) DEF_HELPER_1(rfi, void, env) DEF_HELPER_1(rfi_r, void, env) -DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tr) -DEF_HELPER_FLAGS_2(write_eirr, TCG_CALL_NO_RWG, void, env, tr) -DEF_HELPER_FLAGS_2(write_eiem, TCG_CALL_NO_RWG, void, env, tr) -DEF_HELPER_FLAGS_2(swap_system_mask, TCG_CALL_NO_RWG, tr, env, tr) -DEF_HELPER_FLAGS_3(itlba_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(idtlbt_pa20, TCG_CALL_NO_RWG, void, env, tr, tr) -DEF_HELPER_FLAGS_3(iitlbt_pa20, TCG_CALL_NO_RWG, void, env, tr, tr) +DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_2(write_eirr, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_2(write_eiem, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_2(swap_system_mask, TCG_CALL_NO_RWG, tl, env, tl) +DEF_HELPER_FLAGS_3(itlba_pa11, TCG_CALL_NO_RWG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(idtlbt_pa20, TCG_CALL_NO_RWG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(iitlbt_pa20, TCG_CALL_NO_RWG, void, env, tl, tl) DEF_HELPER_FLAGS_2(ptlb, TCG_CALL_NO_RWG, void, env, tl) DEF_HELPER_FLAGS_1(ptlbe, TCG_CALL_NO_RWG, void, env) -DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tr, env, tl) +DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tl, env, tl) DEF_HELPER_FLAGS_1(change_prot_id, TCG_CALL_NO_RWG, void, env) DEF_HELPER_1(diag_btlb, void, env) #endif diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 9582619be2..e1597ba8a5 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -77,7 +77,7 @@ static void hppa_restore_state_to_opc(CPUState *cs, HPPACPU *cpu = HPPA_CPU(cs); cpu->env.iaoq_f = data[0]; - if (data[1] != (target_ureg)-1) { + if (data[1] != (target_ulong)-1) { cpu->env.iaoq_b = data[1]; } /* diff --git a/target/hppa/helper.c b/target/hppa/helper.c index c973b65bea..859644c47a 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -25,31 +25,25 @@ #include "exec/helper-proto.h" #include "qemu/qemu-print.h" -target_ureg cpu_hppa_get_psw(CPUHPPAState *env) +target_ulong cpu_hppa_get_psw(CPUHPPAState *env) { - target_ureg psw; - target_ureg mask1 = (target_ureg)-1 / 0xf; - target_ureg maskf = (target_ureg)-1 / 0xffff * 0xf; + target_ulong psw; + target_ulong mask1 = (target_ulong)-1 / 0xf; + target_ulong maskf = (target_ulong)-1 / 0xffff * 0xf; /* Fold carry bits down to 8 consecutive bits. */ /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^i^^^j^^^k^^^l^^^m^^^n^^^o^^^p^^^^ */ - /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^^ */ psw = (env->psw_cb >> 4) & mask1; /* .......b...c...d...e...f...g...h...i...j...k...l...m...n...o...p */ - /* .......b...c...d...e...f...g...h */ psw |= psw >> 3; /* .......b..bc..cd..de..ef..fg..gh..hi..ij..jk..kl..lm..mn..no..op */ - /* .......b..bc..cd..de..ef..fg..gh */ psw |= psw >> 6; psw &= maskf; /* .............bcd............efgh............ijkl............mnop */ - /* .............bcd............efgh */ psw |= psw >> 12; /* .............bcd.........bcdefgh........efghijkl........ijklmnop */ - /* .............bcd.........bcdefgh */ - psw |= env->psw_cb_msb << (TARGET_REGISTER_BITS == 64 ? 39 : 7); + psw |= env->psw_cb_msb << 39; /* .............bcd........abcdefgh........efghijkl........ijklmnop */ - /* .............bcd........abcdefgh */ /* For hppa64, the two 8-bit fields are discontiguous. */ if (hppa_is_pa20(env)) { @@ -65,10 +59,10 @@ target_ureg cpu_hppa_get_psw(CPUHPPAState *env) return psw; } -void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) +void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong psw) { uint64_t reserved; - target_ureg cb = 0; + target_ulong cb = 0; /* Do not allow reserved bits to be set. */ if (hppa_is_pa20(env)) { @@ -86,9 +80,6 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) env->psw_n = (psw / PSW_N) & 1; env->psw_v = -((psw / PSW_V) & 1); -#if TARGET_REGISTER_BITS == 32 - env->psw_cb_msb = (psw >> 15) & 1; -#else env->psw_cb_msb = (psw >> 39) & 1; cb |= ((psw >> 38) & 1) << 60; cb |= ((psw >> 37) & 1) << 56; @@ -98,7 +89,6 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) cb |= ((psw >> 33) & 1) << 40; cb |= ((psw >> 32) & 1) << 36; cb |= ((psw >> 15) & 1) << 32; -#endif cb |= ((psw >> 14) & 1) << 28; cb |= ((psw >> 13) & 1) << 24; cb |= ((psw >> 12) & 1) << 20; @@ -112,8 +102,8 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) { CPUHPPAState *env = cpu_env(cs); - target_ureg psw = cpu_hppa_get_psw(env); - target_ureg psw_cb; + target_ulong psw = cpu_hppa_get_psw(env); + target_ulong psw_cb; char psw_c[20]; int i, w; uint64_t m; @@ -151,8 +141,8 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) psw_c[16] = (psw & PSW_D ? 'D' : '-'); psw_c[17] = (psw & PSW_I ? 'I' : '-'); psw_c[18] = '\0'; - psw_cb = ((env->psw_cb >> 4) & ((target_ureg)-1 / 0xf)) - | (env->psw_cb_msb << (TARGET_REGISTER_BITS - 4)); + psw_cb = ((env->psw_cb >> 4) & 0x1111111111111111ull) + | (env->psw_cb_msb << 60); qemu_fprintf(f, "PSW %0*" PRIx64 " CB %0*" PRIx64 " %s\n", w, m & psw, w, m & psw_cb, psw_c); diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 3ab9934a1d..f355c4c76b 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -52,9 +52,9 @@ static void io_eir_write(void *opaque, hwaddr addr, uint64_t data, unsigned size) { HPPACPU *cpu = opaque; - int le_bit = ~data & (TARGET_REGISTER_BITS - 1); + int le_bit = ~data & 31; - cpu->env.cr[CR_EIRR] |= (target_ureg)1 << le_bit; + cpu->env.cr[CR_EIRR] |= (target_ulong)1 << le_bit; eval_interrupt(cpu); } @@ -73,7 +73,7 @@ void hppa_cpu_alarm_timer(void *opaque) io_eir_write(opaque, 0, 0, 4); } -void HELPER(write_eirr)(CPUHPPAState *env, target_ureg val) +void HELPER(write_eirr)(CPUHPPAState *env, target_ulong val) { env->cr[CR_EIRR] &= ~val; qemu_mutex_lock_iothread(); @@ -81,7 +81,7 @@ void HELPER(write_eirr)(CPUHPPAState *env, target_ureg val) qemu_mutex_unlock_iothread(); } -void HELPER(write_eiem)(CPUHPPAState *env, target_ureg val) +void HELPER(write_eiem)(CPUHPPAState *env, target_ulong val) { env->cr[CR_EIEM] = val; qemu_mutex_lock_iothread(); @@ -94,12 +94,11 @@ void hppa_cpu_do_interrupt(CPUState *cs) HPPACPU *cpu = HPPA_CPU(cs); CPUHPPAState *env = &cpu->env; int i = cs->exception_index; - target_ureg iaoq_f = env->iaoq_f; - target_ureg iaoq_b = env->iaoq_b; + target_ulong iaoq_f = env->iaoq_f; + target_ulong iaoq_b = env->iaoq_b; uint64_t iasq_f = env->iasq_f; uint64_t iasq_b = env->iasq_b; - - target_ureg old_psw; + target_ulong old_psw; /* As documented in pa2.0 -- interruption handling. */ /* step 1 */ @@ -240,7 +239,7 @@ void hppa_cpu_do_interrupt(CPUState *cs) name = unknown; } qemu_log("INT %6d: %s @ " TARGET_FMT_lx "," TARGET_FMT_lx - " -> " TREG_FMT_lx " " TARGET_FMT_lx "\n", + " -> " TARGET_FMT_lx " " TARGET_FMT_lx "\n", ++count, name, hppa_form_gva(env, iasq_f, iaoq_f), hppa_form_gva(env, iasq_b, iaoq_b), diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 473305ffea..f6df4deac5 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -21,33 +21,12 @@ #include "cpu.h" #include "migration/cpu.h" -#if TARGET_REGISTER_BITS == 64 -#define qemu_put_betr qemu_put_be64 -#define qemu_get_betr qemu_get_be64 -#define VMSTATE_UINTTR_V(_f, _s, _v) \ - VMSTATE_UINT64_V(_f, _s, _v) -#define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \ - VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) -#else -#define qemu_put_betr qemu_put_be32 -#define qemu_get_betr qemu_get_be32 -#define VMSTATE_UINTTR_V(_f, _s, _v) \ - VMSTATE_UINT32_V(_f, _s, _v) -#define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \ - VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) -#endif - -#define VMSTATE_UINTTR(_f, _s) \ - VMSTATE_UINTTR_V(_f, _s, 0) -#define VMSTATE_UINTTR_ARRAY(_f, _s, _n) \ - VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, 0) - static int get_psw(QEMUFile *f, void *opaque, size_t size, const VMStateField *field) { CPUHPPAState *env = opaque; - cpu_hppa_put_psw(env, qemu_get_betr(f)); + cpu_hppa_put_psw(env, qemu_get_be64(f)); return 0; } @@ -55,7 +34,7 @@ static int put_psw(QEMUFile *f, void *opaque, size_t size, const VMStateField *field, JSONWriter *vmdesc) { CPUHPPAState *env = opaque; - qemu_put_betr(f, cpu_hppa_get_psw(env)); + qemu_put_be64(f, cpu_hppa_get_psw(env)); return 0; } @@ -73,7 +52,7 @@ static int get_tlb(QEMUFile *f, void *opaque, size_t size, uint32_t val; ent->itree.start = qemu_get_be64(f); - ent->pa = qemu_get_betr(f); + ent->pa = qemu_get_be64(f); val = qemu_get_be32(f); ent->entry_valid = extract32(val, 0, 1); @@ -109,7 +88,7 @@ static int put_tlb(QEMUFile *f, void *opaque, size_t size, } qemu_put_be64(f, ent->itree.start); - qemu_put_betr(f, ent->pa); + qemu_put_be64(f, ent->pa); qemu_put_be32(f, val); return 0; } @@ -169,12 +148,12 @@ static int tlb_post_load(void *opaque, int version_id) } static VMStateField vmstate_env_fields[] = { - VMSTATE_UINTTR_ARRAY(gr, CPUHPPAState, 32), + VMSTATE_UINT64_ARRAY(gr, CPUHPPAState, 32), VMSTATE_UINT64_ARRAY(fr, CPUHPPAState, 32), VMSTATE_UINT64_ARRAY(sr, CPUHPPAState, 8), - VMSTATE_UINTTR_ARRAY(cr, CPUHPPAState, 32), - VMSTATE_UINTTR_ARRAY(cr_back, CPUHPPAState, 2), - VMSTATE_UINTTR_ARRAY(shadow, CPUHPPAState, 7), + VMSTATE_UINT64_ARRAY(cr, CPUHPPAState, 32), + VMSTATE_UINT64_ARRAY(cr_back, CPUHPPAState, 2), + VMSTATE_UINT64_ARRAY(shadow, CPUHPPAState, 7), /* Save the architecture value of the psw, not the internally expanded version. Since this architecture value does not @@ -191,8 +170,8 @@ static VMStateField vmstate_env_fields[] = { .offset = 0 }, - VMSTATE_UINTTR(iaoq_f, CPUHPPAState), - VMSTATE_UINTTR(iaoq_b, CPUHPPAState), + VMSTATE_UINT64(iaoq_f, CPUHPPAState), + VMSTATE_UINT64(iaoq_b, CPUHPPAState), VMSTATE_UINT64(iasq_f, CPUHPPAState), VMSTATE_UINT64(iasq_b, CPUHPPAState), @@ -207,8 +186,8 @@ static VMStateField vmstate_env_fields[] = { static const VMStateDescription vmstate_env = { .name = "env", - .version_id = 1, - .minimum_version_id = 1, + .version_id = 2, + .minimum_version_id = 2, .fields = vmstate_env_fields, .pre_load = tlb_pre_load, .post_load = tlb_post_load, diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index d5d2d62f4a..9be68b860b 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -344,7 +344,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, } /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ -void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ulong reg) { HPPATLBEntry *ent; @@ -366,7 +366,7 @@ void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) } static void set_access_bits_pa11(CPUHPPAState *env, HPPATLBEntry *ent, - target_ureg reg) + target_ulong reg) { ent->access_id = extract32(reg, 1, 18); ent->u = extract32(reg, 19, 1); @@ -384,7 +384,7 @@ static void set_access_bits_pa11(CPUHPPAState *env, HPPATLBEntry *ent, } /* Insert (Insn/Data) TLB Protection. Note this is PA 1.1 only. */ -void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ulong reg) { HPPATLBEntry *ent = env->tlb_partial; @@ -398,8 +398,8 @@ void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) qemu_log_mask(LOG_GUEST_ERROR, "ITLBP not following ITLBA\n"); } -static void itlbt_pa20(CPUHPPAState *env, target_ureg r1, - target_ureg r2, vaddr va_b) +static void itlbt_pa20(CPUHPPAState *env, target_ulong r1, + target_ulong r2, vaddr va_b) { HPPATLBEntry *ent; vaddr va_e; @@ -436,13 +436,13 @@ static void itlbt_pa20(CPUHPPAState *env, target_ureg r1, ent->b, ent->d, ent->t); } -void HELPER(idtlbt_pa20)(CPUHPPAState *env, target_ureg r1, target_ureg r2) +void HELPER(idtlbt_pa20)(CPUHPPAState *env, target_ulong r1, target_ulong r2) { vaddr va_b = deposit64(env->cr[CR_IOR], 32, 32, env->cr[CR_ISR]); itlbt_pa20(env, r1, r2, va_b); } -void HELPER(iitlbt_pa20)(CPUHPPAState *env, target_ureg r1, target_ureg r2) +void HELPER(iitlbt_pa20)(CPUHPPAState *env, target_ulong r1, target_ulong r2) { vaddr va_b = deposit64(env->cr[CR_IIAOQ], 32, 32, env->cr[CR_IIASQ]); itlbt_pa20(env, r1, r2, va_b); @@ -521,7 +521,7 @@ void HELPER(change_prot_id)(CPUHPPAState *env) cpu_hppa_change_prot_id(env); } -target_ureg HELPER(lpa)(CPUHPPAState *env, target_ulong addr) +target_ulong HELPER(lpa)(CPUHPPAState *env, target_ulong addr) { hwaddr phys; int prot, excp; diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 94c9ca5858..0bccca1e11 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -42,14 +42,14 @@ G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t ra) cpu_loop_exit_restore(cs, ra); } -void HELPER(tsv)(CPUHPPAState *env, target_ureg cond) +void HELPER(tsv)(CPUHPPAState *env, target_ulong cond) { - if (unlikely((target_sreg)cond < 0)) { + if (unlikely((target_long)cond < 0)) { hppa_dynamic_excp(env, EXCP_OVERFLOW, GETPC()); } } -void HELPER(tcond)(CPUHPPAState *env, target_ureg cond) +void HELPER(tcond)(CPUHPPAState *env, target_ulong cond) { if (unlikely(cond)) { hppa_dynamic_excp(env, EXCP_COND, GETPC()); @@ -110,7 +110,7 @@ static void atomic_store_mask64(CPUHPPAState *env, target_ulong addr, #endif } -static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, +static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ulong val, bool parallel, uintptr_t ra) { switch (addr & 3) { @@ -191,29 +191,29 @@ static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val, } } -void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stby_b(env, addr, val, false, GETPC()); } void HELPER(stby_b_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stby_b(env, addr, val, true, GETPC()); } -void HELPER(stdby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stdby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stdby_b(env, addr, val, false, GETPC()); } void HELPER(stdby_b_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stdby_b(env, addr, val, true, GETPC()); } -static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val, +static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ulong val, bool parallel, uintptr_t ra) { switch (addr & 3) { @@ -301,24 +301,24 @@ static void do_stdby_e(CPUHPPAState *env, target_ulong addr, uint64_t val, } } -void HELPER(stby_e)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stby_e)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stby_e(env, addr, val, false, GETPC()); } void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stby_e(env, addr, val, true, GETPC()); } -void HELPER(stdby_e)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stdby_e)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stdby_e(env, addr, val, false, GETPC()); } void HELPER(stdby_e_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stdby_e(env, addr, val, true, GETPC()); } @@ -332,7 +332,7 @@ void HELPER(ldc_check)(target_ulong addr) } } -target_ureg HELPER(probe)(CPUHPPAState *env, target_ulong addr, +target_ulong HELPER(probe)(CPUHPPAState *env, target_ulong addr, uint32_t level, uint32_t want) { #ifdef CONFIG_USER_ONLY @@ -364,7 +364,7 @@ target_ureg HELPER(probe)(CPUHPPAState *env, target_ulong addr, #endif } -target_ureg HELPER(read_interval_timer)(void) +target_ulong HELPER(read_interval_timer)(void) { #ifdef CONFIG_USER_ONLY /* In user-mode, QEMU_CLOCK_VIRTUAL doesn't exist. diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index 4bb4cf611c..8850576ac3 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -24,7 +24,7 @@ #include "qemu/timer.h" #include "sysemu/runstate.h" -void HELPER(write_interval_timer)(CPUHPPAState *env, target_ureg val) +void HELPER(write_interval_timer)(CPUHPPAState *env, target_ulong val) { HPPACPU *cpu = env_archcpu(env); uint64_t current = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); @@ -58,7 +58,7 @@ void HELPER(reset)(CPUHPPAState *env) helper_excp(env, EXCP_HLT); } -target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm) +target_ulong HELPER(swap_system_mask)(CPUHPPAState *env, target_ulong nsm) { target_ulong psw = env->psw; /* diff --git a/target/hppa/translate.c b/target/hppa/translate.c index fcea715e7d..2c3e114b86 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -40,21 +40,10 @@ #undef tcg_temp_new #undef tcg_global_mem_new -#if TARGET_LONG_BITS == 64 #define TCGv_tl TCGv_i64 #define tcg_temp_new_tl tcg_temp_new_i64 -#if TARGET_REGISTER_BITS == 64 #define tcg_gen_extu_reg_tl tcg_gen_mov_i64 -#else -#define tcg_gen_extu_reg_tl tcg_gen_extu_i32_i64 -#endif -#else -#define TCGv_tl TCGv_i32 -#define tcg_temp_new_tl tcg_temp_new_i32 -#define tcg_gen_extu_reg_tl tcg_gen_mov_i32 -#endif -#if TARGET_REGISTER_BITS == 64 #define TCGv_reg TCGv_i64 #define tcg_temp_new tcg_temp_new_i64 @@ -147,98 +136,6 @@ #define tcg_gen_qemu_st_reg tcg_gen_qemu_st_i64 #define tcg_gen_atomic_xchg_reg tcg_gen_atomic_xchg_i64 #define tcg_gen_trunc_reg_ptr tcg_gen_trunc_i64_ptr -#else -#define TCGv_reg TCGv_i32 -#define tcg_temp_new tcg_temp_new_i32 -#define tcg_global_mem_new tcg_global_mem_new_i32 - -#define tcg_gen_movi_reg tcg_gen_movi_i32 -#define tcg_gen_mov_reg tcg_gen_mov_i32 -#define tcg_gen_ld8u_reg tcg_gen_ld8u_i32 -#define tcg_gen_ld8s_reg tcg_gen_ld8s_i32 -#define tcg_gen_ld16u_reg tcg_gen_ld16u_i32 -#define tcg_gen_ld16s_reg tcg_gen_ld16s_i32 -#define tcg_gen_ld32u_reg tcg_gen_ld_i32 -#define tcg_gen_ld32s_reg tcg_gen_ld_i32 -#define tcg_gen_ld_reg tcg_gen_ld_i32 -#define tcg_gen_st8_reg tcg_gen_st8_i32 -#define tcg_gen_st16_reg tcg_gen_st16_i32 -#define tcg_gen_st32_reg tcg_gen_st32_i32 -#define tcg_gen_st_reg tcg_gen_st_i32 -#define tcg_gen_add_reg tcg_gen_add_i32 -#define tcg_gen_addi_reg tcg_gen_addi_i32 -#define tcg_gen_sub_reg tcg_gen_sub_i32 -#define tcg_gen_neg_reg tcg_gen_neg_i32 -#define tcg_gen_subfi_reg tcg_gen_subfi_i32 -#define tcg_gen_subi_reg tcg_gen_subi_i32 -#define tcg_gen_and_reg tcg_gen_and_i32 -#define tcg_gen_andi_reg tcg_gen_andi_i32 -#define tcg_gen_or_reg tcg_gen_or_i32 -#define tcg_gen_ori_reg tcg_gen_ori_i32 -#define tcg_gen_xor_reg tcg_gen_xor_i32 -#define tcg_gen_xori_reg tcg_gen_xori_i32 -#define tcg_gen_not_reg tcg_gen_not_i32 -#define tcg_gen_shl_reg tcg_gen_shl_i32 -#define tcg_gen_shli_reg tcg_gen_shli_i32 -#define tcg_gen_shr_reg tcg_gen_shr_i32 -#define tcg_gen_shri_reg tcg_gen_shri_i32 -#define tcg_gen_sar_reg tcg_gen_sar_i32 -#define tcg_gen_sari_reg tcg_gen_sari_i32 -#define tcg_gen_brcond_reg tcg_gen_brcond_i32 -#define tcg_gen_brcondi_reg tcg_gen_brcondi_i32 -#define tcg_gen_setcond_reg tcg_gen_setcond_i32 -#define tcg_gen_setcondi_reg tcg_gen_setcondi_i32 -#define tcg_gen_mul_reg tcg_gen_mul_i32 -#define tcg_gen_muli_reg tcg_gen_muli_i32 -#define tcg_gen_div_reg tcg_gen_div_i32 -#define tcg_gen_rem_reg tcg_gen_rem_i32 -#define tcg_gen_divu_reg tcg_gen_divu_i32 -#define tcg_gen_remu_reg tcg_gen_remu_i32 -#define tcg_gen_discard_reg tcg_gen_discard_i32 -#define tcg_gen_trunc_reg_i32 tcg_gen_mov_i32 -#define tcg_gen_trunc_i64_reg tcg_gen_extrl_i64_i32 -#define tcg_gen_extu_i32_reg tcg_gen_mov_i32 -#define tcg_gen_ext_i32_reg tcg_gen_mov_i32 -#define tcg_gen_extu_reg_i64 tcg_gen_extu_i32_i64 -#define tcg_gen_ext_reg_i64 tcg_gen_ext_i32_i64 -#define tcg_gen_ext8u_reg tcg_gen_ext8u_i32 -#define tcg_gen_ext8s_reg tcg_gen_ext8s_i32 -#define tcg_gen_ext16u_reg tcg_gen_ext16u_i32 -#define tcg_gen_ext16s_reg tcg_gen_ext16s_i32 -#define tcg_gen_ext32u_reg tcg_gen_mov_i32 -#define tcg_gen_ext32s_reg tcg_gen_mov_i32 -#define tcg_gen_bswap16_reg tcg_gen_bswap16_i32 -#define tcg_gen_bswap32_reg tcg_gen_bswap32_i32 -#define tcg_gen_concat_reg_i64 tcg_gen_concat_i32_i64 -#define tcg_gen_andc_reg tcg_gen_andc_i32 -#define tcg_gen_eqv_reg tcg_gen_eqv_i32 -#define tcg_gen_nand_reg tcg_gen_nand_i32 -#define tcg_gen_nor_reg tcg_gen_nor_i32 -#define tcg_gen_orc_reg tcg_gen_orc_i32 -#define tcg_gen_clz_reg tcg_gen_clz_i32 -#define tcg_gen_ctz_reg tcg_gen_ctz_i32 -#define tcg_gen_clzi_reg tcg_gen_clzi_i32 -#define tcg_gen_ctzi_reg tcg_gen_ctzi_i32 -#define tcg_gen_clrsb_reg tcg_gen_clrsb_i32 -#define tcg_gen_ctpop_reg tcg_gen_ctpop_i32 -#define tcg_gen_rotl_reg tcg_gen_rotl_i32 -#define tcg_gen_rotli_reg tcg_gen_rotli_i32 -#define tcg_gen_rotr_reg tcg_gen_rotr_i32 -#define tcg_gen_rotri_reg tcg_gen_rotri_i32 -#define tcg_gen_deposit_reg tcg_gen_deposit_i32 -#define tcg_gen_deposit_z_reg tcg_gen_deposit_z_i32 -#define tcg_gen_extract_reg tcg_gen_extract_i32 -#define tcg_gen_sextract_reg tcg_gen_sextract_i32 -#define tcg_gen_extract2_reg tcg_gen_extract2_i32 -#define tcg_constant_reg tcg_constant_i32 -#define tcg_gen_movcond_reg tcg_gen_movcond_i32 -#define tcg_gen_add2_reg tcg_gen_add2_i32 -#define tcg_gen_sub2_reg tcg_gen_sub2_i32 -#define tcg_gen_qemu_ld_reg tcg_gen_qemu_ld_i32 -#define tcg_gen_qemu_st_reg tcg_gen_qemu_st_i32 -#define tcg_gen_atomic_xchg_reg tcg_gen_atomic_xchg_i32 -#define tcg_gen_trunc_reg_ptr tcg_gen_ext_i32_ptr -#endif /* TARGET_REGISTER_BITS */ typedef struct DisasCond { TCGCond c; @@ -249,9 +146,9 @@ typedef struct DisasContext { DisasContextBase base; CPUState *cs; - target_ureg iaoq_f; - target_ureg iaoq_b; - target_ureg iaoq_n; + uint64_t iaoq_f; + uint64_t iaoq_b; + uint64_t iaoq_n; TCGv_reg iaoq_n_var; DisasCond null_cond; @@ -727,7 +624,7 @@ static bool nullify_end(DisasContext *ctx) return true; } -static target_ureg gva_offset_mask(DisasContext *ctx) +static uint64_t gva_offset_mask(DisasContext *ctx) { return (ctx->tb_flags & PSW_W ? MAKE_64BIT_MASK(0, 62) @@ -735,9 +632,9 @@ static target_ureg gva_offset_mask(DisasContext *ctx) } static void copy_iaoq_entry(DisasContext *ctx, TCGv_reg dest, - target_ureg ival, TCGv_reg vval) + uint64_t ival, TCGv_reg vval) { - target_ureg mask = gva_offset_mask(ctx); + uint64_t mask = gva_offset_mask(ctx); if (ival != -1) { tcg_gen_movi_reg(dest, ival & mask); @@ -756,7 +653,7 @@ static void copy_iaoq_entry(DisasContext *ctx, TCGv_reg dest, } } -static inline target_ureg iaoq_dest(DisasContext *ctx, target_sreg disp) +static inline uint64_t iaoq_dest(DisasContext *ctx, int64_t disp) { return ctx->iaoq_f + disp + 8; } @@ -801,7 +698,7 @@ static bool gen_illegal(DisasContext *ctx) } while (0) #endif -static bool use_goto_tb(DisasContext *ctx, target_ureg dest) +static bool use_goto_tb(DisasContext *ctx, uint64_t dest) { return translator_use_goto_tb(&ctx->base, dest); } @@ -817,7 +714,7 @@ static bool use_nullify_skip(DisasContext *ctx) } static void gen_goto_tb(DisasContext *ctx, int which, - target_ureg f, target_ureg b) + uint64_t f, uint64_t b) { if (f != -1 && b != -1 && use_goto_tb(ctx, f)) { tcg_gen_goto_tb(which); @@ -844,7 +741,7 @@ static bool cond_need_cb(int c) /* Need extensions from TCGv_i32 to TCGv_reg. */ static bool cond_need_ext(DisasContext *ctx, bool d) { - return TARGET_REGISTER_BITS == 64 && !(ctx->is_pa20 && d); + return !(ctx->is_pa20 && d); } /* @@ -895,7 +792,7 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, tcg_gen_and_reg(tmp, tmp, res); tcg_gen_ext32u_reg(tmp, tmp); } else { - tcg_gen_sari_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); + tcg_gen_sari_reg(tmp, tmp, 63); tcg_gen_and_reg(tmp, tmp, res); } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); @@ -1091,7 +988,7 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, { DisasCond cond; TCGv_reg tmp, cb = NULL; - target_ureg d_repl = d ? 0x0000000100000001ull : 1; + uint64_t d_repl = d ? 0x0000000100000001ull : 1; if (cf & 8) { /* Since we want to test lots of carry-out bits all at once, do not @@ -1522,7 +1419,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) #endif static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, - unsigned rb, unsigned rx, int scale, target_sreg disp, + unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, bool is_phys) { TCGv_reg base = load_gpr(ctx, rb); @@ -1558,7 +1455,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, * = 0 for no base register update. */ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1576,7 +1473,7 @@ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, } static void do_load_64(DisasContext *ctx, TCGv_i64 dest, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1594,7 +1491,7 @@ static void do_load_64(DisasContext *ctx, TCGv_i64 dest, unsigned rb, } static void do_store_32(DisasContext *ctx, TCGv_i32 src, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1612,7 +1509,7 @@ static void do_store_32(DisasContext *ctx, TCGv_i32 src, unsigned rb, } static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1629,16 +1526,11 @@ static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, } } -#if TARGET_REGISTER_BITS == 64 #define do_load_reg do_load_64 #define do_store_reg do_store_64 -#else -#define do_load_reg do_load_32 -#define do_store_reg do_store_32 -#endif static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg dest; @@ -1659,7 +1551,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, } static bool do_floadw(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i32 tmp; @@ -1684,7 +1576,7 @@ static bool trans_fldw(DisasContext *ctx, arg_ldst *a) } static bool do_floadd(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i64 tmp; @@ -1709,7 +1601,7 @@ static bool trans_fldd(DisasContext *ctx, arg_ldst *a) } static bool do_store(DisasContext *ctx, unsigned rt, unsigned rb, - target_sreg disp, unsigned sp, + int64_t disp, unsigned sp, int modify, MemOp mop) { nullify_over(ctx); @@ -1718,7 +1610,7 @@ static bool do_store(DisasContext *ctx, unsigned rt, unsigned rb, } static bool do_fstorew(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i32 tmp; @@ -1738,7 +1630,7 @@ static bool trans_fstw(DisasContext *ctx, arg_ldst *a) } static bool do_fstored(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i64 tmp; @@ -1851,7 +1743,7 @@ static bool do_fop_dedd(DisasContext *ctx, unsigned rt, /* Emit an unconditional branch to a direct target, which may or may not have already had nullification handled. */ -static bool do_dbranch(DisasContext *ctx, target_ureg dest, +static bool do_dbranch(DisasContext *ctx, uint64_t dest, unsigned link, bool is_n) { if (ctx->null_cond.c == TCG_COND_NEVER && ctx->null_lab == NULL) { @@ -1888,10 +1780,10 @@ static bool do_dbranch(DisasContext *ctx, target_ureg dest, /* Emit a conditional branch to a direct target. If the branch itself is nullified, we should have already used nullify_over. */ -static bool do_cbranch(DisasContext *ctx, target_sreg disp, bool is_n, +static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, DisasCond *cond) { - target_ureg dest = iaoq_dest(ctx, disp); + uint64_t dest = iaoq_dest(ctx, disp); TCGLabel *taken = NULL; TCGCond c = cond->c; bool n; @@ -2867,7 +2759,7 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) if (!is_i) { tcg_gen_not_reg(tmp, tmp); } - tcg_gen_andi_reg(tmp, tmp, (target_ureg)0x1111111111111111ull); + tcg_gen_andi_reg(tmp, tmp, (uint64_t)0x1111111111111111ull); tcg_gen_muli_reg(tmp, tmp, 6); do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, a->d, false, is_i ? tcg_gen_add_reg : tcg_gen_sub_reg); @@ -2989,22 +2881,20 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) static bool trans_ld(DisasContext *ctx, arg_ldst *a) { - if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); - } else { - return do_load(ctx, a->t, a->b, a->x, a->scale ? a->size : 0, - a->disp, a->sp, a->m, a->size | MO_TE); } + return do_load(ctx, a->t, a->b, a->x, a->scale ? a->size : 0, + a->disp, a->sp, a->m, a->size | MO_TE); } static bool trans_st(DisasContext *ctx, arg_ldst *a) { assert(a->x == 0 && a->scale == 0); - if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); - } else { - return do_store(ctx, a->t, a->b, a->disp, a->sp, a->m, a->size | MO_TE); } + return do_store(ctx, a->t, a->b, a->disp, a->sp, a->m, a->size | MO_TE); } static bool trans_ldc(DisasContext *ctx, arg_ldst *a) @@ -3013,7 +2903,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) TCGv_reg zero, dest, ofs; TCGv_tl addr; - if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); } @@ -3428,7 +3318,7 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) t2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { tcg_gen_extract_reg(dest, t2, sa, width - sa); - } else if (width == TARGET_REGISTER_BITS) { + } else if (width == TARGET_LONG_BITS) { tcg_gen_extract2_reg(dest, t2, cpu_gr[a->r1], sa); } else { assert(!a->d); @@ -3538,7 +3428,7 @@ static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) { unsigned len, width; - target_sreg mask0, mask1; + uint64_t mask0, mask1; TCGv_reg dest; if (!ctx->is_pa20 && a->d) { @@ -3617,7 +3507,7 @@ static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, unsigned rs = nz ? rt : 0; unsigned widthm1 = d ? 63 : 31; TCGv_reg mask, tmp, shift, dest; - target_ureg msb = 1ULL << (len - 1); + uint64_t msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); shift = tcg_temp_new(); @@ -3734,7 +3624,7 @@ static bool trans_bl(DisasContext *ctx, arg_bl *a) static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) { - target_ureg dest = iaoq_dest(ctx, a->disp); + uint64_t dest = iaoq_dest(ctx, a->disp); nullify_over(ctx); @@ -3862,7 +3752,7 @@ static bool trans_fid_f(DisasContext *ctx, arg_fid_f *a) { uint64_t ret; - if (TARGET_REGISTER_BITS == 64) { + if (ctx->is_pa20) { ret = 0x13080000000000ULL; /* PA8700 (PCX-W2) */ } else { ret = 0x0f080000000000ULL; /* PA7300LC (PCX-L2) */ From patchwork Thu Nov 2 01:29:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740370 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595060wrv; Wed, 1 Nov 2023 18:37:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxXVNQYeALvD/Zsfg871zClOfbkkY/Q+OI+nsYwQDQUI73DgktvRPiqyfR2nkdD+9NQhQM X-Received: by 2002:a05:620a:261f:b0:775:74e3:6d50 with SMTP id z31-20020a05620a261f00b0077574e36d50mr16049278qko.77.1698889059353; Wed, 01 Nov 2023 18:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889059; cv=none; d=google.com; s=arc-20160816; b=SUjq7+l+K4YnoPu3uqewF+JhVqZypdBhGhTWO9wjb2iTeq8jBYXf4C41NlYPrc/1Yu OtAn9hd91CG/vvKagk3gXH+Ex0GGKqPI9qjQn8mUN0cIh+4ONfh6GZCKC8p0dRyPYn2c Q3nnDkUNbLKXi7jDy+FJqwDXP6gcPSSRO8FaOAK0/SEjWQpbXJ4MZ3M2h9gKBkJbK3qW n8s8mH84bSMJpVP8lXDGABSFjpiuRYqiyptoMUAGY7IH84xUWP/J0Gw/n7iPYekTOka3 0gw57xqmRDrq7St4jkPygdznPOutpGnRlQj4xfFlzMgf95JwIKZaRppllMppN8+lKQIV GBJw== 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=VuQ71Pxz42WxQSpC4yJP9ZvlGKvcjABn91g+jcEZ5UI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=q00GwHqyn2EX+LXzJMaXWsbiEEKF7JLR0/ypahlyvzNcsing6yRq4Aq71qhz3w8Nvq Dp3UE6JdXGhQ5M+crK2hkmZw6Yx0R69Y3aCWAS5uZ9fT1SKnCXFW1HmJLZFbmTwK6Chu 2qeX+PrdOXeHjl450XX+La6C/SHB7m9bKO0Xwf75kQrYsyB41WQ1AAuyCu2/pGWHqiDh 5TGnoZZ7NT5pRXL1GlwUkH886Pu6tmpu2PHYfRXLv2E/TMRY27A4rZmKKKmMyRn/npkJ 73Vs6DJm7cnLEgpPMysviHhWzMS9oOCfytLEo8hP9ohw16K03WRlM7U8iJO6xkuVoRgM a3sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CNrSdF5u; 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 i15-20020a05620a27cf00b007757acf4889si3362214qkp.1.2023.11.01.18.37.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37: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=CNrSdF5u; 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 1qyMcb-0000I2-Mc; Wed, 01 Nov 2023 21:35: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 1qyMb8-0006Xr-BE for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:14 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb3-0001xq-MU for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:14 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1cc58219376so3532455ad.1 for ; Wed, 01 Nov 2023 18:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888848; x=1699493648; 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=VuQ71Pxz42WxQSpC4yJP9ZvlGKvcjABn91g+jcEZ5UI=; b=CNrSdF5ue5Fw57Wbk1cq5zUHhJzyXVahhZDoYoza8OFe2FotPsyB0wqZiJbHKY04wa D0G381o95PZ3CSSwM8M182aYFa4lXgE1LtiMlc8fo/Jbxhq1v6BaK527Dn2y1Lo+nnFq kITVzWmXX6DIkuRSnHALXjKvBgbPXuCj/oopRGkcfziuUckl5Q1QqwgBnkILmy8WAwAH gK7r/ad0qbFRbkZjGvco+ND9bSS57Y7JWLDVbrG0tYx2c4NNgMd+hVFNDIavLVcznUys Q25KHhcYL5syby8ubr/0C80OISWT2oIcN3Sru23Cg1vHFK+/DrfxZcf1clCfB/peoLo9 XnfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888848; x=1699493648; 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=VuQ71Pxz42WxQSpC4yJP9ZvlGKvcjABn91g+jcEZ5UI=; b=GlwCfw3f2hONopfGtMKiLK6BVVZwQd7cDBtrUVEA5/IDNchcXwEKfQ3DMljQuC5m3C TNpCETscIUQaK1EC8sUSaNGQdFm9yjeJXjeSzK8nIsa+u3dGFyi1cNHkGV6v3ntz3nkM xoKEyEJ/WQHf7U7DSoQVjCv+4ik221ugWwmDyUmelE8vuOrajcl9GoP8atMshUzymfrM ZRH+UhcNTSRlFqDN95jHBDuDEEHL7GijiJmGWC0i/Py/XgjKOIYMVCqlSwtT56G41Mod +wa8/HJUL8v7QKF4YEkKTELSHFmNZ4rRI57isMu1d+nmIkiEPzeaek/oC0Je58XJbUQl jK0g== X-Gm-Message-State: AOJu0Yw2yOsqovydOUJll6atSbqm4BVFzeTVYvcs/19jOdp67m+ozBwA V1ncU3BBrU1mLmVgDgCRin7+5OllYfD0VGIKMNM= X-Received: by 2002:a17:903:48f:b0:1cc:3544:ea41 with SMTP id jj15-20020a170903048f00b001cc3544ea41mr13121840plb.46.1698888848090; Wed, 01 Nov 2023 18:34:08 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 58/88] target/hppa: Remove most of the TARGET_REGISTER_BITS redirections Date: Wed, 1 Nov 2023 18:29:46 -0700 Message-Id: <20231102013016.369010-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Remove all but those intended to change type to or from i64. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 910 ++++++++++++++++++---------------------- 1 file changed, 406 insertions(+), 504 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2c3e114b86..520a375e3a 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -36,110 +36,15 @@ /* Since we have a distinction between register size and address size, we need to redefine all of these. */ -#undef TCGv -#undef tcg_temp_new -#undef tcg_global_mem_new - -#define TCGv_tl TCGv_i64 -#define tcg_temp_new_tl tcg_temp_new_i64 #define tcg_gen_extu_reg_tl tcg_gen_mov_i64 - -#define TCGv_reg TCGv_i64 - -#define tcg_temp_new tcg_temp_new_i64 -#define tcg_global_mem_new tcg_global_mem_new_i64 - -#define tcg_gen_movi_reg tcg_gen_movi_i64 -#define tcg_gen_mov_reg tcg_gen_mov_i64 -#define tcg_gen_ld8u_reg tcg_gen_ld8u_i64 -#define tcg_gen_ld8s_reg tcg_gen_ld8s_i64 -#define tcg_gen_ld16u_reg tcg_gen_ld16u_i64 -#define tcg_gen_ld16s_reg tcg_gen_ld16s_i64 -#define tcg_gen_ld32u_reg tcg_gen_ld32u_i64 -#define tcg_gen_ld32s_reg tcg_gen_ld32s_i64 -#define tcg_gen_ld_reg tcg_gen_ld_i64 -#define tcg_gen_st8_reg tcg_gen_st8_i64 -#define tcg_gen_st16_reg tcg_gen_st16_i64 -#define tcg_gen_st32_reg tcg_gen_st32_i64 -#define tcg_gen_st_reg tcg_gen_st_i64 -#define tcg_gen_add_reg tcg_gen_add_i64 -#define tcg_gen_addi_reg tcg_gen_addi_i64 -#define tcg_gen_sub_reg tcg_gen_sub_i64 -#define tcg_gen_neg_reg tcg_gen_neg_i64 -#define tcg_gen_subfi_reg tcg_gen_subfi_i64 -#define tcg_gen_subi_reg tcg_gen_subi_i64 -#define tcg_gen_and_reg tcg_gen_and_i64 -#define tcg_gen_andi_reg tcg_gen_andi_i64 -#define tcg_gen_or_reg tcg_gen_or_i64 -#define tcg_gen_ori_reg tcg_gen_ori_i64 -#define tcg_gen_xor_reg tcg_gen_xor_i64 -#define tcg_gen_xori_reg tcg_gen_xori_i64 -#define tcg_gen_not_reg tcg_gen_not_i64 -#define tcg_gen_shl_reg tcg_gen_shl_i64 -#define tcg_gen_shli_reg tcg_gen_shli_i64 -#define tcg_gen_shr_reg tcg_gen_shr_i64 -#define tcg_gen_shri_reg tcg_gen_shri_i64 -#define tcg_gen_sar_reg tcg_gen_sar_i64 -#define tcg_gen_sari_reg tcg_gen_sari_i64 -#define tcg_gen_brcond_reg tcg_gen_brcond_i64 -#define tcg_gen_brcondi_reg tcg_gen_brcondi_i64 -#define tcg_gen_setcond_reg tcg_gen_setcond_i64 -#define tcg_gen_setcondi_reg tcg_gen_setcondi_i64 -#define tcg_gen_mul_reg tcg_gen_mul_i64 -#define tcg_gen_muli_reg tcg_gen_muli_i64 -#define tcg_gen_div_reg tcg_gen_div_i64 -#define tcg_gen_rem_reg tcg_gen_rem_i64 -#define tcg_gen_divu_reg tcg_gen_divu_i64 -#define tcg_gen_remu_reg tcg_gen_remu_i64 -#define tcg_gen_discard_reg tcg_gen_discard_i64 -#define tcg_gen_trunc_reg_i32 tcg_gen_extrl_i64_i32 #define tcg_gen_trunc_i64_reg tcg_gen_mov_i64 -#define tcg_gen_extu_i32_reg tcg_gen_extu_i32_i64 -#define tcg_gen_ext_i32_reg tcg_gen_ext_i32_i64 #define tcg_gen_extu_reg_i64 tcg_gen_mov_i64 #define tcg_gen_ext_reg_i64 tcg_gen_mov_i64 -#define tcg_gen_ext8u_reg tcg_gen_ext8u_i64 -#define tcg_gen_ext8s_reg tcg_gen_ext8s_i64 -#define tcg_gen_ext16u_reg tcg_gen_ext16u_i64 -#define tcg_gen_ext16s_reg tcg_gen_ext16s_i64 -#define tcg_gen_ext32u_reg tcg_gen_ext32u_i64 -#define tcg_gen_ext32s_reg tcg_gen_ext32s_i64 -#define tcg_gen_bswap16_reg tcg_gen_bswap16_i64 -#define tcg_gen_bswap32_reg tcg_gen_bswap32_i64 -#define tcg_gen_bswap64_reg tcg_gen_bswap64_i64 -#define tcg_gen_concat_reg_i64 tcg_gen_concat32_i64 -#define tcg_gen_andc_reg tcg_gen_andc_i64 -#define tcg_gen_eqv_reg tcg_gen_eqv_i64 -#define tcg_gen_nand_reg tcg_gen_nand_i64 -#define tcg_gen_nor_reg tcg_gen_nor_i64 -#define tcg_gen_orc_reg tcg_gen_orc_i64 -#define tcg_gen_clz_reg tcg_gen_clz_i64 -#define tcg_gen_ctz_reg tcg_gen_ctz_i64 -#define tcg_gen_clzi_reg tcg_gen_clzi_i64 -#define tcg_gen_ctzi_reg tcg_gen_ctzi_i64 -#define tcg_gen_clrsb_reg tcg_gen_clrsb_i64 -#define tcg_gen_ctpop_reg tcg_gen_ctpop_i64 -#define tcg_gen_rotl_reg tcg_gen_rotl_i64 -#define tcg_gen_rotli_reg tcg_gen_rotli_i64 -#define tcg_gen_rotr_reg tcg_gen_rotr_i64 -#define tcg_gen_rotri_reg tcg_gen_rotri_i64 -#define tcg_gen_deposit_reg tcg_gen_deposit_i64 -#define tcg_gen_deposit_z_reg tcg_gen_deposit_z_i64 -#define tcg_gen_extract_reg tcg_gen_extract_i64 -#define tcg_gen_sextract_reg tcg_gen_sextract_i64 -#define tcg_gen_extract2_reg tcg_gen_extract2_i64 -#define tcg_constant_reg tcg_constant_i64 -#define tcg_gen_movcond_reg tcg_gen_movcond_i64 -#define tcg_gen_add2_reg tcg_gen_add2_i64 -#define tcg_gen_sub2_reg tcg_gen_sub2_i64 -#define tcg_gen_qemu_ld_reg tcg_gen_qemu_ld_i64 -#define tcg_gen_qemu_st_reg tcg_gen_qemu_st_i64 -#define tcg_gen_atomic_xchg_reg tcg_gen_atomic_xchg_i64 -#define tcg_gen_trunc_reg_ptr tcg_gen_trunc_i64_ptr + typedef struct DisasCond { TCGCond c; - TCGv_reg a0, a1; + TCGv_i64 a0, a1; } DisasCond; typedef struct DisasContext { @@ -149,7 +54,7 @@ typedef struct DisasContext { uint64_t iaoq_f; uint64_t iaoq_b; uint64_t iaoq_n; - TCGv_reg iaoq_n_var; + TCGv_i64 iaoq_n_var; DisasCond null_cond; TCGLabel *null_lab; @@ -261,24 +166,24 @@ static int cmpbid_c(DisasContext *ctx, int val) #define DISAS_EXIT DISAS_TARGET_3 /* global register indexes */ -static TCGv_reg cpu_gr[32]; +static TCGv_i64 cpu_gr[32]; static TCGv_i64 cpu_sr[4]; static TCGv_i64 cpu_srH; -static TCGv_reg cpu_iaoq_f; -static TCGv_reg cpu_iaoq_b; +static TCGv_i64 cpu_iaoq_f; +static TCGv_i64 cpu_iaoq_b; static TCGv_i64 cpu_iasq_f; static TCGv_i64 cpu_iasq_b; -static TCGv_reg cpu_sar; -static TCGv_reg cpu_psw_n; -static TCGv_reg cpu_psw_v; -static TCGv_reg cpu_psw_cb; -static TCGv_reg cpu_psw_cb_msb; +static TCGv_i64 cpu_sar; +static TCGv_i64 cpu_psw_n; +static TCGv_i64 cpu_psw_v; +static TCGv_i64 cpu_psw_cb; +static TCGv_i64 cpu_psw_cb_msb; void hppa_translate_init(void) { #define DEF_VAR(V) { &cpu_##V, #V, offsetof(CPUHPPAState, V) } - typedef struct { TCGv_reg *var; const char *name; int ofs; } GlobalVar; + typedef struct { TCGv_i64 *var; const char *name; int ofs; } GlobalVar; static const GlobalVar vars[] = { { &cpu_sar, "sar", offsetof(CPUHPPAState, cr[CR_SAR]) }, DEF_VAR(psw_n), @@ -356,35 +261,35 @@ static DisasCond cond_make_n(void) return (DisasCond){ .c = TCG_COND_NE, .a0 = cpu_psw_n, - .a1 = tcg_constant_reg(0) + .a1 = tcg_constant_i64(0) }; } -static DisasCond cond_make_tmp(TCGCond c, TCGv_reg a0, TCGv_reg a1) +static DisasCond cond_make_tmp(TCGCond c, TCGv_i64 a0, TCGv_i64 a1) { assert (c != TCG_COND_NEVER && c != TCG_COND_ALWAYS); return (DisasCond){ .c = c, .a0 = a0, .a1 = a1 }; } -static DisasCond cond_make_0_tmp(TCGCond c, TCGv_reg a0) +static DisasCond cond_make_0_tmp(TCGCond c, TCGv_i64 a0) { - return cond_make_tmp(c, a0, tcg_constant_reg(0)); + return cond_make_tmp(c, a0, tcg_constant_i64(0)); } -static DisasCond cond_make_0(TCGCond c, TCGv_reg a0) +static DisasCond cond_make_0(TCGCond c, TCGv_i64 a0) { - TCGv_reg tmp = tcg_temp_new(); - tcg_gen_mov_reg(tmp, a0); + TCGv_i64 tmp = tcg_temp_new(); + tcg_gen_mov_i64(tmp, a0); return cond_make_0_tmp(c, tmp); } -static DisasCond cond_make(TCGCond c, TCGv_reg a0, TCGv_reg a1) +static DisasCond cond_make(TCGCond c, TCGv_i64 a0, TCGv_i64 a1) { - TCGv_reg t0 = tcg_temp_new(); - TCGv_reg t1 = tcg_temp_new(); + TCGv_i64 t0 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new(); - tcg_gen_mov_reg(t0, a0); - tcg_gen_mov_reg(t1, a1); + tcg_gen_mov_i64(t0, a0); + tcg_gen_mov_i64(t1, a1); return cond_make_tmp(c, t0, t1); } @@ -403,18 +308,18 @@ static void cond_free(DisasCond *cond) } } -static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) +static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_reg t = tcg_temp_new(); - tcg_gen_movi_reg(t, 0); + TCGv_i64 t = tcg_temp_new(); + tcg_gen_movi_i64(t, 0); return t; } else { return cpu_gr[reg]; } } -static TCGv_reg dest_gpr(DisasContext *ctx, unsigned reg) +static TCGv_i64 dest_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0 || ctx->null_cond.c != TCG_COND_NEVER) { return tcg_temp_new(); @@ -423,17 +328,17 @@ static TCGv_reg dest_gpr(DisasContext *ctx, unsigned reg) } } -static void save_or_nullify(DisasContext *ctx, TCGv_reg dest, TCGv_reg t) +static void save_or_nullify(DisasContext *ctx, TCGv_i64 dest, TCGv_i64 t) { if (ctx->null_cond.c != TCG_COND_NEVER) { - tcg_gen_movcond_reg(ctx->null_cond.c, dest, ctx->null_cond.a0, + tcg_gen_movcond_i64(ctx->null_cond.c, dest, ctx->null_cond.a0, ctx->null_cond.a1, dest, t); } else { - tcg_gen_mov_reg(dest, t); + tcg_gen_mov_i64(dest, t); } } -static void save_gpr(DisasContext *ctx, unsigned reg, TCGv_reg t) +static void save_gpr(DisasContext *ctx, unsigned reg, TCGv_i64 t) { if (reg != 0) { save_or_nullify(ctx, cpu_gr[reg], t); @@ -542,17 +447,17 @@ static void nullify_over(DisasContext *ctx) /* If we're using PSW[N], copy it to a temp because... */ if (ctx->null_cond.a0 == cpu_psw_n) { ctx->null_cond.a0 = tcg_temp_new(); - tcg_gen_mov_reg(ctx->null_cond.a0, cpu_psw_n); + tcg_gen_mov_i64(ctx->null_cond.a0, cpu_psw_n); } /* ... we clear it before branching over the implementation, so that (1) it's clear after nullifying this insn and (2) if this insn nullifies the next, PSW[N] is valid. */ if (ctx->psw_n_nonzero) { ctx->psw_n_nonzero = false; - tcg_gen_movi_reg(cpu_psw_n, 0); + tcg_gen_movi_i64(cpu_psw_n, 0); } - tcg_gen_brcond_reg(ctx->null_cond.c, ctx->null_cond.a0, + tcg_gen_brcond_i64(ctx->null_cond.c, ctx->null_cond.a0, ctx->null_cond.a1, ctx->null_lab); cond_free(&ctx->null_cond); } @@ -563,12 +468,12 @@ static void nullify_save(DisasContext *ctx) { if (ctx->null_cond.c == TCG_COND_NEVER) { if (ctx->psw_n_nonzero) { - tcg_gen_movi_reg(cpu_psw_n, 0); + tcg_gen_movi_i64(cpu_psw_n, 0); } return; } if (ctx->null_cond.a0 != cpu_psw_n) { - tcg_gen_setcond_reg(ctx->null_cond.c, cpu_psw_n, + tcg_gen_setcond_i64(ctx->null_cond.c, cpu_psw_n, ctx->null_cond.a0, ctx->null_cond.a1); ctx->psw_n_nonzero = true; } @@ -581,7 +486,7 @@ static void nullify_save(DisasContext *ctx) static void nullify_set(DisasContext *ctx, bool x) { if (ctx->psw_n_nonzero || x) { - tcg_gen_movi_reg(cpu_psw_n, x); + tcg_gen_movi_i64(cpu_psw_n, x); } } @@ -631,13 +536,13 @@ static uint64_t gva_offset_mask(DisasContext *ctx) : MAKE_64BIT_MASK(0, 32)); } -static void copy_iaoq_entry(DisasContext *ctx, TCGv_reg dest, - uint64_t ival, TCGv_reg vval) +static void copy_iaoq_entry(DisasContext *ctx, TCGv_i64 dest, + uint64_t ival, TCGv_i64 vval) { uint64_t mask = gva_offset_mask(ctx); if (ival != -1) { - tcg_gen_movi_reg(dest, ival & mask); + tcg_gen_movi_i64(dest, ival & mask); return; } tcg_debug_assert(vval != NULL); @@ -647,9 +552,9 @@ static void copy_iaoq_entry(DisasContext *ctx, TCGv_reg dest, * This optimization is primarily for "iaoq_f = iaoq_b". */ if (vval == cpu_iaoq_f || vval == cpu_iaoq_b) { - tcg_gen_mov_reg(dest, vval); + tcg_gen_mov_i64(dest, vval); } else { - tcg_gen_andi_reg(dest, vval, mask); + tcg_gen_andi_i64(dest, vval, mask); } } @@ -675,7 +580,7 @@ static void gen_excp(DisasContext *ctx, int exception) static bool gen_excp_iir(DisasContext *ctx, int exc) { nullify_over(ctx); - tcg_gen_st_reg(tcg_constant_reg(ctx->insn), + tcg_gen_st_i64(tcg_constant_i64(ctx->insn), tcg_env, offsetof(CPUHPPAState, cr[CR_IIR])); gen_excp(ctx, exc); return nullify_end(ctx); @@ -738,7 +643,7 @@ static bool cond_need_cb(int c) return c == 4 || c == 5; } -/* Need extensions from TCGv_i32 to TCGv_reg. */ +/* Need extensions from TCGv_i32 to TCGv_i64. */ static bool cond_need_ext(DisasContext *ctx, bool d) { return !(ctx->is_pa20 && d); @@ -750,10 +655,10 @@ static bool cond_need_ext(DisasContext *ctx, bool d) */ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, - TCGv_reg res, TCGv_reg cb_msb, TCGv_reg sv) + TCGv_i64 res, TCGv_i64 cb_msb, TCGv_i64 sv) { DisasCond cond; - TCGv_reg tmp; + TCGv_i64 tmp; switch (cf >> 1) { case 0: /* Never / TR (0 / 1) */ @@ -762,16 +667,16 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, case 1: /* = / <> (Z / !Z) */ if (cond_need_ext(ctx, d)) { tmp = tcg_temp_new(); - tcg_gen_ext32u_reg(tmp, res); + tcg_gen_ext32u_i64(tmp, res); res = tmp; } cond = cond_make_0(TCG_COND_EQ, res); break; case 2: /* < / >= (N ^ V / !(N ^ V) */ tmp = tcg_temp_new(); - tcg_gen_xor_reg(tmp, res, sv); + tcg_gen_xor_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { - tcg_gen_ext32s_reg(tmp, tmp); + tcg_gen_ext32s_i64(tmp, tmp); } cond = cond_make_0_tmp(TCG_COND_LT, tmp); break; @@ -786,14 +691,14 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, * !(~(res ^ sv) >> 31 & res) */ tmp = tcg_temp_new(); - tcg_gen_eqv_reg(tmp, res, sv); + tcg_gen_eqv_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { - tcg_gen_sextract_reg(tmp, tmp, 31, 1); - tcg_gen_and_reg(tmp, tmp, res); - tcg_gen_ext32u_reg(tmp, tmp); + tcg_gen_sextract_i64(tmp, tmp, 31, 1); + tcg_gen_and_i64(tmp, tmp, res); + tcg_gen_ext32u_i64(tmp, tmp); } else { - tcg_gen_sari_reg(tmp, tmp, 63); - tcg_gen_and_reg(tmp, tmp, res); + tcg_gen_sari_i64(tmp, tmp, 63); + tcg_gen_and_i64(tmp, tmp, res); } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; @@ -803,24 +708,24 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, break; case 5: /* ZNV / VNZ (!C | Z / C & !Z) */ tmp = tcg_temp_new(); - tcg_gen_neg_reg(tmp, cb_msb); - tcg_gen_and_reg(tmp, tmp, res); + tcg_gen_neg_i64(tmp, cb_msb); + tcg_gen_and_i64(tmp, tmp, res); if (cond_need_ext(ctx, d)) { - tcg_gen_ext32u_reg(tmp, tmp); + tcg_gen_ext32u_i64(tmp, tmp); } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; case 6: /* SV / NSV (V / !V) */ if (cond_need_ext(ctx, d)) { tmp = tcg_temp_new(); - tcg_gen_ext32s_reg(tmp, sv); + tcg_gen_ext32s_i64(tmp, sv); sv = tmp; } cond = cond_make_0(TCG_COND_LT, sv); break; case 7: /* OD / EV */ tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, res, 1); + tcg_gen_andi_i64(tmp, res, 1); cond = cond_make_0_tmp(TCG_COND_NE, tmp); break; default: @@ -838,8 +743,8 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, deleted as unused. */ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, - TCGv_reg res, TCGv_reg in1, - TCGv_reg in2, TCGv_reg sv) + TCGv_i64 res, TCGv_i64 in1, + TCGv_i64 in2, TCGv_i64 sv) { TCGCond tc; bool ext_uns; @@ -873,15 +778,15 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, tc = tcg_invert_cond(tc); } if (cond_need_ext(ctx, d)) { - TCGv_reg t1 = tcg_temp_new(); - TCGv_reg t2 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new(); + TCGv_i64 t2 = tcg_temp_new(); if (ext_uns) { - tcg_gen_ext32u_reg(t1, in1); - tcg_gen_ext32u_reg(t2, in2); + tcg_gen_ext32u_i64(t1, in1); + tcg_gen_ext32u_i64(t2, in2); } else { - tcg_gen_ext32s_reg(t1, in1); - tcg_gen_ext32s_reg(t2, in2); + tcg_gen_ext32s_i64(t1, in1); + tcg_gen_ext32s_i64(t2, in2); } return cond_make_tmp(tc, t1, t2); } @@ -898,7 +803,7 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, */ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, - TCGv_reg res) + TCGv_i64 res) { TCGCond tc; bool ext_uns; @@ -950,12 +855,12 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, } if (cond_need_ext(ctx, d)) { - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); if (ext_uns) { - tcg_gen_ext32u_reg(tmp, res); + tcg_gen_ext32u_i64(tmp, res); } else { - tcg_gen_ext32s_reg(tmp, res); + tcg_gen_ext32s_i64(tmp, res); } return cond_make_0_tmp(tc, tmp); } @@ -965,7 +870,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, /* Similar, but for shift/extract/deposit conditions. */ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, - TCGv_reg res) + TCGv_i64 res) { unsigned c, f; @@ -983,11 +888,11 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, /* Similar, but for unit conditions. */ -static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2) +static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, + TCGv_i64 in1, TCGv_i64 in2) { DisasCond cond; - TCGv_reg tmp, cb = NULL; + TCGv_i64 tmp, cb = NULL; uint64_t d_repl = d ? 0x0000000100000001ull : 1; if (cf & 8) { @@ -997,10 +902,10 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, */ cb = tcg_temp_new(); tmp = tcg_temp_new(); - tcg_gen_or_reg(cb, in1, in2); - tcg_gen_and_reg(tmp, in1, in2); - tcg_gen_andc_reg(cb, cb, res); - tcg_gen_or_reg(cb, cb, tmp); + tcg_gen_or_i64(cb, in1, in2); + tcg_gen_and_i64(tmp, in1, in2); + tcg_gen_andc_i64(cb, cb, res); + tcg_gen_or_i64(cb, cb, tmp); } switch (cf >> 1) { @@ -1015,32 +920,32 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, d_repl * 0x01010101u); - tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80808080u); + tcg_gen_subi_i64(tmp, res, d_repl * 0x01010101u); + tcg_gen_andc_i64(tmp, tmp, res); + tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 3: /* SHZ / NHZ */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, d_repl * 0x00010001u); - tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80008000u); + tcg_gen_subi_i64(tmp, res, d_repl * 0x00010001u); + tcg_gen_andc_i64(tmp, tmp, res); + tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 4: /* SDC / NDC */ - tcg_gen_andi_reg(cb, cb, d_repl * 0x88888888u); + tcg_gen_andi_i64(cb, cb, d_repl * 0x88888888u); cond = cond_make_0(TCG_COND_NE, cb); break; case 6: /* SBC / NBC */ - tcg_gen_andi_reg(cb, cb, d_repl * 0x80808080u); + tcg_gen_andi_i64(cb, cb, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, cb); break; case 7: /* SHC / NHC */ - tcg_gen_andi_reg(cb, cb, d_repl * 0x80008000u); + tcg_gen_andi_i64(cb, cb, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, cb); break; @@ -1054,55 +959,55 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, return cond; } -static TCGv_reg get_carry(DisasContext *ctx, bool d, - TCGv_reg cb, TCGv_reg cb_msb) +static TCGv_i64 get_carry(DisasContext *ctx, bool d, + TCGv_i64 cb, TCGv_i64 cb_msb) { if (cond_need_ext(ctx, d)) { - TCGv_reg t = tcg_temp_new(); - tcg_gen_extract_reg(t, cb, 32, 1); + TCGv_i64 t = tcg_temp_new(); + tcg_gen_extract_i64(t, cb, 32, 1); return t; } return cb_msb; } -static TCGv_reg get_psw_carry(DisasContext *ctx, bool d) +static TCGv_i64 get_psw_carry(DisasContext *ctx, bool d) { return get_carry(ctx, d, cpu_psw_cb, cpu_psw_cb_msb); } /* Compute signed overflow for addition. */ -static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2) +static TCGv_i64 do_add_sv(DisasContext *ctx, TCGv_i64 res, + TCGv_i64 in1, TCGv_i64 in2) { - TCGv_reg sv = tcg_temp_new(); - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); - tcg_gen_xor_reg(sv, res, in1); - tcg_gen_xor_reg(tmp, in1, in2); - tcg_gen_andc_reg(sv, sv, tmp); + tcg_gen_xor_i64(sv, res, in1); + tcg_gen_xor_i64(tmp, in1, in2); + tcg_gen_andc_i64(sv, sv, tmp); return sv; } /* Compute signed overflow for subtraction. */ -static TCGv_reg do_sub_sv(DisasContext *ctx, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2) +static TCGv_i64 do_sub_sv(DisasContext *ctx, TCGv_i64 res, + TCGv_i64 in1, TCGv_i64 in2) { - TCGv_reg sv = tcg_temp_new(); - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); - tcg_gen_xor_reg(sv, res, in1); - tcg_gen_xor_reg(tmp, in1, in2); - tcg_gen_and_reg(sv, sv, tmp); + tcg_gen_xor_i64(sv, res, in1); + tcg_gen_xor_i64(tmp, in1, in2); + tcg_gen_and_i64(sv, sv, tmp); return sv; } -static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned shift, bool is_l, +static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned shift, bool is_l, bool is_tsv, bool is_tc, bool is_c, unsigned cf, bool d) { - TCGv_reg dest, cb, cb_msb, cb_cond, sv, tmp; + TCGv_i64 dest, cb, cb_msb, cb_cond, sv, tmp; unsigned c = cf >> 1; DisasCond cond; @@ -1113,29 +1018,29 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (shift) { tmp = tcg_temp_new(); - tcg_gen_shli_reg(tmp, in1, shift); + tcg_gen_shli_i64(tmp, in1, shift); in1 = tmp; } if (!is_l || cond_need_cb(c)) { - TCGv_reg zero = tcg_constant_reg(0); + TCGv_i64 zero = tcg_constant_i64(0); cb_msb = tcg_temp_new(); cb = tcg_temp_new(); - tcg_gen_add2_reg(dest, cb_msb, in1, zero, in2, zero); + tcg_gen_add2_i64(dest, cb_msb, in1, zero, in2, zero); if (is_c) { - tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, + tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, get_psw_carry(ctx, d), zero); } - tcg_gen_xor_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_xor_i64(cb, in1, in2); + tcg_gen_xor_i64(cb, cb, dest); if (cond_need_cb(c)) { cb_cond = get_carry(ctx, d, cb, cb_msb); } } else { - tcg_gen_add_reg(dest, in1, in2); + tcg_gen_add_i64(dest, in1, in2); if (is_c) { - tcg_gen_add_reg(dest, dest, get_psw_carry(ctx, d)); + tcg_gen_add_i64(dest, dest, get_psw_carry(ctx, d)); } } @@ -1153,7 +1058,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, cond = do_cond(ctx, cf, d, dest, cb_cond, sv); if (is_tc) { tmp = tcg_temp_new(); - tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); + tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1172,7 +1077,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_d_sh *a, bool is_l, bool is_tsv, bool is_tc, bool is_c) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -1187,23 +1092,23 @@ static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_d_sh *a, static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv, bool is_tc) { - TCGv_reg tcg_im, tcg_r2; + TCGv_i64 tcg_im, tcg_r2; if (a->cf) { nullify_over(ctx); } - tcg_im = tcg_constant_reg(a->i); + tcg_im = tcg_constant_i64(a->i); tcg_r2 = load_gpr(ctx, a->r); /* All ADDI conditions are 32-bit. */ do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf, false); return nullify_end(ctx); } -static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, bool is_tsv, bool is_b, +static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, bool is_tsv, bool is_b, bool is_tc, unsigned cf, bool d) { - TCGv_reg dest, sv, cb, cb_msb, zero, tmp; + TCGv_i64 dest, sv, cb, cb_msb, zero, tmp; unsigned c = cf >> 1; DisasCond cond; @@ -1211,23 +1116,23 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, cb = tcg_temp_new(); cb_msb = tcg_temp_new(); - zero = tcg_constant_reg(0); + zero = tcg_constant_i64(0); if (is_b) { /* DEST,C = IN1 + ~IN2 + C. */ - tcg_gen_not_reg(cb, in2); - tcg_gen_add2_reg(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); - tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cb, zero); - tcg_gen_xor_reg(cb, cb, in1); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_not_i64(cb, in2); + tcg_gen_add2_i64(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); + tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, cb, zero); + tcg_gen_xor_i64(cb, cb, in1); + tcg_gen_xor_i64(cb, cb, dest); } else { /* * DEST,C = IN1 + ~IN2 + 1. We can produce the same result in fewer * operations by seeding the high word with 1 and subtracting. */ - TCGv_reg one = tcg_constant_reg(1); - tcg_gen_sub2_reg(dest, cb_msb, in1, one, in2, zero); - tcg_gen_eqv_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + TCGv_i64 one = tcg_constant_i64(1); + tcg_gen_sub2_i64(dest, cb_msb, in1, one, in2, zero); + tcg_gen_eqv_i64(cb, in1, in2); + tcg_gen_xor_i64(cb, cb, dest); } /* Compute signed overflow if required. */ @@ -1249,7 +1154,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Emit any conditional trap before any writeback. */ if (is_tc) { tmp = tcg_temp_new(); - tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); + tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1266,7 +1171,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tsv, bool is_b, bool is_tc) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -1279,26 +1184,26 @@ static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf_d *a, static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) { - TCGv_reg tcg_im, tcg_r2; + TCGv_i64 tcg_im, tcg_r2; if (a->cf) { nullify_over(ctx); } - tcg_im = tcg_constant_reg(a->i); + tcg_im = tcg_constant_i64(a->i); tcg_r2 = load_gpr(ctx, a->r); /* All SUBI conditions are 32-bit. */ do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf, false); return nullify_end(ctx); } -static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool d) +static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned cf, bool d) { - TCGv_reg dest, sv; + TCGv_i64 dest, sv; DisasCond cond; dest = tcg_temp_new(); - tcg_gen_sub_reg(dest, in1, in2); + tcg_gen_sub_i64(dest, in1, in2); /* Compute signed overflow if required. */ sv = NULL; @@ -1310,7 +1215,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, cond = do_sub_cond(ctx, cf, d, dest, in1, in2, sv); /* Clear. */ - tcg_gen_movi_reg(dest, 0); + tcg_gen_movi_i64(dest, 0); save_gpr(ctx, rt, dest); /* Install the new nullification. */ @@ -1318,11 +1223,11 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, ctx->null_cond = cond; } -static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool d, - void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) +static void do_log(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned cf, bool d, + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) { - TCGv_reg dest = dest_gpr(ctx, rt); + TCGv_i64 dest = dest_gpr(ctx, rt); /* Perform the operation, and writeback. */ fn(dest, in1, in2); @@ -1336,9 +1241,9 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, } static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, - void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -1349,11 +1254,11 @@ static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, return nullify_end(ctx); } -static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool d, bool is_tc, - void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) +static void do_unit(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned cf, bool d, bool is_tc, + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) { - TCGv_reg dest; + TCGv_i64 dest; DisasCond cond; if (cf == 0) { @@ -1368,8 +1273,8 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, cond = do_unit_cond(cf, d, dest, in1, in2); if (is_tc) { - TCGv_reg tmp = tcg_temp_new(); - tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); + TCGv_i64 tmp = tcg_temp_new(); + tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } save_gpr(ctx, rt, dest); @@ -1384,17 +1289,17 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, from the top 2 bits of the base register. There are a few system instructions that have a 3-bit space specifier, for which SR0 is not special. To handle this, pass ~SP. */ -static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) +static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_i64 base) { TCGv_ptr ptr; - TCGv_reg tmp; + TCGv_i64 tmp; TCGv_i64 spc; if (sp != 0) { if (sp < 0) { sp = ~sp; } - spc = tcg_temp_new_tl(); + spc = tcg_temp_new_i64(); load_spr(ctx, spc, sp); return spc; } @@ -1404,12 +1309,12 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) ptr = tcg_temp_new_ptr(); tmp = tcg_temp_new(); - spc = tcg_temp_new_tl(); + spc = tcg_temp_new_i64(); /* Extract top 2 bits of the address, shift left 3 for uint64_t index. */ - tcg_gen_shri_reg(tmp, base, (ctx->tb_flags & PSW_W ? 64 : 32) - 5); - tcg_gen_andi_reg(tmp, tmp, 030); - tcg_gen_trunc_reg_ptr(ptr, tmp); + tcg_gen_shri_i64(tmp, base, (ctx->tb_flags & PSW_W ? 64 : 32) - 5); + tcg_gen_andi_i64(tmp, tmp, 030); + tcg_gen_trunc_i64_ptr(ptr, tmp); tcg_gen_add_ptr(ptr, ptr, tcg_env); tcg_gen_ld_i64(spc, ptr, offsetof(CPUHPPAState, sr[4])); @@ -1418,28 +1323,28 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) } #endif -static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, +static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, bool is_phys) { - TCGv_reg base = load_gpr(ctx, rb); - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 base = load_gpr(ctx, rb); + TCGv_i64 ofs; + TCGv_i64 addr; /* Note that RX is mutually exclusive with DISP. */ if (rx) { ofs = tcg_temp_new(); - tcg_gen_shli_reg(ofs, cpu_gr[rx], scale); - tcg_gen_add_reg(ofs, ofs, base); + tcg_gen_shli_i64(ofs, cpu_gr[rx], scale); + tcg_gen_add_i64(ofs, ofs, base); } else if (disp || modify) { ofs = tcg_temp_new(); - tcg_gen_addi_reg(ofs, base, disp); + tcg_gen_addi_i64(ofs, base, disp); } else { ofs = base; } *pofs = ofs; - *pgva = addr = tcg_temp_new_tl(); + *pgva = addr = tcg_temp_new_i64(); tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); tcg_gen_andi_tl(addr, addr, gva_offset_mask(ctx)); #ifndef CONFIG_USER_ONLY @@ -1458,8 +1363,8 @@ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1476,8 +1381,8 @@ static void do_load_64(DisasContext *ctx, TCGv_i64 dest, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1494,8 +1399,8 @@ static void do_store_32(DisasContext *ctx, TCGv_i32 src, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1512,8 +1417,8 @@ static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1526,14 +1431,11 @@ static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, } } -#define do_load_reg do_load_64 -#define do_store_reg do_store_64 - static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg dest; + TCGv_i64 dest; nullify_over(ctx); @@ -1544,7 +1446,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, /* Make sure if RT == RB, we see the result of the load. */ dest = tcg_temp_new(); } - do_load_reg(ctx, dest, rb, rx, scale, disp, sp, modify, mop); + do_load_64(ctx, dest, rb, rx, scale, disp, sp, modify, mop); save_gpr(ctx, rt, dest); return nullify_end(ctx); @@ -1605,7 +1507,7 @@ static bool do_store(DisasContext *ctx, unsigned rt, unsigned rb, int modify, MemOp mop) { nullify_over(ctx); - do_store_reg(ctx, load_gpr(ctx, rt), rb, 0, 0, disp, sp, modify, mop); + do_store_64(ctx, load_gpr(ctx, rt), rb, 0, 0, disp, sp, modify, mop); return nullify_end(ctx); } @@ -1799,7 +1701,7 @@ static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, } taken = gen_new_label(); - tcg_gen_brcond_reg(c, cond->a0, cond->a1, taken); + tcg_gen_brcond_i64(c, cond->a0, cond->a1, taken); cond_free(cond); /* Not taken: Condition not satisfied; nullify on backward branches. */ @@ -1816,7 +1718,7 @@ static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, if (ctx->iaoq_n == -1) { /* The temporary iaoq_n_var died at the branch above. Regenerate it here instead of saving it. */ - tcg_gen_addi_reg(ctx->iaoq_n_var, cpu_iaoq_b, 4); + tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); } gen_goto_tb(ctx, 0, ctx->iaoq_b, ctx->iaoq_n); } @@ -1846,10 +1748,10 @@ static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, /* Emit an unconditional branch to an indirect target. This handles nullification of the branch itself. */ -static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, +static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, unsigned link, bool is_n) { - TCGv_reg a0, a1, next, tmp; + TCGv_i64 a0, a1, next, tmp; TCGCond c; assert(ctx->null_lab == NULL); @@ -1859,11 +1761,11 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, copy_iaoq_entry(ctx, cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } next = tcg_temp_new(); - tcg_gen_mov_reg(next, dest); + tcg_gen_mov_i64(next, dest); if (is_n) { if (use_nullify_skip(ctx)) { copy_iaoq_entry(ctx, cpu_iaoq_f, -1, next); - tcg_gen_addi_reg(next, next, 4); + tcg_gen_addi_i64(next, next, 4); copy_iaoq_entry(ctx, cpu_iaoq_b, -1, next); nullify_set(ctx, 0); ctx->base.is_jmp = DISAS_IAQ_N_UPDATED; @@ -1888,7 +1790,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, can simply store DEST optimistically. Similarly with IAOQ_B. */ copy_iaoq_entry(ctx, cpu_iaoq_f, -1, dest); next = tcg_temp_new(); - tcg_gen_addi_reg(next, dest, 4); + tcg_gen_addi_i64(next, dest, 4); copy_iaoq_entry(ctx, cpu_iaoq_b, -1, next); nullify_over(ctx); @@ -1906,19 +1808,19 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, next = tcg_temp_new(); copy_iaoq_entry(ctx, tmp, ctx->iaoq_n, ctx->iaoq_n_var); - tcg_gen_movcond_reg(c, next, a0, a1, tmp, dest); + tcg_gen_movcond_i64(c, next, a0, a1, tmp, dest); ctx->iaoq_n = -1; ctx->iaoq_n_var = next; if (link != 0) { - tcg_gen_movcond_reg(c, cpu_gr[link], a0, a1, cpu_gr[link], tmp); + tcg_gen_movcond_i64(c, cpu_gr[link], a0, a1, cpu_gr[link], tmp); } if (is_n) { /* The branch nullifies the next insn, which means the state of N after the branch is the inverse of the state of N that applied to the branch. */ - tcg_gen_setcond_reg(tcg_invert_cond(c), cpu_psw_n, a0, a1); + tcg_gen_setcond_i64(tcg_invert_cond(c), cpu_psw_n, a0, a1); cond_free(&ctx->null_cond); ctx->null_cond = cond_make_n(); ctx->psw_n_nonzero = true; @@ -1936,9 +1838,9 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, * IAOQ_Next{30..31} ← IAOQ_Front{30..31}; * which keeps the privilege level from being increased. */ -static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) +static TCGv_i64 do_ibranch_priv(DisasContext *ctx, TCGv_i64 offset) { - TCGv_reg dest; + TCGv_i64 dest; switch (ctx->privilege) { case 0: /* Privilege 0 is maximum and is allowed to decrease. */ @@ -1946,13 +1848,13 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) case 3: /* Privilege 3 is minimum and is never allowed to increase. */ dest = tcg_temp_new(); - tcg_gen_ori_reg(dest, offset, 3); + tcg_gen_ori_i64(dest, offset, 3); break; default: dest = tcg_temp_new(); - tcg_gen_andi_reg(dest, offset, -4); - tcg_gen_ori_reg(dest, dest, ctx->privilege); - tcg_gen_movcond_reg(TCG_COND_GTU, dest, dest, offset, dest, offset); + tcg_gen_andi_i64(dest, offset, -4); + tcg_gen_ori_i64(dest, dest, ctx->privilege); + tcg_gen_movcond_i64(TCG_COND_GTU, dest, dest, offset, dest, offset); break; } return dest; @@ -1968,7 +1870,7 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) aforementioned BE. */ static void do_page_zero(DisasContext *ctx) { - TCGv_reg tmp; + TCGv_i64 tmp; /* If by some means we get here with PSW[N]=1, that implies that the B,GATE instruction would be skipped, and we'd fault on the @@ -1977,7 +1879,7 @@ static void do_page_zero(DisasContext *ctx) case TCG_COND_NEVER: break; case TCG_COND_ALWAYS: - tcg_gen_movi_reg(cpu_psw_n, 0); + tcg_gen_movi_i64(cpu_psw_n, 0); goto do_sigill; default: /* Since this is always the first (and only) insn within the @@ -2005,11 +1907,11 @@ static void do_page_zero(DisasContext *ctx) break; case 0xe0: /* SET_THREAD_POINTER */ - tcg_gen_st_reg(cpu_gr[26], tcg_env, offsetof(CPUHPPAState, cr[27])); + tcg_gen_st_i64(cpu_gr[26], tcg_env, offsetof(CPUHPPAState, cr[27])); tmp = tcg_temp_new(); - tcg_gen_ori_reg(tmp, cpu_gr[31], 3); + tcg_gen_ori_i64(tmp, cpu_gr[31], 3); copy_iaoq_entry(ctx, cpu_iaoq_f, -1, tmp); - tcg_gen_addi_reg(tmp, tmp, 4); + tcg_gen_addi_i64(tmp, tmp, 4); copy_iaoq_entry(ctx, cpu_iaoq_b, -1, tmp); ctx->base.is_jmp = DISAS_IAQ_N_UPDATED; break; @@ -2051,8 +1953,8 @@ static bool trans_sync(DisasContext *ctx, arg_sync *a) static bool trans_mfia(DisasContext *ctx, arg_mfia *a) { unsigned rt = a->t; - TCGv_reg tmp = dest_gpr(ctx, rt); - tcg_gen_movi_reg(tmp, ctx->iaoq_f); + TCGv_i64 tmp = dest_gpr(ctx, rt); + tcg_gen_movi_i64(tmp, ctx->iaoq_f); save_gpr(ctx, rt, tmp); cond_free(&ctx->null_cond); @@ -2064,7 +1966,7 @@ static bool trans_mfsp(DisasContext *ctx, arg_mfsp *a) unsigned rt = a->t; unsigned rs = a->sp; TCGv_i64 t0 = tcg_temp_new_i64(); - TCGv_reg t1 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new(); load_spr(ctx, t0, rs); tcg_gen_shri_i64(t0, t0, 32); @@ -2080,14 +1982,14 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) { unsigned rt = a->t; unsigned ctl = a->r; - TCGv_reg tmp; + TCGv_i64 tmp; switch (ctl) { case CR_SAR: if (a->e == 0) { /* MFSAR without ,W masks low 5 bits. */ tmp = dest_gpr(ctx, rt); - tcg_gen_andi_reg(tmp, cpu_sar, 31); + tcg_gen_andi_i64(tmp, cpu_sar, 31); save_gpr(ctx, rt, tmp); goto done; } @@ -2115,7 +2017,7 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) } tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); save_gpr(ctx, rt, tmp); done: @@ -2151,13 +2053,13 @@ static bool trans_mtsp(DisasContext *ctx, arg_mtsp *a) static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) { unsigned ctl = a->t; - TCGv_reg reg; - TCGv_reg tmp; + TCGv_i64 reg; + TCGv_i64 tmp; if (ctl == CR_SAR) { reg = load_gpr(ctx, a->r); tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, reg, ctx->is_pa20 ? 63 : 31); + tcg_gen_andi_i64(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); @@ -2188,10 +2090,10 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) /* FIXME: Respect PSW_Q bit */ /* The write advances the queue and stores to the back element. */ tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); - tcg_gen_st_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); - tcg_gen_st_reg(reg, tcg_env, + tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_st_i64(reg, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); break; @@ -2199,14 +2101,14 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) case CR_PID2: case CR_PID3: case CR_PID4: - tcg_gen_st_reg(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_st_i64(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); #ifndef CONFIG_USER_ONLY gen_helper_change_prot_id(tcg_env); #endif break; default: - tcg_gen_st_reg(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_st_i64(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); break; } return nullify_end(ctx); @@ -2215,10 +2117,10 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) { - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); - tcg_gen_not_reg(tmp, load_gpr(ctx, a->r)); - tcg_gen_andi_reg(tmp, tmp, ctx->is_pa20 ? 63 : 31); + tcg_gen_not_i64(tmp, load_gpr(ctx, a->r)); + tcg_gen_andi_i64(tmp, tmp, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); @@ -2227,11 +2129,11 @@ static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) static bool trans_ldsid(DisasContext *ctx, arg_ldsid *a) { - TCGv_reg dest = dest_gpr(ctx, a->t); + TCGv_i64 dest = dest_gpr(ctx, a->t); #ifdef CONFIG_USER_ONLY /* We don't implement space registers in user mode. */ - tcg_gen_movi_reg(dest, 0); + tcg_gen_movi_i64(dest, 0); #else TCGv_i64 t0 = tcg_temp_new_i64(); @@ -2249,13 +2151,13 @@ static bool trans_rsm(DisasContext *ctx, arg_rsm *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_reg tmp; + TCGv_i64 tmp; nullify_over(ctx); tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); - tcg_gen_andi_reg(tmp, tmp, ~a->i); + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); + tcg_gen_andi_i64(tmp, tmp, ~a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); save_gpr(ctx, a->t, tmp); @@ -2269,13 +2171,13 @@ static bool trans_ssm(DisasContext *ctx, arg_ssm *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_reg tmp; + TCGv_i64 tmp; nullify_over(ctx); tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); - tcg_gen_ori_reg(tmp, tmp, a->i); + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); + tcg_gen_ori_i64(tmp, tmp, a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); save_gpr(ctx, a->t, tmp); @@ -2289,7 +2191,7 @@ static bool trans_mtsm(DisasContext *ctx, arg_mtsm *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_reg tmp, reg; + TCGv_i64 tmp, reg; nullify_over(ctx); reg = load_gpr(ctx, a->r); @@ -2366,12 +2268,12 @@ static bool trans_getshadowregs(DisasContext *ctx, arg_getshadowregs *a) static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a) { if (a->m) { - TCGv_reg dest = dest_gpr(ctx, a->b); - TCGv_reg src1 = load_gpr(ctx, a->b); - TCGv_reg src2 = load_gpr(ctx, a->x); + TCGv_i64 dest = dest_gpr(ctx, a->b); + TCGv_i64 src1 = load_gpr(ctx, a->b); + TCGv_i64 src2 = load_gpr(ctx, a->x); /* The only thing we need to do is the base register modification. */ - tcg_gen_add_reg(dest, src1, src2); + tcg_gen_add_i64(dest, src1, src2); save_gpr(ctx, a->b, dest); } cond_free(&ctx->null_cond); @@ -2380,9 +2282,9 @@ static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a) static bool trans_probe(DisasContext *ctx, arg_probe *a) { - TCGv_reg dest, ofs; + TCGv_i64 dest, ofs; TCGv_i32 level, want; - TCGv_tl addr; + TCGv_i64 addr; nullify_over(ctx); @@ -2393,7 +2295,7 @@ static bool trans_probe(DisasContext *ctx, arg_probe *a) level = tcg_constant_i32(a->ri); } else { level = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(level, load_gpr(ctx, a->ri)); + tcg_gen_extrl_i64_i32(level, load_gpr(ctx, a->ri)); tcg_gen_andi_i32(level, level, 3); } want = tcg_constant_i32(a->write ? PAGE_WRITE : PAGE_READ); @@ -2411,8 +2313,8 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl addr; - TCGv_reg ofs, reg; + TCGv_i64 addr; + TCGv_i64 ofs, reg; nullify_over(ctx); @@ -2436,8 +2338,8 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl addr; - TCGv_reg ofs; + TCGv_i64 addr; + TCGv_i64 ofs; nullify_over(ctx); @@ -2472,8 +2374,8 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl addr, atl, stl; - TCGv_reg reg; + TCGv_i64 addr, atl, stl; + TCGv_i64 reg; nullify_over(ctx); @@ -2483,9 +2385,9 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) * return gen_illegal(ctx); */ - atl = tcg_temp_new_tl(); - stl = tcg_temp_new_tl(); - addr = tcg_temp_new_tl(); + atl = tcg_temp_new_i64(); + stl = tcg_temp_new_i64(); + addr = tcg_temp_new_i64(); tcg_gen_ld32u_i64(stl, tcg_env, a->data ? offsetof(CPUHPPAState, cr[CR_ISR]) @@ -2541,8 +2443,8 @@ static bool trans_lpa(DisasContext *ctx, arg_ldst *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl vaddr; - TCGv_reg ofs, paddr; + TCGv_i64 vaddr; + TCGv_i64 ofs, paddr; nullify_over(ctx); @@ -2569,7 +2471,7 @@ static bool trans_lci(DisasContext *ctx, arg_lci *a) physical address. Two addresses with the same CI have a coherent view of the cache. Our implementation is to return 0 for all, since the entire address space is coherent. */ - save_gpr(ctx, a->t, tcg_constant_reg(0)); + save_gpr(ctx, a->t, tcg_constant_i64(0)); cond_free(&ctx->null_cond); return true; @@ -2632,12 +2534,12 @@ static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf_d *a) static bool trans_andcm(DisasContext *ctx, arg_rrr_cf_d *a) { - return do_log_reg(ctx, a, tcg_gen_andc_reg); + return do_log_reg(ctx, a, tcg_gen_andc_i64); } static bool trans_and(DisasContext *ctx, arg_rrr_cf_d *a) { - return do_log_reg(ctx, a, tcg_gen_and_reg); + return do_log_reg(ctx, a, tcg_gen_and_i64); } static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) @@ -2653,8 +2555,8 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) } if (r2 == 0) { /* COPY */ if (r1 == 0) { - TCGv_reg dest = dest_gpr(ctx, rt); - tcg_gen_movi_reg(dest, 0); + TCGv_i64 dest = dest_gpr(ctx, rt); + tcg_gen_movi_i64(dest, 0); save_gpr(ctx, rt, dest); } else { save_gpr(ctx, rt, cpu_gr[r1]); @@ -2689,17 +2591,17 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) } #endif } - return do_log_reg(ctx, a, tcg_gen_or_reg); + return do_log_reg(ctx, a, tcg_gen_or_i64); } static bool trans_xor(DisasContext *ctx, arg_rrr_cf_d *a) { - return do_log_reg(ctx, a, tcg_gen_xor_reg); + return do_log_reg(ctx, a, tcg_gen_xor_i64); } static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf_d *a) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -2712,20 +2614,20 @@ static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf_d *a) static bool trans_uxor(DisasContext *ctx, arg_rrr_cf_d *a) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, false, tcg_gen_xor_reg); + do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, false, tcg_gen_xor_i64); return nullify_end(ctx); } static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) { - TCGv_reg tcg_r1, tcg_r2, tmp; + TCGv_i64 tcg_r1, tcg_r2, tmp; if (a->cf) { nullify_over(ctx); @@ -2733,8 +2635,8 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); tmp = tcg_temp_new(); - tcg_gen_not_reg(tmp, tcg_r2); - do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_reg); + tcg_gen_not_i64(tmp, tcg_r2); + do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_i64); return nullify_end(ctx); } @@ -2750,19 +2652,19 @@ static bool trans_uaddcm_tc(DisasContext *ctx, arg_rrr_cf_d *a) static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) { - TCGv_reg tmp; + TCGv_i64 tmp; nullify_over(ctx); tmp = tcg_temp_new(); - tcg_gen_shri_reg(tmp, cpu_psw_cb, 3); + tcg_gen_shri_i64(tmp, cpu_psw_cb, 3); if (!is_i) { - tcg_gen_not_reg(tmp, tmp); + tcg_gen_not_i64(tmp, tmp); } - tcg_gen_andi_reg(tmp, tmp, (uint64_t)0x1111111111111111ull); - tcg_gen_muli_reg(tmp, tmp, 6); + tcg_gen_andi_i64(tmp, tmp, (uint64_t)0x1111111111111111ull); + tcg_gen_muli_i64(tmp, tmp, 6); do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, a->d, false, - is_i ? tcg_gen_add_reg : tcg_gen_sub_reg); + is_i ? tcg_gen_add_i64 : tcg_gen_sub_i64); return nullify_end(ctx); } @@ -2778,8 +2680,8 @@ static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf_d *a) static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) { - TCGv_reg dest, add1, add2, addc, zero, in1, in2; - TCGv_reg cout; + TCGv_i64 dest, add1, add2, addc, zero, in1, in2; + TCGv_i64 cout; nullify_over(ctx); @@ -2790,11 +2692,11 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) add2 = tcg_temp_new(); addc = tcg_temp_new(); dest = tcg_temp_new(); - zero = tcg_constant_reg(0); + zero = tcg_constant_i64(0); /* Form R1 << 1 | PSW[CB]{8}. */ - tcg_gen_add_reg(add1, in1, in1); - tcg_gen_add_reg(add1, add1, get_psw_carry(ctx, false)); + tcg_gen_add_i64(add1, in1, in1); + tcg_gen_add_i64(add1, add1, get_psw_carry(ctx, false)); /* * Add or subtract R2, depending on PSW[V]. Proper computation of @@ -2802,28 +2704,28 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) * the manual. By extracting and masking V, we can produce the * proper inputs to the addition without movcond. */ - tcg_gen_sextract_reg(addc, cpu_psw_v, 31, 1); - tcg_gen_xor_reg(add2, in2, addc); - tcg_gen_andi_reg(addc, addc, 1); + tcg_gen_sextract_i64(addc, cpu_psw_v, 31, 1); + tcg_gen_xor_i64(add2, in2, addc); + tcg_gen_andi_i64(addc, addc, 1); - tcg_gen_add2_reg(dest, cpu_psw_cb_msb, add1, zero, add2, zero); - tcg_gen_add2_reg(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, add1, zero, add2, zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); /* Write back the result register. */ save_gpr(ctx, a->t, dest); /* Write back PSW[CB]. */ - tcg_gen_xor_reg(cpu_psw_cb, add1, add2); - tcg_gen_xor_reg(cpu_psw_cb, cpu_psw_cb, dest); + tcg_gen_xor_i64(cpu_psw_cb, add1, add2); + tcg_gen_xor_i64(cpu_psw_cb, cpu_psw_cb, dest); /* Write back PSW[V] for the division step. */ cout = get_psw_carry(ctx, false); - tcg_gen_neg_reg(cpu_psw_v, cout); - tcg_gen_xor_reg(cpu_psw_v, cpu_psw_v, in2); + tcg_gen_neg_i64(cpu_psw_v, cout); + tcg_gen_xor_i64(cpu_psw_v, cpu_psw_v, in2); /* Install the new nullification. */ if (a->cf) { - TCGv_reg sv = NULL; + TCGv_i64 sv = NULL; if (cond_need_sv(a->cf >> 1)) { /* ??? The lshift is supposed to contribute to overflow. */ sv = do_add_sv(ctx, dest, add1, add2); @@ -2866,13 +2768,13 @@ static bool trans_subi_tsv(DisasContext *ctx, arg_rri_cf *a) static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) { - TCGv_reg tcg_im, tcg_r2; + TCGv_i64 tcg_im, tcg_r2; if (a->cf) { nullify_over(ctx); } - tcg_im = tcg_constant_reg(a->i); + tcg_im = tcg_constant_i64(a->i); tcg_r2 = load_gpr(ctx, a->r); do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf, a->d); @@ -2900,8 +2802,8 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a) static bool trans_ldc(DisasContext *ctx, arg_ldst *a) { MemOp mop = MO_TE | MO_ALIGN | a->size; - TCGv_reg zero, dest, ofs; - TCGv_tl addr; + TCGv_i64 zero, dest, ofs; + TCGv_i64 addr; if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); @@ -2930,8 +2832,8 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) */ gen_helper_ldc_check(addr); - zero = tcg_constant_reg(0); - tcg_gen_atomic_xchg_reg(dest, addr, zero, ctx->mmu_idx, mop); + zero = tcg_constant_i64(0); + tcg_gen_atomic_xchg_i64(dest, addr, zero, ctx->mmu_idx, mop); if (a->m) { save_gpr(ctx, a->b, ofs); @@ -2943,8 +2845,8 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) static bool trans_stby(DisasContext *ctx, arg_stby *a) { - TCGv_reg ofs, val; - TCGv_tl addr; + TCGv_i64 ofs, val; + TCGv_i64 addr; nullify_over(ctx); @@ -2965,7 +2867,7 @@ static bool trans_stby(DisasContext *ctx, arg_stby *a) } } if (a->m) { - tcg_gen_andi_reg(ofs, ofs, ~3); + tcg_gen_andi_i64(ofs, ofs, ~3); save_gpr(ctx, a->b, ofs); } @@ -2974,8 +2876,8 @@ static bool trans_stby(DisasContext *ctx, arg_stby *a) static bool trans_stdby(DisasContext *ctx, arg_stby *a) { - TCGv_reg ofs, val; - TCGv_tl addr; + TCGv_i64 ofs, val; + TCGv_i64 addr; nullify_over(ctx); @@ -2996,7 +2898,7 @@ static bool trans_stdby(DisasContext *ctx, arg_stby *a) } } if (a->m) { - tcg_gen_andi_reg(ofs, ofs, ~7); + tcg_gen_andi_i64(ofs, ofs, ~7); save_gpr(ctx, a->b, ofs); } @@ -3027,9 +2929,9 @@ static bool trans_sta(DisasContext *ctx, arg_ldst *a) static bool trans_ldil(DisasContext *ctx, arg_ldil *a) { - TCGv_reg tcg_rt = dest_gpr(ctx, a->t); + TCGv_i64 tcg_rt = dest_gpr(ctx, a->t); - tcg_gen_movi_reg(tcg_rt, a->i); + tcg_gen_movi_i64(tcg_rt, a->i); save_gpr(ctx, a->t, tcg_rt); cond_free(&ctx->null_cond); return true; @@ -3037,10 +2939,10 @@ static bool trans_ldil(DisasContext *ctx, arg_ldil *a) static bool trans_addil(DisasContext *ctx, arg_addil *a) { - TCGv_reg tcg_rt = load_gpr(ctx, a->r); - TCGv_reg tcg_r1 = dest_gpr(ctx, 1); + TCGv_i64 tcg_rt = load_gpr(ctx, a->r); + TCGv_i64 tcg_r1 = dest_gpr(ctx, 1); - tcg_gen_addi_reg(tcg_r1, tcg_rt, a->i); + tcg_gen_addi_i64(tcg_r1, tcg_rt, a->i); save_gpr(ctx, 1, tcg_r1); cond_free(&ctx->null_cond); return true; @@ -3048,30 +2950,30 @@ static bool trans_addil(DisasContext *ctx, arg_addil *a) static bool trans_ldo(DisasContext *ctx, arg_ldo *a) { - TCGv_reg tcg_rt = dest_gpr(ctx, a->t); + TCGv_i64 tcg_rt = dest_gpr(ctx, a->t); /* Special case rb == 0, for the LDI pseudo-op. The COPY pseudo-op is handled for free within tcg_gen_addi_tl. */ if (a->b == 0) { - tcg_gen_movi_reg(tcg_rt, a->i); + tcg_gen_movi_i64(tcg_rt, a->i); } else { - tcg_gen_addi_reg(tcg_rt, cpu_gr[a->b], a->i); + tcg_gen_addi_i64(tcg_rt, cpu_gr[a->b], a->i); } save_gpr(ctx, a->t, tcg_rt); cond_free(&ctx->null_cond); return true; } -static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, +static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_i64 in1, unsigned c, unsigned f, bool d, unsigned n, int disp) { - TCGv_reg dest, in2, sv; + TCGv_i64 dest, in2, sv; DisasCond cond; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); - tcg_gen_sub_reg(dest, in1, in2); + tcg_gen_sub_i64(dest, in1, in2); sv = NULL; if (cond_need_sv(c)) { @@ -3098,14 +3000,14 @@ static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) return false; } nullify_over(ctx); - return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), + return do_cmpb(ctx, a->r, tcg_constant_i64(a->i), a->c, a->f, a->d, a->n, a->disp); } -static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, +static bool do_addb(DisasContext *ctx, unsigned r, TCGv_i64 in1, unsigned c, unsigned f, unsigned n, int disp) { - TCGv_reg dest, in2, sv, cb_cond; + TCGv_i64 dest, in2, sv, cb_cond; DisasCond cond; bool d = false; @@ -3126,16 +3028,16 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, cb_cond = NULL; if (cond_need_cb(c)) { - TCGv_reg cb = tcg_temp_new(); - TCGv_reg cb_msb = tcg_temp_new(); + TCGv_i64 cb = tcg_temp_new(); + TCGv_i64 cb_msb = tcg_temp_new(); - tcg_gen_movi_reg(cb_msb, 0); - tcg_gen_add2_reg(dest, cb_msb, in1, cb_msb, in2, cb_msb); - tcg_gen_xor_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_movi_i64(cb_msb, 0); + tcg_gen_add2_i64(dest, cb_msb, in1, cb_msb, in2, cb_msb); + tcg_gen_xor_i64(cb, in1, in2); + tcg_gen_xor_i64(cb, cb, dest); cb_cond = get_carry(ctx, d, cb, cb_msb); } else { - tcg_gen_add_reg(dest, in1, in2); + tcg_gen_add_i64(dest, in1, in2); } if (cond_need_sv(c)) { sv = do_add_sv(ctx, dest, in1, in2); @@ -3155,12 +3057,12 @@ static bool trans_addb(DisasContext *ctx, arg_addb *a) static bool trans_addbi(DisasContext *ctx, arg_addbi *a) { nullify_over(ctx); - return do_addb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); + return do_addb(ctx, a->r, tcg_constant_i64(a->i), a->c, a->f, a->n, a->disp); } static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) { - TCGv_reg tmp, tcg_r; + TCGv_i64 tmp, tcg_r; DisasCond cond; nullify_over(ctx); @@ -3169,10 +3071,10 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) tcg_r = load_gpr(ctx, a->r); if (cond_need_ext(ctx, a->d)) { /* Force shift into [32,63] */ - tcg_gen_ori_reg(tmp, cpu_sar, 32); - tcg_gen_shl_reg(tmp, tcg_r, tmp); + tcg_gen_ori_i64(tmp, cpu_sar, 32); + tcg_gen_shl_i64(tmp, tcg_r, tmp); } else { - tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + tcg_gen_shl_i64(tmp, tcg_r, cpu_sar); } cond = cond_make_0_tmp(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); @@ -3181,7 +3083,7 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) { - TCGv_reg tmp, tcg_r; + TCGv_i64 tmp, tcg_r; DisasCond cond; int p; @@ -3190,7 +3092,7 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); p = a->p | (cond_need_ext(ctx, a->d) ? 32 : 0); - tcg_gen_shli_reg(tmp, tcg_r, p); + tcg_gen_shli_i64(tmp, tcg_r, p); cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond); @@ -3198,16 +3100,16 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) static bool trans_movb(DisasContext *ctx, arg_movb *a) { - TCGv_reg dest; + TCGv_i64 dest; DisasCond cond; nullify_over(ctx); dest = dest_gpr(ctx, a->r2); if (a->r1 == 0) { - tcg_gen_movi_reg(dest, 0); + tcg_gen_movi_i64(dest, 0); } else { - tcg_gen_mov_reg(dest, cpu_gr[a->r1]); + tcg_gen_mov_i64(dest, cpu_gr[a->r1]); } /* All MOVB conditions are 32-bit. */ @@ -3217,13 +3119,13 @@ static bool trans_movb(DisasContext *ctx, arg_movb *a) static bool trans_movbi(DisasContext *ctx, arg_movbi *a) { - TCGv_reg dest; + TCGv_i64 dest; DisasCond cond; nullify_over(ctx); dest = dest_gpr(ctx, a->r); - tcg_gen_movi_reg(dest, a->i); + tcg_gen_movi_i64(dest, a->i); /* All MOVBI conditions are 32-bit. */ cond = do_sed_cond(ctx, a->c, false, dest); @@ -3232,7 +3134,7 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) { - TCGv_reg dest, src2; + TCGv_i64 dest, src2; if (!ctx->is_pa20 && a->d) { return false; @@ -3245,44 +3147,44 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) src2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { if (a->d) { - tcg_gen_shr_reg(dest, src2, cpu_sar); + tcg_gen_shr_i64(dest, src2, cpu_sar); } else { - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); - tcg_gen_ext32u_reg(dest, src2); - tcg_gen_andi_reg(tmp, cpu_sar, 31); - tcg_gen_shr_reg(dest, dest, tmp); + tcg_gen_ext32u_i64(dest, src2); + tcg_gen_andi_i64(tmp, cpu_sar, 31); + tcg_gen_shr_i64(dest, dest, tmp); } } else if (a->r1 == a->r2) { if (a->d) { - tcg_gen_rotr_reg(dest, src2, cpu_sar); + tcg_gen_rotr_i64(dest, src2, cpu_sar); } else { TCGv_i32 t32 = tcg_temp_new_i32(); TCGv_i32 s32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, src2); - tcg_gen_trunc_reg_i32(s32, cpu_sar); + tcg_gen_extrl_i64_i32(t32, src2); + tcg_gen_extrl_i64_i32(s32, cpu_sar); tcg_gen_andi_i32(s32, s32, 31); tcg_gen_rotr_i32(t32, t32, s32); - tcg_gen_extu_i32_reg(dest, t32); + tcg_gen_extu_i32_i64(dest, t32); } } else { - TCGv_reg src1 = load_gpr(ctx, a->r1); + TCGv_i64 src1 = load_gpr(ctx, a->r1); if (a->d) { - TCGv_reg t = tcg_temp_new(); - TCGv_reg n = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new(); + TCGv_i64 n = tcg_temp_new(); - tcg_gen_xori_reg(n, cpu_sar, 63); - tcg_gen_shl_reg(t, src2, n); - tcg_gen_shli_reg(t, t, 1); - tcg_gen_shr_reg(dest, src1, cpu_sar); - tcg_gen_or_reg(dest, dest, t); + tcg_gen_xori_i64(n, cpu_sar, 63); + tcg_gen_shl_i64(t, src2, n); + tcg_gen_shli_i64(t, t, 1); + tcg_gen_shr_i64(dest, src1, cpu_sar); + tcg_gen_or_i64(dest, dest, t); } else { TCGv_i64 t = tcg_temp_new_i64(); TCGv_i64 s = tcg_temp_new_i64(); - tcg_gen_concat_reg_i64(t, src2, src1); + tcg_gen_concat32_i64(t, src2, src1); tcg_gen_extu_reg_i64(s, cpu_sar); tcg_gen_andi_i64(s, s, 31); tcg_gen_shr_i64(t, t, s); @@ -3302,7 +3204,7 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) { unsigned width, sa; - TCGv_reg dest, t2; + TCGv_i64 dest, t2; if (!ctx->is_pa20 && a->d) { return false; @@ -3317,19 +3219,19 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) dest = dest_gpr(ctx, a->t); t2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { - tcg_gen_extract_reg(dest, t2, sa, width - sa); + tcg_gen_extract_i64(dest, t2, sa, width - sa); } else if (width == TARGET_LONG_BITS) { - tcg_gen_extract2_reg(dest, t2, cpu_gr[a->r1], sa); + tcg_gen_extract2_i64(dest, t2, cpu_gr[a->r1], sa); } else { assert(!a->d); if (a->r1 == a->r2) { TCGv_i32 t32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, t2); + tcg_gen_extrl_i64_i32(t32, t2); tcg_gen_rotri_i32(t32, t32, sa); - tcg_gen_extu_i32_reg(dest, t32); + tcg_gen_extu_i32_i64(dest, t32); } else { TCGv_i64 t64 = tcg_temp_new_i64(); - tcg_gen_concat_reg_i64(t64, t2, cpu_gr[a->r1]); + tcg_gen_concat32_i64(t64, t2, cpu_gr[a->r1]); tcg_gen_shri_i64(t64, t64, sa); tcg_gen_trunc_i64_reg(dest, t64); } @@ -3347,7 +3249,7 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) { unsigned widthm1 = a->d ? 63 : 31; - TCGv_reg dest, src, tmp; + TCGv_i64 dest, src, tmp; if (!ctx->is_pa20 && a->d) { return false; @@ -3361,23 +3263,23 @@ static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) tmp = tcg_temp_new(); /* Recall that SAR is using big-endian bit numbering. */ - tcg_gen_andi_reg(tmp, cpu_sar, widthm1); - tcg_gen_xori_reg(tmp, tmp, widthm1); + tcg_gen_andi_i64(tmp, cpu_sar, widthm1); + tcg_gen_xori_i64(tmp, tmp, widthm1); if (a->se) { if (!a->d) { - tcg_gen_ext32s_reg(dest, src); + tcg_gen_ext32s_i64(dest, src); src = dest; } - tcg_gen_sar_reg(dest, src, tmp); - tcg_gen_sextract_reg(dest, dest, 0, a->len); + tcg_gen_sar_i64(dest, src, tmp); + tcg_gen_sextract_i64(dest, dest, 0, a->len); } else { if (!a->d) { - tcg_gen_ext32u_reg(dest, src); + tcg_gen_ext32u_i64(dest, src); src = dest; } - tcg_gen_shr_reg(dest, src, tmp); - tcg_gen_extract_reg(dest, dest, 0, a->len); + tcg_gen_shr_i64(dest, src, tmp); + tcg_gen_extract_i64(dest, dest, 0, a->len); } save_gpr(ctx, a->t, dest); @@ -3392,7 +3294,7 @@ static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) { unsigned len, cpos, width; - TCGv_reg dest, src; + TCGv_i64 dest, src; if (!ctx->is_pa20 && a->d) { return false; @@ -3411,9 +3313,9 @@ static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) dest = dest_gpr(ctx, a->t); src = load_gpr(ctx, a->r); if (a->se) { - tcg_gen_sextract_reg(dest, src, cpos, len); + tcg_gen_sextract_i64(dest, src, cpos, len); } else { - tcg_gen_extract_reg(dest, src, cpos, len); + tcg_gen_extract_i64(dest, src, cpos, len); } save_gpr(ctx, a->t, dest); @@ -3429,7 +3331,7 @@ static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) { unsigned len, width; uint64_t mask0, mask1; - TCGv_reg dest; + TCGv_i64 dest; if (!ctx->is_pa20 && a->d) { return false; @@ -3449,11 +3351,11 @@ static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) mask1 = deposit64(-1, a->cpos, len, a->i); if (a->nz) { - TCGv_reg src = load_gpr(ctx, a->t); - tcg_gen_andi_reg(dest, src, mask1); - tcg_gen_ori_reg(dest, dest, mask0); + TCGv_i64 src = load_gpr(ctx, a->t); + tcg_gen_andi_i64(dest, src, mask1); + tcg_gen_ori_i64(dest, dest, mask0); } else { - tcg_gen_movi_reg(dest, mask0); + tcg_gen_movi_i64(dest, mask0); } save_gpr(ctx, a->t, dest); @@ -3469,7 +3371,7 @@ static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) { unsigned rs = a->nz ? a->t : 0; unsigned len, width; - TCGv_reg dest, val; + TCGv_i64 dest, val; if (!ctx->is_pa20 && a->d) { return false; @@ -3487,9 +3389,9 @@ static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) dest = dest_gpr(ctx, a->t); val = load_gpr(ctx, a->r); if (rs == 0) { - tcg_gen_deposit_z_reg(dest, val, a->cpos, len); + tcg_gen_deposit_z_i64(dest, val, a->cpos, len); } else { - tcg_gen_deposit_reg(dest, cpu_gr[rs], val, a->cpos, len); + tcg_gen_deposit_i64(dest, cpu_gr[rs], val, a->cpos, len); } save_gpr(ctx, a->t, dest); @@ -3502,11 +3404,11 @@ static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) } static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, - bool d, bool nz, unsigned len, TCGv_reg val) + bool d, bool nz, unsigned len, TCGv_i64 val) { unsigned rs = nz ? rt : 0; unsigned widthm1 = d ? 63 : 31; - TCGv_reg mask, tmp, shift, dest; + TCGv_i64 mask, tmp, shift, dest; uint64_t msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); @@ -3514,19 +3416,19 @@ static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, tmp = tcg_temp_new(); /* Convert big-endian bit numbering in SAR to left-shift. */ - tcg_gen_andi_reg(shift, cpu_sar, widthm1); - tcg_gen_xori_reg(shift, shift, widthm1); + tcg_gen_andi_i64(shift, cpu_sar, widthm1); + tcg_gen_xori_i64(shift, shift, widthm1); mask = tcg_temp_new(); - tcg_gen_movi_reg(mask, msb + (msb - 1)); - tcg_gen_and_reg(tmp, val, mask); + tcg_gen_movi_i64(mask, msb + (msb - 1)); + tcg_gen_and_i64(tmp, val, mask); if (rs) { - tcg_gen_shl_reg(mask, mask, shift); - tcg_gen_shl_reg(tmp, tmp, shift); - tcg_gen_andc_reg(dest, cpu_gr[rs], mask); - tcg_gen_or_reg(dest, dest, tmp); + tcg_gen_shl_i64(mask, mask, shift); + tcg_gen_shl_i64(tmp, tmp, shift); + tcg_gen_andc_i64(dest, cpu_gr[rs], mask); + tcg_gen_or_i64(dest, dest, tmp); } else { - tcg_gen_shl_reg(dest, tmp, shift); + tcg_gen_shl_i64(dest, tmp, shift); } save_gpr(ctx, rt, dest); @@ -3559,12 +3461,12 @@ static bool trans_depi_sar(DisasContext *ctx, arg_depi_sar *a) nullify_over(ctx); } return do_dep_sar(ctx, a->t, a->c, a->d, a->nz, a->len, - tcg_constant_reg(a->i)); + tcg_constant_i64(a->i)); } static bool trans_be(DisasContext *ctx, arg_be *a) { - TCGv_reg tmp; + TCGv_i64 tmp; #ifdef CONFIG_USER_ONLY /* ??? It seems like there should be a good way of using @@ -3583,7 +3485,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) #endif tmp = tcg_temp_new(); - tcg_gen_addi_reg(tmp, load_gpr(ctx, a->b), a->disp); + tcg_gen_addi_i64(tmp, load_gpr(ctx, a->b), a->disp); tmp = do_ibranch_priv(ctx, tmp); #ifdef CONFIG_USER_ONLY @@ -3598,7 +3500,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) } if (a->n && use_nullify_skip(ctx)) { copy_iaoq_entry(ctx, cpu_iaoq_f, -1, tmp); - tcg_gen_addi_reg(tmp, tmp, 4); + tcg_gen_addi_i64(tmp, tmp, 4); copy_iaoq_entry(ctx, cpu_iaoq_b, -1, tmp); tcg_gen_mov_i64(cpu_iasq_f, new_spc); tcg_gen_mov_i64(cpu_iasq_b, cpu_iasq_f); @@ -3666,11 +3568,11 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) #endif if (a->l) { - TCGv_reg tmp = dest_gpr(ctx, a->l); + TCGv_i64 tmp = dest_gpr(ctx, a->l); if (ctx->privilege < 3) { - tcg_gen_andi_reg(tmp, tmp, -4); + tcg_gen_andi_i64(tmp, tmp, -4); } - tcg_gen_ori_reg(tmp, tmp, ctx->privilege); + tcg_gen_ori_i64(tmp, tmp, ctx->privilege); save_gpr(ctx, a->l, tmp); } @@ -3680,9 +3582,9 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) static bool trans_blr(DisasContext *ctx, arg_blr *a) { if (a->x) { - TCGv_reg tmp = tcg_temp_new(); - tcg_gen_shli_reg(tmp, load_gpr(ctx, a->x), 3); - tcg_gen_addi_reg(tmp, tmp, ctx->iaoq_f + 8); + TCGv_i64 tmp = tcg_temp_new(); + tcg_gen_shli_i64(tmp, load_gpr(ctx, a->x), 3); + tcg_gen_addi_i64(tmp, tmp, ctx->iaoq_f + 8); /* The computation here never changes privilege level. */ return do_ibranch(ctx, tmp, a->l, a->n); } else { @@ -3693,14 +3595,14 @@ static bool trans_blr(DisasContext *ctx, arg_blr *a) static bool trans_bv(DisasContext *ctx, arg_bv *a) { - TCGv_reg dest; + TCGv_i64 dest; if (a->x == 0) { dest = load_gpr(ctx, a->b); } else { dest = tcg_temp_new(); - tcg_gen_shli_reg(dest, load_gpr(ctx, a->x), 3); - tcg_gen_add_reg(dest, dest, load_gpr(ctx, a->b)); + tcg_gen_shli_i64(dest, load_gpr(ctx, a->x), 3); + tcg_gen_add_i64(dest, dest, load_gpr(ctx, a->b)); } dest = do_ibranch_priv(ctx, dest); return do_ibranch(ctx, dest, 0, a->n); @@ -3708,7 +3610,7 @@ static bool trans_bv(DisasContext *ctx, arg_bv *a) static bool trans_bve(DisasContext *ctx, arg_bve *a) { - TCGv_reg dest; + TCGv_i64 dest; #ifdef CONFIG_USER_ONLY dest = do_ibranch_priv(ctx, load_gpr(ctx, a->b)); @@ -4031,12 +3933,12 @@ static bool trans_fcmp_d(DisasContext *ctx, arg_fclass2 *a) static bool trans_ftest(DisasContext *ctx, arg_ftest *a) { - TCGv_reg t; + TCGv_i64 t; nullify_over(ctx); t = tcg_temp_new(); - tcg_gen_ld32u_reg(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); + tcg_gen_ld32u_i64(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); if (a->y == 1) { int mask; @@ -4044,7 +3946,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) switch (a->c) { case 0: /* simple */ - tcg_gen_andi_reg(t, t, 0x4000000); + tcg_gen_andi_i64(t, t, 0x4000000); ctx->null_cond = cond_make_0(TCG_COND_NE, t); goto done; case 2: /* rej */ @@ -4073,17 +3975,17 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) return true; } if (inv) { - TCGv_reg c = tcg_constant_reg(mask); - tcg_gen_or_reg(t, t, c); + TCGv_i64 c = tcg_constant_i64(mask); + tcg_gen_or_i64(t, t, c); ctx->null_cond = cond_make(TCG_COND_EQ, t, c); } else { - tcg_gen_andi_reg(t, t, mask); + tcg_gen_andi_i64(t, t, mask); ctx->null_cond = cond_make_0(TCG_COND_EQ, t); } } else { unsigned cbit = (a->y ^ 1) - 1; - tcg_gen_extract_reg(t, t, 21 - cbit, 1); + tcg_gen_extract_i64(t, t, 21 - cbit, 1); ctx->null_cond = cond_make_0(TCG_COND_NE, t); } @@ -4338,7 +4240,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) if (ctx->iaoq_b == -1) { ctx->iaoq_n = -1; ctx->iaoq_n_var = tcg_temp_new(); - tcg_gen_addi_reg(ctx->iaoq_n_var, cpu_iaoq_b, 4); + tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); } else { ctx->iaoq_n = ctx->iaoq_b + 4; ctx->iaoq_n_var = NULL; From patchwork Thu Nov 2 01:29:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740420 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp598248wrv; Wed, 1 Nov 2023 18:49:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn/6UqFu/6/gSVIDPxqcBfKv8zsc56kDc3MFiU30envduiDRBOqtLzD5Mxyp8EpBkhboNr X-Received: by 2002:a05:620a:472c:b0:775:6695:b10f with SMTP id bs44-20020a05620a472c00b007756695b10fmr20181714qkb.56.1698889795699; Wed, 01 Nov 2023 18:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889795; cv=none; d=google.com; s=arc-20160816; b=YWO4Ub+zwU13oID24Cv1JYYj5RNh7rycF9geQFvxyzJLzj+HbyI3C/LxCAciF7a/BU MrP0mHujlKKOQV7yZFxD/HOuJodl28zPG6Rbp09AuCqBmKgubBn9sOuHVm6u6A4hcluW HRXw/K8tuSTuCfrhDJbJh7UBqfqDiDtBn8S+enb24ZcUINsCWDw4N2YtBkASYHHfRSUF lfRmj0HFG5skDERJGW9XRcV1Q5BK1n0sO0wpKckDYCpKpRj/l/xcPRC6qsWVSvdllQvk z2nZae5Nq/t3+pZ5HRWmsMGiHnxTLez7WWiy3YY440rb3oXxUGtdQeeFG7ggpmKLHHlB FfwA== 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=C5PbIDheBSeiqmcNlYHSK8nvmVpp5+OaGBYstVJp+mo=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=wRyoC1YGCaZHyfNkjBXNLwwiW3Z7zyORa/SMw4dLuo0Q3LJCTxsfVnLuA1vmOJemfp oGcxoB5ZxkR5F0GkSRXI1+LPetQLiznr+1gKxq5lU3w7KNwqhwreYcV+ip80x4DY9BbW K6ejnlw+KtG9ZGhAQeWtMjP7BgCKw81l2qK2j6Z2CVV7CT+4kgscGuqRTMAjrsZ92b/e zogV269dRyFeliuq+vXI+MGRPtM7VN/J6MN0HJJYzLoZYYlf4La8upecAA6GlXISjZc5 8dVBFMT9dBANeUzKgAnBnTD05WpDBHmOiCb/hKyiPBV/s2nl4AjH5v89R7Aog2RcBASk izXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NjQ/UaEl"; 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 tv4-20020a05620a3e8400b00779fe883db1si3315419qkn.514.2023.11.01.18.49.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:49:55 -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="NjQ/UaEl"; 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 1qyMbl-000740-G2; Wed, 01 Nov 2023 21:34:53 -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 1qyMb8-0006Y1-Oa for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:15 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb4-0001xt-30 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:14 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1cc3c51f830so3277785ad.1 for ; Wed, 01 Nov 2023 18:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888849; x=1699493649; 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=C5PbIDheBSeiqmcNlYHSK8nvmVpp5+OaGBYstVJp+mo=; b=NjQ/UaElKKA6vpNqXx/NCjum/5CUIHxr6ZYWV/SbS7v7QGIW8cl/gMFkGHegN0eRhp frcZCPDGD9nQY5RRAbQqtnJN9W3L5C+IxE5MxcoPGvYiwOvK8QyCsQgt2ZT5X7kmW46a b3Wo6+NOs9IuEQx9j4OZnFPMmSASnPyccPvIOLZOoSfh/7a3oo8CBcL5BFJnvX+vfj7d +IiMSX2asDhe7bXkQeEecj6/1UYdPkI+I/6vftMA0hVXTwA6ysa269z4RlQ6x7CTb7Nk UDRYPdRm2Mpb4I1whcd3nnk76I4LWWRjmmjYo5TsXZjlwbuC/VStMSGSGGJcjfvpaVAG YFZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888849; x=1699493649; 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=C5PbIDheBSeiqmcNlYHSK8nvmVpp5+OaGBYstVJp+mo=; b=co7F4zLLJnmnxer5cNJ+ILVLCfU2gRWxpgZqwekTb0Zh+WdK+UokKNV1LfQvUmw6hW y5uZsffL6AI9fstInSjO2c2CBJwY1OTpH4xc+YhbHQuXoz7cM2NxaNnqr3SoKS5FvrUs iIvGkdCpUUXjIpYNzB/PVsExFwb3BmGTWsbwi6TjfxsFviFFQ5tTwWr5ttH2cNqM5Tt3 yFE0+mRzSc4wqnMnA4+WQLkFYbSZl1VqhHfnRtqVPw2VwKlUDOfDoVaDLZGtxd/vUzII Vn9yJ4QC21MoKX8/whbIksONY6NCrMZewQJKxezTNSx4noSxtViMH6KQc7aHh6tDaq3Q ikMA== X-Gm-Message-State: AOJu0Yznd55E4CxVQ0AtB+egrYrAGS2290rMUwJJ6Ya+Kff6OQ3Hlhy+ tCGlR1pPJjPqh8XFfR+Tgryn6tbywvfdcboE/LI= X-Received: by 2002:a17:902:e494:b0:1c9:d948:33d5 with SMTP id i20-20020a170902e49400b001c9d94833d5mr10744123ple.64.1698888848770; Wed, 01 Nov 2023 18:34:08 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 59/88] target/hppa: Remove remaining TARGET_REGISTER_BITS redirections Date: Wed, 1 Nov 2023 18:29:47 -0700 Message-Id: <20231102013016.369010-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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, T_SCC_BODY_TEXT_LINE=-0.01 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 The conversions to/from i64 can be eliminated entirely, folding computation into adjacent operations. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 46 ++++++++++++----------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 520a375e3a..ce8d812e04 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -33,15 +33,6 @@ #undef HELPER_H -/* Since we have a distinction between register size and address size, - we need to redefine all of these. */ - -#define tcg_gen_extu_reg_tl tcg_gen_mov_i64 -#define tcg_gen_trunc_i64_reg tcg_gen_mov_i64 -#define tcg_gen_extu_reg_i64 tcg_gen_mov_i64 -#define tcg_gen_ext_reg_i64 tcg_gen_mov_i64 - - typedef struct DisasCond { TCGCond c; TCGv_i64 a0, a1; @@ -1345,8 +1336,7 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, *pofs = ofs; *pgva = addr = tcg_temp_new_i64(); - tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); - tcg_gen_andi_tl(addr, addr, gva_offset_mask(ctx)); + tcg_gen_andi_tl(addr, modify <= 0 ? ofs : base, gva_offset_mask(ctx)); #ifndef CONFIG_USER_ONLY if (!is_phys) { tcg_gen_or_tl(addr, addr, space_select(ctx, sp, base)); @@ -1966,13 +1956,11 @@ static bool trans_mfsp(DisasContext *ctx, arg_mfsp *a) unsigned rt = a->t; unsigned rs = a->sp; TCGv_i64 t0 = tcg_temp_new_i64(); - TCGv_i64 t1 = tcg_temp_new(); load_spr(ctx, t0, rs); tcg_gen_shri_i64(t0, t0, 32); - tcg_gen_trunc_i64_reg(t1, t0); - save_gpr(ctx, rt, t1); + save_gpr(ctx, rt, t0); cond_free(&ctx->null_cond); return true; @@ -2029,22 +2017,21 @@ static bool trans_mtsp(DisasContext *ctx, arg_mtsp *a) { unsigned rr = a->r; unsigned rs = a->sp; - TCGv_i64 t64; + TCGv_i64 tmp; if (rs >= 5) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_REG); } nullify_over(ctx); - t64 = tcg_temp_new_i64(); - tcg_gen_extu_reg_i64(t64, load_gpr(ctx, rr)); - tcg_gen_shli_i64(t64, t64, 32); + tmp = tcg_temp_new_i64(); + tcg_gen_shli_i64(tmp, load_gpr(ctx, rr), 32); if (rs >= 4) { - tcg_gen_st_i64(t64, tcg_env, offsetof(CPUHPPAState, sr[rs])); + tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUHPPAState, sr[rs])); ctx->tb_flags &= ~TB_FLAG_SR_SAME; } else { - tcg_gen_mov_i64(cpu_sr[rs], t64); + tcg_gen_mov_i64(cpu_sr[rs], tmp); } return nullify_end(ctx); @@ -2135,11 +2122,8 @@ static bool trans_ldsid(DisasContext *ctx, arg_ldsid *a) /* We don't implement space registers in user mode. */ tcg_gen_movi_i64(dest, 0); #else - TCGv_i64 t0 = tcg_temp_new_i64(); - - tcg_gen_mov_i64(t0, space_select(ctx, a->sp, load_gpr(ctx, a->b))); - tcg_gen_shri_i64(t0, t0, 32); - tcg_gen_trunc_i64_reg(dest, t0); + tcg_gen_mov_i64(dest, space_select(ctx, a->sp, load_gpr(ctx, a->b))); + tcg_gen_shri_i64(dest, dest, 32); #endif save_gpr(ctx, a->t, dest); @@ -3185,10 +3169,8 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) TCGv_i64 s = tcg_temp_new_i64(); tcg_gen_concat32_i64(t, src2, src1); - tcg_gen_extu_reg_i64(s, cpu_sar); - tcg_gen_andi_i64(s, s, 31); - tcg_gen_shr_i64(t, t, s); - tcg_gen_trunc_i64_reg(dest, t); + tcg_gen_andi_i64(s, cpu_sar, 31); + tcg_gen_shr_i64(dest, t, s); } } save_gpr(ctx, a->t, dest); @@ -3230,10 +3212,8 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) tcg_gen_rotri_i32(t32, t32, sa); tcg_gen_extu_i32_i64(dest, t32); } else { - TCGv_i64 t64 = tcg_temp_new_i64(); - tcg_gen_concat32_i64(t64, t2, cpu_gr[a->r1]); - tcg_gen_shri_i64(t64, t64, sa); - tcg_gen_trunc_i64_reg(dest, t64); + tcg_gen_concat32_i64(dest, t2, cpu_gr[a->r1]); + tcg_gen_extract_i64(dest, dest, sa, 32); } } save_gpr(ctx, a->t, dest); From patchwork Thu Nov 2 01:29: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: 740367 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594947wrv; Wed, 1 Nov 2023 18:37:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIwwYve3MIRLpmHIOCUaepJZBfsZ133S/ssmcX6Wef5Wi/xBqQW8wmGYvB0RibIA3xGFhf X-Received: by 2002:a05:620a:2445:b0:774:2bdc:aa4 with SMTP id h5-20020a05620a244500b007742bdc0aa4mr21106696qkn.54.1698889027947; Wed, 01 Nov 2023 18:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889027; cv=none; d=google.com; s=arc-20160816; b=hgnpvYvcnkTXsSrsrqBT5UOHI7ouIa5jfksIoIjX0IR3FHdQUOg7nk+K2iA2S+OHPP zix3Z0OtkUczyRqCxUfQGLae+UdFwvrsOEZfCVA3P3EnBr4JIANf79OAvCMY+G3DV3P/ k/Kwfwy8loZR4CN0Yw9q/3asjSC8pHNUpi0X2l5Qt65XfnDWsemWLQ45A0O/OBQvOZgO vj2XWTQSgONYeffrV+iqTi7RIJfLZGfqkXfE68YOwGma7RH3k7NbcJllRmlEyR7vcwiA iR5jan3UlkmL2loSvgab/OD2BX0BjA6181IYTsaxkd2fAAJRpNBqE3rcZSJ2vsTlpNvk y3bA== 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=AN07pJMTsiIlY8LB6MnLf8VE2u/chTuU0HpC7BaSLTY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=FD354ZsI9mqJulbbg4Y4VQG57iyp7kE+wqO2Gt5e4P3illauqg3X1qRIOIBu5DWofj RcU7RZ7qigWJ7QoSAezo/Lrkb9yQESq9m4EZ6Dh//koBE0tuzeoRQhuXPfy1EvIRLUDg wyA/nx2RzAh4y+J6aP9JAhijHDxEPe7raQQI2R4/7K2cEfd/lp5tgeRO2dbfV20ivpbL JAGi1jhs1b34gm2mbaKj9V/qodmk9foFxfUGI+CLE/sYWORS1J17Qwq/u4TZBuYo2I+N fWJn2KxpRPlB8vOgN90ssnyRoQx4D+JA6EPaLTotwiRn6dpWIRqlFp0BXHwkw0gsTRbm pB8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PxczQ4CC; 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 rj8-20020a05620a8fc800b0076d81c85ecesi3323633qkn.723.2023.11.01.18.37.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37:07 -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=PxczQ4CC; 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 1qyMbz-0007NV-Jd; Wed, 01 Nov 2023 21:35:07 -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 1qyMb8-0006Y5-Td for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:15 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb4-0001y4-Lh for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:14 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cc2575dfc7so3238525ad.1 for ; Wed, 01 Nov 2023 18:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888849; x=1699493649; 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=AN07pJMTsiIlY8LB6MnLf8VE2u/chTuU0HpC7BaSLTY=; b=PxczQ4CCJ0KLgZJHj0KiUzgNaG1TADUbcYGdsVuCAs/obrAwTHJD/GqolnIxjPz6Gl JW8RoWs7nAhBt4Hup6VMhRW9mlloltzw66y0YfiEySC6zkOqpJyxl2hSfcDne1KRoOvZ 4Xa52vGu0lt4nn9tWiAtAKGVRkxRf6TO83bqk5eBUd6q29KdqAsSpxNKq5qasIYqcYCA AG92mktpPzmI0o0iPsdOQG7NDWUNmaWmobSftaIaXBbZ0NOp0pLcUHyDydl1klyRxlG2 fcpu5oEkI7HfMbYD6sXirJbiTpl7rEdvUVZy7pi16g21ree2IR03SmhsrXUKaCCv5D3A 1e9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888849; x=1699493649; 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=AN07pJMTsiIlY8LB6MnLf8VE2u/chTuU0HpC7BaSLTY=; b=TfcBMRQokOlMHoJRNKjbmOZAxVVtZOVzhan8yOVpjAHhxET8ZaqNvW5ymxZcjIXAOG eHE9sIeY1a8CEWgi7fXCNtK3W2ynEbcRcfeXvRDKOM16rP0qYqE6FkRj0+zATHNlTJXP AOrRoRWUOJuZj7Hs9n3XcJ7wzutP6O0Hs/RLsObn7L28pMTfQeGu0PiJwZmdOmG7JNVA V+D++frg+pwLdcn71cbV31UNmEFZM4zO65P6Mw7cps2WUyYLTARP9Wld425fP5LidNvl eogkITFSlAwnaTQ+BRsIdDJdEaK2AD51PfEdJhFv7fWyrAG9s4QCRnXiDA6PAC+h4gR4 ++hQ== X-Gm-Message-State: AOJu0YxT0fNY5Amz8yUdstKkpL9DC1O2bKwcKEE9lZ04Ny8XnSgeBEIv JISE31FRf8dZDATrDt4uG6fkvRTxufZlpsNlv1Y= X-Received: by 2002:a17:902:da8d:b0:1cc:548d:423b with SMTP id j13-20020a170902da8d00b001cc548d423bmr10571397plx.60.1698888849426; Wed, 01 Nov 2023 18:34:09 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 60/88] target/hppa: Adjust vmstate_env for pa2.0 tlb Date: Wed, 1 Nov 2023 18:29:48 -0700 Message-Id: <20231102013016.369010-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Split out the tlb to a subsection so that it can be separately versioned -- the format is only partially following the architecture and is partially guided by the qemu implementation. Signed-off-by: Richard Henderson --- target/hppa/machine.c | 93 ++++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 36 deletions(-) diff --git a/target/hppa/machine.c b/target/hppa/machine.c index f6df4deac5..823e6af7ee 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -44,28 +44,30 @@ static const VMStateInfo vmstate_psw = { .put = put_psw, }; -/* FIXME: Use the PA2.0 format, which is a superset of the PA1.1 format. */ static int get_tlb(QEMUFile *f, void *opaque, size_t size, const VMStateField *field) { HPPATLBEntry *ent = opaque; - uint32_t val; + uint64_t val; ent->itree.start = qemu_get_be64(f); + ent->itree.last = qemu_get_be64(f); ent->pa = qemu_get_be64(f); - val = qemu_get_be32(f); + val = qemu_get_be64(f); - ent->entry_valid = extract32(val, 0, 1); - ent->access_id = extract32(val, 1, 18); - ent->u = extract32(val, 19, 1); - ent->ar_pl2 = extract32(val, 20, 2); - ent->ar_pl1 = extract32(val, 22, 2); - ent->ar_type = extract32(val, 24, 3); - ent->b = extract32(val, 27, 1); - ent->d = extract32(val, 28, 1); - ent->t = extract32(val, 29, 1); - - ent->itree.last = ent->itree.start + TARGET_PAGE_SIZE - 1; + if (val) { + ent->t = extract64(val, 61, 1); + ent->d = extract64(val, 60, 1); + ent->b = extract64(val, 59, 1); + ent->ar_type = extract64(val, 56, 3); + ent->ar_pl1 = extract64(val, 54, 2); + ent->ar_pl2 = extract64(val, 52, 2); + ent->u = extract64(val, 51, 1); + /* o = bit 50 */ + /* p = bit 49 */ + ent->access_id = extract64(val, 1, 31); + ent->entry_valid = 1; + } return 0; } @@ -73,27 +75,30 @@ static int put_tlb(QEMUFile *f, void *opaque, size_t size, const VMStateField *field, JSONWriter *vmdesc) { HPPATLBEntry *ent = opaque; - uint32_t val = 0; + uint64_t val = 0; if (ent->entry_valid) { val = 1; - val = deposit32(val, 1, 18, ent->access_id); - val = deposit32(val, 19, 1, ent->u); - val = deposit32(val, 20, 2, ent->ar_pl2); - val = deposit32(val, 22, 2, ent->ar_pl1); - val = deposit32(val, 24, 3, ent->ar_type); - val = deposit32(val, 27, 1, ent->b); - val = deposit32(val, 28, 1, ent->d); - val = deposit32(val, 29, 1, ent->t); + val = deposit64(val, 61, 1, ent->t); + val = deposit64(val, 60, 1, ent->d); + val = deposit64(val, 59, 1, ent->b); + val = deposit64(val, 56, 3, ent->ar_type); + val = deposit64(val, 54, 2, ent->ar_pl1); + val = deposit64(val, 52, 2, ent->ar_pl2); + val = deposit64(val, 51, 1, ent->u); + /* o = bit 50 */ + /* p = bit 49 */ + val = deposit64(val, 1, 31, ent->access_id); } qemu_put_be64(f, ent->itree.start); + qemu_put_be64(f, ent->itree.last); qemu_put_be64(f, ent->pa); - qemu_put_be32(f, val); + qemu_put_be64(f, val); return 0; } -static const VMStateInfo vmstate_tlb = { +static const VMStateInfo vmstate_tlb_entry = { .name = "tlb entry", .get = get_tlb, .put = put_tlb, @@ -147,7 +152,24 @@ static int tlb_post_load(void *opaque, int version_id) return 0; } -static VMStateField vmstate_env_fields[] = { +static const VMStateField vmstate_tlb_fields[] = { + VMSTATE_ARRAY(tlb, CPUHPPAState, + ARRAY_SIZE(((CPUHPPAState *)0)->tlb), + 0, vmstate_tlb_entry, HPPATLBEntry), + VMSTATE_UINT32(tlb_last, CPUHPPAState), + VMSTATE_END_OF_LIST() +}; + +static const VMStateDescription vmstate_tlb = { + .name = "cpu/tlb", + .version_id = 1, + .minimum_version_id = 1, + .fields = vmstate_tlb_fields, + .pre_load = tlb_pre_load, + .post_load = tlb_post_load, +}; + +static const VMStateField vmstate_env_fields[] = { VMSTATE_UINT64_ARRAY(gr, CPUHPPAState, 32), VMSTATE_UINT64_ARRAY(fr, CPUHPPAState, 32), VMSTATE_UINT64_ARRAY(sr, CPUHPPAState, 8), @@ -176,24 +198,23 @@ static VMStateField vmstate_env_fields[] = { VMSTATE_UINT64(iasq_b, CPUHPPAState), VMSTATE_UINT32(fr0_shadow, CPUHPPAState), - - VMSTATE_ARRAY(tlb, CPUHPPAState, ARRAY_SIZE(((CPUHPPAState *)0)->tlb), - 0, vmstate_tlb, HPPATLBEntry), - VMSTATE_UINT32(tlb_last, CPUHPPAState), - VMSTATE_END_OF_LIST() }; +static const VMStateDescription *vmstate_env_subsections[] = { + &vmstate_tlb, + NULL +}; + static const VMStateDescription vmstate_env = { .name = "env", - .version_id = 2, - .minimum_version_id = 2, + .version_id = 3, + .minimum_version_id = 3, .fields = vmstate_env_fields, - .pre_load = tlb_pre_load, - .post_load = tlb_post_load, + .subsections = vmstate_env_subsections, }; -static VMStateField vmstate_cpu_fields[] = { +static const VMStateField vmstate_cpu_fields[] = { VMSTATE_CPU(), VMSTATE_STRUCT(env, HPPACPU, 1, vmstate_env, CPUHPPAState), VMSTATE_END_OF_LIST() From patchwork Thu Nov 2 01:29:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740414 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597713wrv; Wed, 1 Nov 2023 18:47:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERKpLSE4HMJq9MdtE+Fbzn+mJLqwkpbj5HdPTPQe5WkzuVuExod9xn5KXn/MR4xJKTrvwI X-Received: by 2002:a05:6214:5289:b0:66d:2090:d22 with SMTP id kj9-20020a056214528900b0066d20900d22mr21197415qvb.35.1698889667436; Wed, 01 Nov 2023 18:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889667; cv=none; d=google.com; s=arc-20160816; b=GQadSEW/ewqqmQtLoo24w452Adu/EBgGh8H+yW1I1H6seR7V4q+ImNEBtCvUssgpX9 f2wRq4oiqAddTHctf+AtUlBMnaXyL4ebd5zLw6fzZUUGHAQM2BuZ0NBSbhxkq9tCx2x1 U58nnF1E3Ie2zxIZWiuesLM0ADZfkZDQAi+SkHSqgXi44TH4xoRhgyUtpQ2iW4b506OR Ne/P63WwK+zQpQrZsOhAbMAl3U77a9M6GkUGm8uW9hlKkBHUIsBVJdQX5QyoYDBs0nLN SLuCvaE6nPhXnNP1OjRUsmFC/7sfS1ZPa3aDG2jBeU4gstm+nKegYgcgTZ3T0vXSi2a5 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=9Aq/Lxt9rxYKknv7LZ2TP65EWgsQ32uEGBivTsfXbT4=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=CTAPawPFcKN4fswGzWgVRoOEn12JG0YvSGIYJB0HyZaxFOnMTeDxcKMsJ3kdlkDKP4 MV+E/61H4Ck2mfWaZkPqa2KoAsoZ1XgalH+NM5JcoA3mH2FKBayPAaFQQeIobjbfz0b2 +TTp6EVNJAOqhGXQL6P1aPFI1kLLGbT6cF15v3TU+VC16Z+1dFR+MXu1ZkpoVfaZdJ7V oV/yBXKKfikIbnx2YvOaLs5NBiDwVjOUg/+mUQFXKGMFsV8w15qWrlEZZIYInqV3Hy5t C1vRCSA24jflqkhcg+loRCiWFzI6NqOoQ8kNsUw/wONRkBr9prkSKYQmgewXcJkcQoyP xYIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IEockq/u"; 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 h1-20020a0cf8c1000000b0066d14c995e7si3549080qvo.359.2023.11.01.18.47.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:47:47 -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="IEockq/u"; 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 1qyMbo-00075c-SN; Wed, 01 Nov 2023 21:34:57 -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 1qyMbA-0006YS-3J for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:17 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb5-0001yA-Mk for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:15 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5b7f3f470a9so330195a12.0 for ; Wed, 01 Nov 2023 18:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888850; x=1699493650; 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=9Aq/Lxt9rxYKknv7LZ2TP65EWgsQ32uEGBivTsfXbT4=; b=IEockq/u86SxQTdTi+/sB0FP2NNeuSjfzuj7zGb+Hx/7Jdxsi6V6ixpzkaY6hcrrd8 2seHWDFvg050pSVLx2cMXcGFIGbgdrlcBMe1KhhzVgmXFYKAgBjOyzax8NTxirGZtB8U +fF4OB33Y/Y357o0PBJV0qOaPiBdV9EHulapB0yKk/0nWHLRxvl9TMhjf/AI/ucevfLU Nk12A+PkpHfW3LjMDRU95msOo4KaFljvRFiq0HdFdyWq1fUeycVgjKUB43Rwp2fkGWBV iaVdbgcLuVXu652/gv5Ec5hXTf6+Hqb8YWPCXGATqcBifvhh+N14dgwlmtfrPekRh0HO sKJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888850; x=1699493650; 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=9Aq/Lxt9rxYKknv7LZ2TP65EWgsQ32uEGBivTsfXbT4=; b=LZXtA/mPiuHvXnFHeR1Zl2Wye58aG/7hKcdIq+tg6s2DwRFoVOFNiqfB3vx61qonoH Hrm5/VrM9VcCe5Fe9DAuXozmjpIgIrmfj2x32/vsukcTXqPKhHUkDgfblS4vq+AT+fEe bL1lYRe+BJccgwFN2VVamcD2XxdU3HlATlE0XfcODWKV5hu7pcTFUSAXs2F6tltSQBxD MB+YkgcDN7Fm0cEnamOdwJwWmp196cBkgo5iAFP8VW5uBPnfs87tk1gRScptFAouRzNE ypqhTG0aWYgsPiuR9qO91k7liJSfNCJkouAmLPdJnxNNv/p/MzFb1t1JRDeTFfl8JiKE 8iLg== X-Gm-Message-State: AOJu0Ywmw6SMhIMI7tVkRBi8fa6hDJPVo3CIxzw/yBFQAc+n/2bQOwtF XUcnAeqr69E8By3e2pLUbW0pR7kM1NDnee5aaUE= X-Received: by 2002:a05:6a20:4414:b0:181:9518:5aae with SMTP id ce20-20020a056a20441400b0018195185aaemr866607pzb.10.1698888850149; Wed, 01 Nov 2023 18:34:10 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 61/88] target/hppa: Use tcg_temp_new_i64 not tcg_temp_new Date: Wed, 1 Nov 2023 18:29:49 -0700 Message-Id: <20231102013016.369010-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/translate.c | 162 ++++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 80 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ce8d812e04..59d172f355 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -32,6 +32,8 @@ #include "exec/helper-info.c.inc" #undef HELPER_H +/* Choose to use explicit sizes within this file. */ +#undef tcg_temp_new typedef struct DisasCond { TCGCond c; @@ -269,15 +271,15 @@ static DisasCond cond_make_0_tmp(TCGCond c, TCGv_i64 a0) static DisasCond cond_make_0(TCGCond c, TCGv_i64 a0) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_mov_i64(tmp, a0); return cond_make_0_tmp(c, tmp); } static DisasCond cond_make(TCGCond c, TCGv_i64 a0, TCGv_i64 a1) { - TCGv_i64 t0 = tcg_temp_new(); - TCGv_i64 t1 = tcg_temp_new(); + TCGv_i64 t0 = tcg_temp_new_i64(); + TCGv_i64 t1 = tcg_temp_new_i64(); tcg_gen_mov_i64(t0, a0); tcg_gen_mov_i64(t1, a1); @@ -302,7 +304,7 @@ static void cond_free(DisasCond *cond) static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_i64 t = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new_i64(); tcg_gen_movi_i64(t, 0); return t; } else { @@ -313,7 +315,7 @@ static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) static TCGv_i64 dest_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0 || ctx->null_cond.c != TCG_COND_NEVER) { - return tcg_temp_new(); + return tcg_temp_new_i64(); } else { return cpu_gr[reg]; } @@ -437,7 +439,7 @@ static void nullify_over(DisasContext *ctx) /* If we're using PSW[N], copy it to a temp because... */ if (ctx->null_cond.a0 == cpu_psw_n) { - ctx->null_cond.a0 = tcg_temp_new(); + ctx->null_cond.a0 = tcg_temp_new_i64(); tcg_gen_mov_i64(ctx->null_cond.a0, cpu_psw_n); } /* ... we clear it before branching over the implementation, @@ -657,14 +659,14 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, break; case 1: /* = / <> (Z / !Z) */ if (cond_need_ext(ctx, d)) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ext32u_i64(tmp, res); res = tmp; } cond = cond_make_0(TCG_COND_EQ, res); break; case 2: /* < / >= (N ^ V / !(N ^ V) */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_xor_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { tcg_gen_ext32s_i64(tmp, tmp); @@ -681,7 +683,7 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, * !(~(res ^ sv) >> 31) | !res * !(~(res ^ sv) >> 31 & res) */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_eqv_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { tcg_gen_sextract_i64(tmp, tmp, 31, 1); @@ -698,7 +700,7 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, cond = cond_make_0(TCG_COND_EQ, cb_msb); break; case 5: /* ZNV / VNZ (!C | Z / C & !Z) */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_neg_i64(tmp, cb_msb); tcg_gen_and_i64(tmp, tmp, res); if (cond_need_ext(ctx, d)) { @@ -708,14 +710,14 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, break; case 6: /* SV / NSV (V / !V) */ if (cond_need_ext(ctx, d)) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ext32s_i64(tmp, sv); sv = tmp; } cond = cond_make_0(TCG_COND_LT, sv); break; case 7: /* OD / EV */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_andi_i64(tmp, res, 1); cond = cond_make_0_tmp(TCG_COND_NE, tmp); break; @@ -769,8 +771,8 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, tc = tcg_invert_cond(tc); } if (cond_need_ext(ctx, d)) { - TCGv_i64 t1 = tcg_temp_new(); - TCGv_i64 t2 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new_i64(); + TCGv_i64 t2 = tcg_temp_new_i64(); if (ext_uns) { tcg_gen_ext32u_i64(t1, in1); @@ -846,7 +848,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, } if (cond_need_ext(ctx, d)) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); if (ext_uns) { tcg_gen_ext32u_i64(tmp, res); @@ -891,8 +893,8 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, * do our normal thing and compute carry-in of bit B+1 since that * leaves us with carry bits spread across two words. */ - cb = tcg_temp_new(); - tmp = tcg_temp_new(); + cb = tcg_temp_new_i64(); + tmp = tcg_temp_new_i64(); tcg_gen_or_i64(cb, in1, in2); tcg_gen_and_i64(tmp, in1, in2); tcg_gen_andc_i64(cb, cb, res); @@ -910,7 +912,7 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, /* See hasless(v,1) from * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_subi_i64(tmp, res, d_repl * 0x01010101u); tcg_gen_andc_i64(tmp, tmp, res); tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80808080u); @@ -918,7 +920,7 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, break; case 3: /* SHZ / NHZ */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_subi_i64(tmp, res, d_repl * 0x00010001u); tcg_gen_andc_i64(tmp, tmp, res); tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80008000u); @@ -954,7 +956,7 @@ static TCGv_i64 get_carry(DisasContext *ctx, bool d, TCGv_i64 cb, TCGv_i64 cb_msb) { if (cond_need_ext(ctx, d)) { - TCGv_i64 t = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new_i64(); tcg_gen_extract_i64(t, cb, 32, 1); return t; } @@ -970,8 +972,8 @@ static TCGv_i64 get_psw_carry(DisasContext *ctx, bool d) static TCGv_i64 do_add_sv(DisasContext *ctx, TCGv_i64 res, TCGv_i64 in1, TCGv_i64 in2) { - TCGv_i64 sv = tcg_temp_new(); - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new_i64(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_xor_i64(sv, res, in1); tcg_gen_xor_i64(tmp, in1, in2); @@ -984,8 +986,8 @@ static TCGv_i64 do_add_sv(DisasContext *ctx, TCGv_i64 res, static TCGv_i64 do_sub_sv(DisasContext *ctx, TCGv_i64 res, TCGv_i64 in1, TCGv_i64 in2) { - TCGv_i64 sv = tcg_temp_new(); - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new_i64(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_xor_i64(sv, res, in1); tcg_gen_xor_i64(tmp, in1, in2); @@ -1002,21 +1004,21 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, unsigned c = cf >> 1; DisasCond cond; - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); cb = NULL; cb_msb = NULL; cb_cond = NULL; if (shift) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_shli_i64(tmp, in1, shift); in1 = tmp; } if (!is_l || cond_need_cb(c)) { TCGv_i64 zero = tcg_constant_i64(0); - cb_msb = tcg_temp_new(); - cb = tcg_temp_new(); + cb_msb = tcg_temp_new_i64(); + cb = tcg_temp_new_i64(); tcg_gen_add2_i64(dest, cb_msb, in1, zero, in2, zero); if (is_c) { @@ -1048,7 +1050,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, /* Emit any conditional trap before any writeback. */ cond = do_cond(ctx, cf, d, dest, cb_cond, sv); if (is_tc) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1103,9 +1105,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, unsigned c = cf >> 1; DisasCond cond; - dest = tcg_temp_new(); - cb = tcg_temp_new(); - cb_msb = tcg_temp_new(); + dest = tcg_temp_new_i64(); + cb = tcg_temp_new_i64(); + cb_msb = tcg_temp_new_i64(); zero = tcg_constant_i64(0); if (is_b) { @@ -1144,7 +1146,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, /* Emit any conditional trap before any writeback. */ if (is_tc) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1193,7 +1195,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_i64 in1, TCGv_i64 dest, sv; DisasCond cond; - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_sub_i64(dest, in1, in2); /* Compute signed overflow if required. */ @@ -1258,13 +1260,13 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_i64 in1, save_gpr(ctx, rt, dest); cond_free(&ctx->null_cond); } else { - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); fn(dest, in1, in2); cond = do_unit_cond(cf, d, dest, in1, in2); if (is_tc) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1299,7 +1301,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_i64 base) } ptr = tcg_temp_new_ptr(); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); spc = tcg_temp_new_i64(); /* Extract top 2 bits of the address, shift left 3 for uint64_t index. */ @@ -1324,11 +1326,11 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, /* Note that RX is mutually exclusive with DISP. */ if (rx) { - ofs = tcg_temp_new(); + ofs = tcg_temp_new_i64(); tcg_gen_shli_i64(ofs, cpu_gr[rx], scale); tcg_gen_add_i64(ofs, ofs, base); } else if (disp || modify) { - ofs = tcg_temp_new(); + ofs = tcg_temp_new_i64(); tcg_gen_addi_i64(ofs, base, disp); } else { ofs = base; @@ -1434,7 +1436,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, dest = dest_gpr(ctx, rt); } else { /* Make sure if RT == RB, we see the result of the load. */ - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); } do_load_64(ctx, dest, rb, rx, scale, disp, sp, modify, mop); save_gpr(ctx, rt, dest); @@ -1750,7 +1752,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, if (link != 0) { copy_iaoq_entry(ctx, cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } - next = tcg_temp_new(); + next = tcg_temp_new_i64(); tcg_gen_mov_i64(next, dest); if (is_n) { if (use_nullify_skip(ctx)) { @@ -1779,7 +1781,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, branching. Since IOAQ_F is not really live at this point, we can simply store DEST optimistically. Similarly with IAOQ_B. */ copy_iaoq_entry(ctx, cpu_iaoq_f, -1, dest); - next = tcg_temp_new(); + next = tcg_temp_new_i64(); tcg_gen_addi_i64(next, dest, 4); copy_iaoq_entry(ctx, cpu_iaoq_b, -1, next); @@ -1794,8 +1796,8 @@ static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, a0 = ctx->null_cond.a0; a1 = ctx->null_cond.a1; - tmp = tcg_temp_new(); - next = tcg_temp_new(); + tmp = tcg_temp_new_i64(); + next = tcg_temp_new_i64(); copy_iaoq_entry(ctx, tmp, ctx->iaoq_n, ctx->iaoq_n_var); tcg_gen_movcond_i64(c, next, a0, a1, tmp, dest); @@ -1837,11 +1839,11 @@ static TCGv_i64 do_ibranch_priv(DisasContext *ctx, TCGv_i64 offset) return offset; case 3: /* Privilege 3 is minimum and is never allowed to increase. */ - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_ori_i64(dest, offset, 3); break; default: - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_andi_i64(dest, offset, -4); tcg_gen_ori_i64(dest, dest, ctx->privilege); tcg_gen_movcond_i64(TCG_COND_GTU, dest, dest, offset, dest, offset); @@ -1898,7 +1900,7 @@ static void do_page_zero(DisasContext *ctx) case 0xe0: /* SET_THREAD_POINTER */ tcg_gen_st_i64(cpu_gr[26], tcg_env, offsetof(CPUHPPAState, cr[27])); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ori_i64(tmp, cpu_gr[31], 3); copy_iaoq_entry(ctx, cpu_iaoq_f, -1, tmp); tcg_gen_addi_i64(tmp, tmp, 4); @@ -2004,7 +2006,7 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) break; } - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); save_gpr(ctx, rt, tmp); @@ -2045,7 +2047,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) if (ctl == CR_SAR) { reg = load_gpr(ctx, a->r); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_andi_i64(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); @@ -2076,7 +2078,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) case CR_IIAOQ: /* FIXME: Respect PSW_Q bit */ /* The write advances the queue and stores to the back element. */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); @@ -2104,7 +2106,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_not_i64(tmp, load_gpr(ctx, a->r)); tcg_gen_andi_i64(tmp, tmp, ctx->is_pa20 ? 63 : 31); @@ -2139,7 +2141,7 @@ static bool trans_rsm(DisasContext *ctx, arg_rsm *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_andi_i64(tmp, tmp, ~a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2159,7 +2161,7 @@ static bool trans_ssm(DisasContext *ctx, arg_ssm *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_ori_i64(tmp, tmp, a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2179,7 +2181,7 @@ static bool trans_mtsm(DisasContext *ctx, arg_mtsm *a) nullify_over(ctx); reg = load_gpr(ctx, a->r); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); gen_helper_swap_system_mask(tmp, tcg_env, reg); /* Exit the TB to recognize new interrupts. */ @@ -2434,7 +2436,7 @@ static bool trans_lpa(DisasContext *ctx, arg_ldst *a) form_gva(ctx, &vaddr, &ofs, a->b, a->x, 0, 0, a->sp, a->m, false); - paddr = tcg_temp_new(); + paddr = tcg_temp_new_i64(); gen_helper_lpa(paddr, tcg_env, vaddr); /* Note that physical address result overrides base modification. */ @@ -2618,7 +2620,7 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_not_i64(tmp, tcg_r2); do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_i64); return nullify_end(ctx); @@ -2640,7 +2642,7 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_shri_i64(tmp, cpu_psw_cb, 3); if (!is_i) { tcg_gen_not_i64(tmp, tmp); @@ -2672,10 +2674,10 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) in1 = load_gpr(ctx, a->r1); in2 = load_gpr(ctx, a->r2); - add1 = tcg_temp_new(); - add2 = tcg_temp_new(); - addc = tcg_temp_new(); - dest = tcg_temp_new(); + add1 = tcg_temp_new_i64(); + add2 = tcg_temp_new_i64(); + addc = tcg_temp_new_i64(); + dest = tcg_temp_new_i64(); zero = tcg_constant_i64(0); /* Form R1 << 1 | PSW[CB]{8}. */ @@ -2798,7 +2800,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) if (a->m) { /* Base register modification. Make sure if RT == RB, we see the result of the load. */ - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); } else { dest = dest_gpr(ctx, a->t); } @@ -2955,7 +2957,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_i64 in1, DisasCond cond; in2 = load_gpr(ctx, r); - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_sub_i64(dest, in1, in2); @@ -3007,13 +3009,13 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_i64 in1, } in2 = load_gpr(ctx, r); - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); sv = NULL; cb_cond = NULL; if (cond_need_cb(c)) { - TCGv_i64 cb = tcg_temp_new(); - TCGv_i64 cb_msb = tcg_temp_new(); + TCGv_i64 cb = tcg_temp_new_i64(); + TCGv_i64 cb_msb = tcg_temp_new_i64(); tcg_gen_movi_i64(cb_msb, 0); tcg_gen_add2_i64(dest, cb_msb, in1, cb_msb, in2, cb_msb); @@ -3051,7 +3053,7 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_r = load_gpr(ctx, a->r); if (cond_need_ext(ctx, a->d)) { /* Force shift into [32,63] */ @@ -3073,7 +3075,7 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_r = load_gpr(ctx, a->r); p = a->p | (cond_need_ext(ctx, a->d) ? 32 : 0); tcg_gen_shli_i64(tmp, tcg_r, p); @@ -3133,7 +3135,7 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) if (a->d) { tcg_gen_shr_i64(dest, src2, cpu_sar); } else { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_ext32u_i64(dest, src2); tcg_gen_andi_i64(tmp, cpu_sar, 31); @@ -3156,8 +3158,8 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) TCGv_i64 src1 = load_gpr(ctx, a->r1); if (a->d) { - TCGv_i64 t = tcg_temp_new(); - TCGv_i64 n = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new_i64(); + TCGv_i64 n = tcg_temp_new_i64(); tcg_gen_xori_i64(n, cpu_sar, 63); tcg_gen_shl_i64(t, src2, n); @@ -3240,7 +3242,7 @@ static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) dest = dest_gpr(ctx, a->t); src = load_gpr(ctx, a->r); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); /* Recall that SAR is using big-endian bit numbering. */ tcg_gen_andi_i64(tmp, cpu_sar, widthm1); @@ -3392,14 +3394,14 @@ static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, uint64_t msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); - shift = tcg_temp_new(); - tmp = tcg_temp_new(); + shift = tcg_temp_new_i64(); + tmp = tcg_temp_new_i64(); /* Convert big-endian bit numbering in SAR to left-shift. */ tcg_gen_andi_i64(shift, cpu_sar, widthm1); tcg_gen_xori_i64(shift, shift, widthm1); - mask = tcg_temp_new(); + mask = tcg_temp_new_i64(); tcg_gen_movi_i64(mask, msb + (msb - 1)); tcg_gen_and_i64(tmp, val, mask); if (rs) { @@ -3464,7 +3466,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) nullify_over(ctx); #endif - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_addi_i64(tmp, load_gpr(ctx, a->b), a->disp); tmp = do_ibranch_priv(ctx, tmp); @@ -3562,7 +3564,7 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) static bool trans_blr(DisasContext *ctx, arg_blr *a) { if (a->x) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_shli_i64(tmp, load_gpr(ctx, a->x), 3); tcg_gen_addi_i64(tmp, tmp, ctx->iaoq_f + 8); /* The computation here never changes privilege level. */ @@ -3580,7 +3582,7 @@ static bool trans_bv(DisasContext *ctx, arg_bv *a) if (a->x == 0) { dest = load_gpr(ctx, a->b); } else { - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_shli_i64(dest, load_gpr(ctx, a->x), 3); tcg_gen_add_i64(dest, dest, load_gpr(ctx, a->b)); } @@ -3917,7 +3919,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) nullify_over(ctx); - t = tcg_temp_new(); + t = tcg_temp_new_i64(); tcg_gen_ld32u_i64(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); if (a->y == 1) { @@ -4219,7 +4221,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) This will be overwritten by a branch. */ if (ctx->iaoq_b == -1) { ctx->iaoq_n = -1; - ctx->iaoq_n_var = tcg_temp_new(); + ctx->iaoq_n_var = tcg_temp_new_i64(); tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); } else { ctx->iaoq_n = ctx->iaoq_b + 4; From patchwork Thu Nov 2 01:29:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740365 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp594797wrv; Wed, 1 Nov 2023 18:36:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGysQrG7IWz47GWjweMmibZriOj4vVa1b4xC3xgKOZeVAuFUDXMXt2q9uGw9tK5IsOErbie X-Received: by 2002:ac8:5ac1:0:b0:41e:3e05:ea00 with SMTP id d1-20020ac85ac1000000b0041e3e05ea00mr6337636qtd.4.1698888989213; Wed, 01 Nov 2023 18:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888989; cv=none; d=google.com; s=arc-20160816; b=seifs62jFM2dtYcWknWQMRjGdhDRnkTQAiuj6jfh2okfSSAE9M0gLxuE22LfgAvr4Y fCMr6mO7fnZLdRsl4tbb0v0odZyzqSMroHLcCpN2G0c2XC5nosfLyrA4TxlEKRnjFaFw 1QaXenU2T/YoLRhHOiN8RVArnVIg1ngVq6knGcH+vRDULyykju87niGRTYv5pfsppvlZ 2osaNM4ADRjkv7RaIB3FmxBFKGOjPCH+VWR6hRSNKZuRMZ5MqeOILF1glmkFbQwBJ8xF ffaX5ipxXVkauifdrI05OOuNU4xGjBw8IFkApb4Cax66NXfHa8Ktm8yCtNfCsrP7Ag/y xHBw== 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=T0Z6Bkp8qogdaS1vlOBNIHkBVhVkIpu5yMkTET5B8HI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=y2xNAix144Hi/+25WIzp+AqNMbz58dVSmiY+v15btdggd1THTP0zvqMuSZ6T6bI4nW H5AqFb6x4VGcUrLwd+8qE1JCXBe2OoDZRBkZ6LmhGApRGYmR/NLBbmVm8y7+PJxWfmoE B6LQbNIoqqEAZeTIkArvBBtVx0A6LuvPmW+6fjLaUvUJyxtkqTd1hZBeEaFa1IY1KxdC 2Pk/FDCUiCMVWkDYaoImwoNIgkXEna4Vb+KhEKAvrFofh2W2dC9ZlWQJVTpqZ8/qhIJW HexWdpNl1qdPTpL8omXgaRdS/KE2yuOFtDBgol9tolNWrwUVy7FclB8V1IDNiZH8Z8NW cbxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EJTeurHa; 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 l9-20020a05622a174900b0041971a2b466si3503174qtk.715.2023.11.01.18.36.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:36:29 -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=EJTeurHa; 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 1qyMcQ-0007nM-Vj; Wed, 01 Nov 2023 21:35:35 -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 1qyMb8-0006Y4-PU for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:15 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb6-0001yw-Kb for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:14 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cc131e52f1so12963765ad.0 for ; Wed, 01 Nov 2023 18:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888851; x=1699493651; 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=T0Z6Bkp8qogdaS1vlOBNIHkBVhVkIpu5yMkTET5B8HI=; b=EJTeurHaCiGQXtWI0+tpyuWbhYJOOVnyXxQItwbBL0YQT7Ol0t37/jG75UqN1Ss+kS JWN/XdXdY19MsbhJZny4SX8Do1NbXD2iBJhlRdC9EFmayhpcB0KuSKMJuMpdvnZsWvlA twTs10w7F3pzHt44n/Rkm6RBnWliUJES2odQ5tILEy417kkX/zqZc8GlWFMagCZrk0uc hBMMWRWGM829PNrQ+PNANzUuEdifspkRBlw1c6BjQq6mbxNiCwRX8BOg26GAl+H9XpOr xrOS/XVlIp86J4cgy0DaW2UF/lz4S+YKwPGcgVFBv0lpeGOTREi1tFxsYPiYJEU9ns31 b3iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888851; x=1699493651; 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=T0Z6Bkp8qogdaS1vlOBNIHkBVhVkIpu5yMkTET5B8HI=; b=pFmDJmlY/i+h8npKJpkyiVr/rnpAeNA0A6SnEbPSVHe4/mz/hgvm4YDHBstO+bu85R mmq4bkoNeT+NMvh22s7nertDwLkkr+VVJr9sZHVedyqFwQP1Nw9fBpLM2L3jMGNetfg5 RqtcpJO0kAI//4R5+ZI8wdlhvTDkNX/iriyTfOt/XZG9KEQmMyDbbAhdCo9YBi1ZOlSo VhVW04jEbOCRPrFGKiOChDctfABdXKCrLULxaYOqTF9xQFT1LQanfSK/Ybws7MyAPOQV Nuc7MyfwRYZ9Ds3D7mf8kvIOLWreJ4zJQHyB2vXFeeJlRaVlOK4wLP/Je+yA5+h+3MSB Ew/w== X-Gm-Message-State: AOJu0YwX0rOedV8Xvr5abTQmP/omWOOGdPVOZ3rMq4vuAU6EgPeWZ4C5 MNqth2NrcKgngw/Uqk0l/GmO4eZGElC5Yc5Huh0= X-Received: by 2002:a17:903:41c2:b0:1cc:4a66:7db3 with SMTP id u2-20020a17090341c200b001cc4a667db3mr6641279ple.4.1698888851059; Wed, 01 Nov 2023 18:34:11 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 62/88] target/hppa: Replace tcg_gen_*_tl with tcg_gen_*_i64 Date: Wed, 1 Nov 2023 18:29:50 -0700 Message-Id: <20231102013016.369010-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/translate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 59d172f355..f570b17ecd 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1338,10 +1338,10 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, *pofs = ofs; *pgva = addr = tcg_temp_new_i64(); - tcg_gen_andi_tl(addr, modify <= 0 ? ofs : base, gva_offset_mask(ctx)); + tcg_gen_andi_i64(addr, modify <= 0 ? ofs : base, gva_offset_mask(ctx)); #ifndef CONFIG_USER_ONLY if (!is_phys) { - tcg_gen_or_tl(addr, addr, space_select(ctx, sp, base)); + tcg_gen_or_i64(addr, addr, space_select(ctx, sp, base)); } #endif } @@ -2382,7 +2382,7 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) a->data ? offsetof(CPUHPPAState, cr[CR_IOR]) : offsetof(CPUHPPAState, cr[CR_IIAOQ])); tcg_gen_shli_i64(stl, stl, 32); - tcg_gen_or_tl(addr, atl, stl); + tcg_gen_or_i64(addr, atl, stl); reg = load_gpr(ctx, a->r); if (a->addr) { @@ -2939,7 +2939,7 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a) TCGv_i64 tcg_rt = dest_gpr(ctx, a->t); /* Special case rb == 0, for the LDI pseudo-op. - The COPY pseudo-op is handled for free within tcg_gen_addi_tl. */ + The COPY pseudo-op is handled for free within tcg_gen_addi_i64. */ if (a->b == 0) { tcg_gen_movi_i64(tcg_rt, a->i); } else { From patchwork Thu Nov 2 01:29:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740411 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597483wrv; Wed, 1 Nov 2023 18:46:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcSWF98yP1gjNdt/o/oS3cVukm68X+ourcNgecMYXJDvwELpkmD1qJf7BDfSaj6d5GoG41 X-Received: by 2002:a81:b643:0:b0:5a7:d997:cc7b with SMTP id h3-20020a81b643000000b005a7d997cc7bmr19926446ywk.23.1698889615837; Wed, 01 Nov 2023 18:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889615; cv=none; d=google.com; s=arc-20160816; b=jHOOPq0fnRIuaBbZ+vVMY+lLPWVO3CIE1BEbmcxu9x8ZCxerWPkkiZQvmQS23/qG1z EeeXwB3G+RdY+JE+2IICGJjFeNN3AIxxjgLYQM+C2JuHpwhJstJARBK+HDXhQjDY5Cnm LxEtP0onnIX1Ce+owWQtvqzwk7LD7vNrT5cv0taSAxru3HT7hH+LjARt2Yd5Vv2BQCVv 0lzFG/Fb3vufDaw7UbwbcH1pK7ctJydH3bxjDU1Um4dG6z/wGQ7QMoqtWi2MHmlMkjhz 4Qjhj1Aa4X12Vr1qq7O9nz0d377DInyIBdy6fW65Bm2hgg487tLmUMmufFEOzej0jet3 YyAg== 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=s2CvEfV4x9tkVgjcQfaMTVqejZwVMEFjiL8lyr8+l3M=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=zEjnZWir5dETRxuhsatN6SIMUBO7Toc00O4kJCDjqpVS8+4+TkqLhiLFBwVpvZMXy6 0TUznskGE3/g3usArD9l1NEkPxAAZX0r1j+t6eK1ILYQhgbJrMY4bV6+kHlUFhNwpLu/ 4MvleIPaHK7t3x73f9rXr6Im/HziDxCRslG6UbXTkN+FDJ3pLLsUTjYFB3XGKy3ernVZ XuHz4uWxMKC5a9YNs+DQCiyEHXWWuqkJPdQ9VcFVxGR8s1HuWLPL61ZIA59VPDp+eOiN h5RbE9vrMF1znNUGOXTYQ7yOlwVs+aj8gUQ7UF4YH9pMPoRNkz968wr1D9T3nuC9Hmhq TlHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wIFtPZxN; 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 r18-20020a0cf812000000b0066cfe943369si3579512qvn.358.2023.11.01.18.46.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:46:55 -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=wIFtPZxN; 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 1qyMcn-00016s-1w; Wed, 01 Nov 2023 21:35:57 -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 1qyMbA-0006YR-1x for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:17 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb7-0001zB-31 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:15 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5bcf83a8f6cso300012a12.2 for ; Wed, 01 Nov 2023 18:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888852; x=1699493652; 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=s2CvEfV4x9tkVgjcQfaMTVqejZwVMEFjiL8lyr8+l3M=; b=wIFtPZxN2l4UlvDJdx0bSE78fPMYS22rLzupBUU6N1bpEJQQO2MzwSpKHUBNPYo2MH RSgsU9G+DtRjumgnNc9UhXKiXCAmw2XBBNjp2E9ONqTucyEbcJRYoReoSrCnQ4alO67M cbLMBiOfV0tIgD3ysiegbvyb456avTDEoPVfpPsEtjA0TRQuGKiSx6NtOjJC6YJn1tqW 9LPiEDDNbXwxGR5kgUMyhbmH5tRQJf0sKaWVzhZMQlOvnWq4K+XMcw7TlcXeSfINg1tw MNvZlQG6O+Gng9mluN1QpiV3q/pkVz0WpdoR/hNnyviPc0aKebxN4VpN4l6bZzcWxYKk t27g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888852; x=1699493652; 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=s2CvEfV4x9tkVgjcQfaMTVqejZwVMEFjiL8lyr8+l3M=; b=d8JvOYWontvr7WRkfIGhDzBC39PHT/fsPQxTF17DSlAo8Bd6a05EdUcKPRBXwz0VTy /iC/nhwfe0d4NRTGKU1T8sZVB4TcTmdvGjuQEOhCBXUcXwYJt4h3r53wAOX/DIpp99NI zKcHoXKrSGNqCCJryK5XhY1EaKLuR6Dq/xK7DeCD/emr4dlajqpWkSt4x+Q/QFhvlABt XMhTdUHPlUR/elIJIiupmMwbHOVWNGmQaNM/xRhsRWgw2ttPI1G7h9yXgZ1eQBzAhUX2 c2a1sww6opmrXSnUvzgPS6CH7r0KmMZ1UdXdwj3dvtGC1OnvL1cAZ/FmHEjIBunWXivn vLng== X-Gm-Message-State: AOJu0YzUetMLYyH5SIHeskOruXltpi0wUrZRMqnc8iIy+aBxx0umZIaS uKcGSr048yxUUa10i+M0W8UrukWFDjU7SDSaK5A= X-Received: by 2002:a05:6a21:99a2:b0:153:353e:5e39 with SMTP id ve34-20020a056a2199a200b00153353e5e39mr16890445pzb.51.1698888851844; Wed, 01 Nov 2023 18:34:11 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 63/88] target/hppa: Implement HADD Date: Wed, 1 Nov 2023 18:29:51 -0700 Message-Id: <20231102013016.369010-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/helper.h | 3 +++ target/hppa/insns.decode | 8 +++++++- target/hppa/op_helper.c | 32 ++++++++++++++++++++++++++++++++ target/hppa/translate.c | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 57ea5447b6..b3c961b50d 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -14,6 +14,9 @@ DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) +DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) + DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tl, env, tl, i32, i32) DEF_HELPER_FLAGS_1(loaded_fr0, TCG_CALL_NO_RWG, void, env) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 820049b0c5..4bcfc94b1c 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -65,6 +65,7 @@ &ldst t b x disp sp m scale size &rr_cf_d t r cf d +&rrr t r1 r2 &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d &rrr_cf_d_sh t r1 r2 cf d sh @@ -81,6 +82,7 @@ #### @rr_cf_d ...... r:5 ..... cf:4 ...... d:1 t:5 &rr_cf_d +@rrr ...... r2:5 r1:5 .... ....... t:5 &rrr @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d @rrr_cf_d_sh ...... r2:5 r1:5 cf:4 .... sh:2 d:1 t:5 &rrr_cf_d_sh @@ -208,6 +210,10 @@ subi_tsv 100101 ..... ..... .... 1 ........... @rri_cf cmpiclr 100100 ..... ..... .... . ........... @rri_cf_d +hadd 000010 ..... ..... 00000011 11 0 ..... @rrr +hadd_ss 000010 ..... ..... 00000011 01 0 ..... @rrr +hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr + #### # Index Mem #### @@ -429,7 +435,7 @@ fmpyfadd_d 101110 rm1:5 rm2:5 ... 0 1 ..0 0 0 neg:1 t:5 ra3=%rc32 @f0e_f_3 ...... ..... ..... ... .0 110 ..0 ..... \ &fclass3 r1=%ra64 r2=%rb64 t=%rt64 -@f0e_d_3 ...... r1:5 r2:5 ... 01 110 000 t:5 +@f0e_d_3 ...... r1:5 r2:5 ... 01 110 000 t:5 &fclass3 # Floating point class 0 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 0bccca1e11..a230a3a0c3 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -377,3 +377,35 @@ target_ulong HELPER(read_interval_timer)(void) return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) >> 2; #endif } + +uint64_t HELPER(hadd_ss)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 + f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} + +uint64_t HELPER(hadd_us)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = extract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 + f2; + + fr = MIN(fr, UINT16_MAX); + fr = MAX(fr, 0); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f570b17ecd..f564aea8fb 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -23,6 +23,7 @@ #include "qemu/host-utils.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" +#include "tcg/tcg-op-gvec.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h" @@ -2767,6 +2768,42 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) return nullify_end(ctx); } +static bool do_multimedia(DisasContext *ctx, arg_rrr *a, + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) +{ + TCGv_i64 r1, r2, dest; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r1 = load_gpr(ctx, a->r1); + r2 = load_gpr(ctx, a->r2); + dest = dest_gpr(ctx, a->t); + + fn(dest, r1, r2); + save_gpr(ctx, a->t, dest); + + return nullify_end(ctx); +} + +static bool trans_hadd(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, tcg_gen_vec_add16_i64); +} + +static bool trans_hadd_ss(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hadd_ss); +} + +static bool trans_hadd_us(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hadd_us); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Thu Nov 2 01:29:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740422 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp598423wrv; Wed, 1 Nov 2023 18:50:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGf5FPHHJ4NM1zu8kyj2X86DjosSJx6tyg0XMLAcqJoyDbRFMTHNJQ8cnNRbmdVQViYd6Z5 X-Received: by 2002:a5b:88b:0:b0:da0:3c5a:e1bd with SMTP id e11-20020a5b088b000000b00da03c5ae1bdmr17475954ybq.5.1698889836807; Wed, 01 Nov 2023 18:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889836; cv=none; d=google.com; s=arc-20160816; b=Exku/a5YXybLW8NT7wcnDah5vgkvNd/Xwnt89lFMzfoyFoxwoUY2o+8yJU72IPo691 dwuunMtQxpW4hm2rFNq7FwAp81HE6HchQfr+bVgSNG3Rrj+hjpJknklOIb07TAgBvuUG YdbXxh8lh/upf8XJIHsONbSwJebFrE2yiIoW90+FKXYN+7ealVYD6Gb/TEY8mcfjADVU +vTBv/+6oFqIxYG5qvyI3hdh3rpsl24PNUpjVVn7qHJd+L+NfK4jeJk1B4WB985XOGJL Hm9G4n5iQoN9Ngyj3kO52g70AuMzvidlAngGwm4TG86HPObm6dd9So+6gDbMdZ6/QAi5 cVIg== 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=Z97fFY7Wn9zj1ZAonEuX35kI8FxyV8+JUDBvaH54V24=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ioiKErqRnS6XL5NmN4J2/glnG8Us/NISY175FFuo0CAN6OwxbjnuRsPjOKKfWfkFhd lTkqAYL33H3ynvO9fT/Q9T4gQSm/7Zd8a6zr9xpQFFMKNDf+UIM/ZrvvSnsb1ik3/TxS msIqy2rK7m0n5IPeK8372TDb/SRUZka2xsipDtW9Z8AXpJEnja+MyavKOC2YQ4gOG6zO 30A8C/UzTtaeKa24r3KtZLtTMEzKIcXp92WL673Dwg0WtiaJc3CA+sN82I5feW3+m84E pTxAsGacUa9rfTuswDpIunZ3cdkHdajuehZz6pBq03ualgHSuKY9J4tsVDDvm97q25kM G6mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g2wQE7J4; 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 e18-20020a0cf752000000b00670bcfd310bsi3687253qvo.602.2023.11.01.18.50.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:50: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=g2wQE7J4; 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 1qyMbl-000749-Ge; Wed, 01 Nov 2023 21:34:53 -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 1qyMbA-0006YT-3B for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:17 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb8-00022C-4d for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:15 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1cacde97002so3130785ad.2 for ; Wed, 01 Nov 2023 18:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888852; x=1699493652; 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=Z97fFY7Wn9zj1ZAonEuX35kI8FxyV8+JUDBvaH54V24=; b=g2wQE7J4/4/rUswXZYAM8IzBJaHolz8LrpA/6Id0hKZ6lzFIPD14SAbbo7sBULTlpe 3yVQJbgu1owcUyZ8Ix8cKbaqSBcq7sCcIjvKErdMC3W0CR3U+9q6V4s+90zbgCRbMP0H tU3qroAGR/el3Zax2d3wBhMv9mrOYJe1B8OyJiMy1DjhTPr5jsukbYo66MEaVhPh81Lj S2VvkKm9aeKxQr/8pRr/8mnPbVqTfjnQy1uvSMso1IKQafq1qkGFfHWVPwkbTHzjuC9u S2xKNMl7pKFu4ds9Yl29RvBATqru3TDGxBYl+d7iFhUm1GEbBGha+ol98oEzq9/Mf9Ic VLpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888852; x=1699493652; 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=Z97fFY7Wn9zj1ZAonEuX35kI8FxyV8+JUDBvaH54V24=; b=HiscghbQF+04/p+T0IUk19ZpcUmMEvtVN0l81BniDpsNJjIcAf5sba1f/u1WshuYu5 4/TGwZgNp6ClQCOpAnF6A1q/3T4f68pCLaqQ511xbiAc17nXGOBG0+9N4XUypgnotWog MTcBG5BMxJ57SnLQybUxmiC4gaDsfDCoU2aJin9Se4cnh2Kw3K8OJI36ZcEIKbUWFiz4 m27YE0bF7ZJfYsGWdGDslVubdbbFSP2Gvbo2tZGmizwzP8a7a7tOvu+4x7P1pavv5Y0Y yLiSMB5gGggyQkGyHO3VyGh93DbGTgfj53LMaIhf8nJ9hjDPdsGRQFKA2FHjciBHnLEy cnSw== X-Gm-Message-State: AOJu0YwRXHbo5wQLZg/zACtGzOfpopSCWdc9lFTSjcifVh8U4sTMr1eM aqAzkX3Tip4XXlJmS6/SkB7NZiMbvD7vyTX0KGs= X-Received: by 2002:a17:902:f550:b0:1cc:62d0:6008 with SMTP id h16-20020a170902f55000b001cc62d06008mr8882741plf.55.1698888852662; Wed, 01 Nov 2023 18:34:12 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 64/88] target/hppa: Implement HSUB Date: Wed, 1 Nov 2023 18:29:52 -0700 Message-Id: <20231102013016.369010-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/helper.h | 2 ++ target/hppa/insns.decode | 4 ++++ target/hppa/op_helper.c | 32 ++++++++++++++++++++++++++++++++ target/hppa/translate.c | 15 +++++++++++++++ 4 files changed, 53 insertions(+) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index b3c961b50d..02798aa105 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -16,6 +16,8 @@ DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(hsub_ss, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(hsub_us, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tl, env, tl, i32, i32) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 4bcfc94b1c..29b49c6cf4 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -214,6 +214,10 @@ hadd 000010 ..... ..... 00000011 11 0 ..... @rrr hadd_ss 000010 ..... ..... 00000011 01 0 ..... @rrr hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr +hsub 000010 ..... ..... 00000001 11 0 ..... @rrr +hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr +hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr + #### # Index Mem #### diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index a230a3a0c3..ece523bea0 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -409,3 +409,35 @@ uint64_t HELPER(hadd_us)(uint64_t r1, uint64_t r2) } return ret; } + +uint64_t HELPER(hsub_ss)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 - f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} + +uint64_t HELPER(hsub_us)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = extract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 - f2; + + fr = MIN(fr, UINT16_MAX); + fr = MAX(fr, 0); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f564aea8fb..2f1333b91c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2804,6 +2804,21 @@ static bool trans_hadd_us(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_hadd_us); } +static bool trans_hsub(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); +} + +static bool trans_hsub_ss(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hsub_ss); +} + +static bool trans_hsub_us(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hsub_us); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Thu Nov 2 01:29:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740393 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596152wrv; Wed, 1 Nov 2023 18:41:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHymxniU6ceM3F0JDt+MjXxL4NCZuQUmUrueaY2YP2s9C8lHtDO1T6xfBXKpsFlPiVoUXFG X-Received: by 2002:a05:6214:1bc6:b0:671:1d67:cc1e with SMTP id m6-20020a0562141bc600b006711d67cc1emr15059236qvc.39.1698889309662; Wed, 01 Nov 2023 18:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889309; cv=none; d=google.com; s=arc-20160816; b=P/a2k/Cmhzt23a9iLPcNZB0jkzG20HIGNAcz/5g3rdpBNS/cJiwcr6L3C1umb3HJLu QDrxcSImSfsZPNe1J9okmNSpZcn4SIlt3OKy/3aB4rQE0Hs4l4rno6S4LfV4ziN9hWNv onzMzaSDVicABI4pOa/VXMjZyLxIXgSNUqJIjhKh5s6RSgdARJVBbRu1vnOjREkToA0j 0HN38LsgxhC9P7P0QUOXMXSYc45wAzaaUqxd147rzvAj70iNz2QCZe0CJGE6e6WTCXKe UoGHObGD/0nyq8U+AO5+pn7C/CypqvIN5oifLebhF+/kcEyptMNLVcNbBE2/KWl7XV7b Pq+w== 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=eDzYxooTETsUZpkDPcJF0snGWWzzcelkJpEZxKcE6J8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=CjseSKfUbmJgzR38wLlTNiHW/mJfBNyUoeMsPP9iGjlcoRRPUBkU4QK9QP4yWmwHYt IWZWY2qQtAHySo0J3/jht6wP7KgmoU+EdXOqUE6p6xskkbFybpU8r+xdqkc3nSH1n1ck WfpAG4uJ3mJhx8y1Bm6B1IUNaWUuy/r6NZ5IIfVoRNnwdxXc49RhTJ8nfl+52PaVcyvF 8Wisyd5nhtblperL/FA1G3IYlwllc1q3RO+aHdDXr8V1ii6FNB+4TQc8iJbc0j/jNbUE sY4h+6TWXjRg22Py9byr6QRA8SuGQePMFKjWMT0O8nhCkOyIxctjwDIzkWB4NSh3Ccp8 P7NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AhlRKFdl; 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 y17-20020a0cec11000000b006707e236e9dsi3707889qvo.378.2023.11.01.18.41.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:41:49 -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=AhlRKFdl; 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 1qyMcX-0008C9-OV; Wed, 01 Nov 2023 21:35: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 1qyMbB-0006Ze-Jp for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:18 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb8-00022i-Pd for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:17 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5aaebfac4b0so305506a12.2 for ; Wed, 01 Nov 2023 18:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888853; x=1699493653; 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=eDzYxooTETsUZpkDPcJF0snGWWzzcelkJpEZxKcE6J8=; b=AhlRKFdl3Uy5YU6mTDgjI0/UkwijiUE+3yDdZBZaxThYQXPIQQ60Nn8qWIJEZDgBJ3 LRBNvmM8IiFHBlN6QcBGh4nITpyJzvkSZvSeiJRWG1/68AXaroUrpUEWX3P0sQX1mMmR sJC567chgQMve7PEZNOfhOgS8TIL8zW4z46Yhqm6CwCxsOVK46sq2peBOXsfmdsC7aOW coNTXhX+uwvhTsKcY9NdatjTWoBra+d1vy7lilhxrccBe6Rd5cPOzNVMO85MfvOFVyqH y1IXLPLeTLW21yOrJSm8qoG/Ty1xJdZxAYouD5c36J0DIPyq+CR/mWoUqi1l97ncwMBW SFGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888853; x=1699493653; 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=eDzYxooTETsUZpkDPcJF0snGWWzzcelkJpEZxKcE6J8=; b=QiyDxxKki5923CBlP1Skt1hv+36x/XmheB3eikV9mZyDFuBZK6Ez2wA/T+Bzm6c+VI DJsCz4ZD6Xvh4HxDToTNglw6IRcawz7IuRNZ3eGyZ0qNzpRgm66+FTduR75SCsF4sRGP lxPiVyF9mfFmSzQE8Bm8jOeHGEEKrjhnS0qKMzJx8SkQXnm8c4hrRInvT9icmUt0NPgU OR8t+q/yScFMBvDn+LEBl05OxyJ3rkcMQeDQzmn+eC4pq2IiNQz41Clr+SInnWdDDppH +iJZjZeSFMH3WKmAO5Ke6+9YSBRL5841SDcsTteXRMu+E9+0WxZFxo2Cwlt+4B03YtJ5 N2jg== X-Gm-Message-State: AOJu0YyPGIs+H08xZGhBz8zMpErNRI7B6c4HZYNWr2jBKB4uSHGRhxyn YF5wDe5cC5oA4EtX+hZD8FkypozxOBNxgFEXOVU= X-Received: by 2002:a17:903:22c5:b0:1cc:4669:c0eb with SMTP id y5-20020a17090322c500b001cc4669c0ebmr9957733plg.21.1698888853487; Wed, 01 Nov 2023 18:34:13 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 65/88] target/hppa: Implement HAVG Date: Wed, 1 Nov 2023 18:29:53 -0700 Message-Id: <20231102013016.369010-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/helper.h | 1 + target/hppa/insns.decode | 2 ++ target/hppa/op_helper.c | 14 ++++++++++++++ target/hppa/translate.c | 5 +++++ 4 files changed, 22 insertions(+) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 02798aa105..51c24b31b0 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -16,6 +16,7 @@ DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(havg, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hsub_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hsub_us, TCG_CALL_NO_RWG, i64, i64, i64) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 29b49c6cf4..6959555bf3 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -214,6 +214,8 @@ hadd 000010 ..... ..... 00000011 11 0 ..... @rrr hadd_ss 000010 ..... ..... 00000011 01 0 ..... @rrr hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr +havg 000010 ..... ..... 00000010 11 0 ..... @rrr + hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index ece523bea0..cba610ac75 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -410,6 +410,20 @@ uint64_t HELPER(hadd_us)(uint64_t r1, uint64_t r2) return ret; } +uint64_t HELPER(havg)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = extract64(r1, i, 16); + int f2 = extract64(r2, i, 16); + int fr = f1 + f2; + + ret = deposit64(ret, i, 16, (fr >> 1) | (fr & 1)); + } + return ret; +} + uint64_t HELPER(hsub_ss)(uint64_t r1, uint64_t r2) { uint64_t ret = 0; diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2f1333b91c..2fdd4448ae 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2804,6 +2804,11 @@ static bool trans_hadd_us(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_hadd_us); } +static bool trans_havg(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_havg); +} + static bool trans_hsub(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); From patchwork Thu Nov 2 01:29:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740415 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597784wrv; Wed, 1 Nov 2023 18:48:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnAvRSxcblUyyrtOpGDJhKjp73KWQOX4i0jZR2A0RE3OzTFY6YWKPbmVolaRZbxyr4p9s9 X-Received: by 2002:a05:622a:d3:b0:41e:1974:7cf1 with SMTP id p19-20020a05622a00d300b0041e19747cf1mr20605773qtw.18.1698889684814; Wed, 01 Nov 2023 18:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889684; cv=none; d=google.com; s=arc-20160816; b=uDsyf6uGzm62mxC3oWFjcXFPuybg5GQDM4q84+58zSjX3hS2ZfPmTYEIvHUDVakWUd +idEEmvkMrp3vPtMOBTqU46zT/Z0NfZsBSfrDYhBVCOSoga2SlKpFhc9w+UNNf0N4sQZ wBVNFbSG6j6rVrKOBYapn5HHBjtJ6e2NTf1tVtEcmxovhNce+VPBL2gLOOifOVDStPrs k9Pav/ovAPZQIIMq6oHWmfJLvONc0agv+epbASICEKCx/6xxaXZ25vuzUdZ7XkuwVP6j +Kn5X0ZX5VcMVFXttSvQd2uOgWW0bAF3VKzwNJrMWIw5ZfHiic3NnastKtbHGB+AALw+ rfsw== 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=5dZJ/Avbvd5B1sVDHFkjz0KBLC9YCeO4NBIHCuQT/As=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Mkcqme4D2s7W4i2fjRdlKGvv0Kaf+OSH5lkDZguNw8QLFnddi1626LwGOXXabz3vHb jCgzYY2jbC5W2rLxR5g3UjpGo2MQgEogH8WkW2ekebfh6AChDAu/a03LIxxv/de3mE55 Xpsx9V8/lhOKV1vUxZVyJXHop9VHzkNw3gQGBMeloiAo11IdKIC9EP5rCClCxKQTKkJn /MikG1NbRqzXz8uHOMWJQFXDaqP+3Qg+zbFIEhra68QAY52/x8A64HA7sIW9frK58e6L X0wEEf3Ies5yPOUrQJeAajm43np7u8oKpK70UBYHEFhu83fq29/Q1CoQ/RGeriKkg8B2 1WEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OaKkIT44; 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 f3-20020ac85d03000000b0041963cd47dcsi3667514qtx.38.2023.11.01.18.48.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:48:04 -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=OaKkIT44; 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 1qyMce-0000UY-6s; Wed, 01 Nov 2023 21:35:49 -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 1qyMbQ-0006pA-TS for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:32 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb9-000230-QM for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:32 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cacde97002so3131015ad.2 for ; Wed, 01 Nov 2023 18:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888854; x=1699493654; 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=5dZJ/Avbvd5B1sVDHFkjz0KBLC9YCeO4NBIHCuQT/As=; b=OaKkIT44AQB+MWrMxh3aPC3Vwg9cQYYR4Jq25qMrlbcCW0Q1UpL1jPBM3NTDo0Htsa 52kAnzBC/qtVYub8RXjs5V4MZpclNpUVFs0qnfEUabpahRypOMnK+sjyN8uYUMAGb1ZS qI8UBBu8cRBwuR2SvSnwbkUWgvHVwDS9AXQMEDF29x4klPS6W/EWmd/YhnzXZiv+ueQk gkQU6hgfVnNvFbY/jvXKlQjYh0dd0nQAF7DfjyvS3rr2wJVyXlwicyMbUBZXleFvReUr ZJW0xZAC6sMsinjyAFG3iiWv21AjSBjz5T0IR4tXkjJTfapn8bAd+paesKTaBQx4UuQF hXZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888854; x=1699493654; 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=5dZJ/Avbvd5B1sVDHFkjz0KBLC9YCeO4NBIHCuQT/As=; b=vtqwC6I6I6zwfveWf8CGQhtcdiNOm23gcYi65MWsqYd7NGi5NcxojmylyfejgbU9ln IZSPhBzzG377hMHFihiwqEdHrcSo2zJdUvfJbbuAAtXo0Xa/SKtAGG88wGPMZQocmYV8 Is/ZVEw/S1KURTR2A2E+JV6UBRafhB7RM20dKsfw4YERNHLRgGBeKABsMSqdq/wQ0UHy hvHMeoUmLJH3d3e4w/fNy2MCNNuJUSSynM6XJi1bsS2kdQmPcrEoCajF2xWKfYulwbO4 Yb3YRwNlr3kk2TKxs9G0ZaUyI4M784FTgUUCLpwMbmo5Cfdh4yMR44JIsmyR7rq/+3JD ukXQ== X-Gm-Message-State: AOJu0YwHebsmj/R7ViNpzW7RjD0h3HdshPxTVkgmXi4Cgh8JCz1GksMf y6yvI71MYxRHk68Hl9LiNJQvPtLaQMa4dG7jJhg= X-Received: by 2002:a17:902:d484:b0:1cc:361b:7b28 with SMTP id c4-20020a170902d48400b001cc361b7b28mr12470291plg.64.1698888854304; Wed, 01 Nov 2023 18:34:14 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 66/88] target/hppa: Implement HSHL, HSHR Date: Wed, 1 Nov 2023 18:29:54 -0700 Message-Id: <20231102013016.369010-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 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/hppa/insns.decode | 5 +++++ target/hppa/translate.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 6959555bf3..bb5cd267b0 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -69,6 +69,7 @@ &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d &rrr_cf_d_sh t r1 r2 cf d sh +&rri t r i &rri_cf t r i cf &rri_cf_d t r i cf d @@ -216,6 +217,10 @@ hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr havg 000010 ..... ..... 00000010 11 0 ..... @rrr +hshl 111110 00000 r:5 100010 i:4 0 t:5 &rri +hshr_s 111110 r:5 00000 110011 i:4 0 t:5 &rri +hshr_u 111110 r:5 00000 110010 i:4 0 t:5 &rri + hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2fdd4448ae..d342df2dfa 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2789,6 +2789,26 @@ static bool do_multimedia(DisasContext *ctx, arg_rrr *a, return nullify_end(ctx); } +static bool do_multimedia_sh(DisasContext *ctx, arg_rri *a, + void (*fn)(TCGv_i64, TCGv_i64, int64_t)) +{ + TCGv_i64 r, dest; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r = load_gpr(ctx, a->r); + dest = dest_gpr(ctx, a->t); + + fn(dest, r, a->i); + save_gpr(ctx, a->t, dest); + + return nullify_end(ctx); +} + static bool trans_hadd(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_add16_i64); @@ -2809,6 +2829,21 @@ static bool trans_havg(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_havg); } +static bool trans_hshl(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_shl16i_i64); +} + +static bool trans_hshr_s(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_sar16i_i64); +} + +static bool trans_hshr_u(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_shr16i_i64); +} + static bool trans_hsub(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); From patchwork Thu Nov 2 01:29:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740380 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595345wrv; Wed, 1 Nov 2023 18:38:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpWQJF9pW5eXO/wsYJzlHV4FdhuF8cMiyKVewt+SjCkBVhAg6kq/AVdySDv3wqC65CdcqA X-Received: by 2002:a05:6214:d06:b0:66d:69d1:d57a with SMTP id 6-20020a0562140d0600b0066d69d1d57amr21823422qvh.38.1698889117308; Wed, 01 Nov 2023 18:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889117; cv=none; d=google.com; s=arc-20160816; b=KYiCoFZPFdfhyZoBWmWPPwiLtJxOQGQ31MhdsoK1KEjoo6ID5iwar9c2AI+nCeb8Es AJQrUDpYFtHzhQ0fY3XXx5NkvRtJELmfEz5NZYW30c7e4zdh8Or/GgPFJYYjZkPhnpwt g1i3jjUxk8XwCNWwnsnQmo9kKonayT7BHlPMtrf4uKIsDPBzyridCrFo2z8TAUebRua2 YMnEehwahtzk0R6pj8tptjgPcJxMA9o2qLTL5bUE0/25HAjrsVcpBBXw7awTDtB8hn6C OowBCaTpC4ii24eyUzUSseG+NGq3ibyBF0ew+onbqkLNyC3djxcR4GmZaKRkIwTGUs7l gHsg== 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=6TGhrVvSioZOKLzuGEDT0EYlmb53GWffcGiWzBh1bjs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=N5y8fZCzWR9vhdu1ARm+BhwbfZJ9QwyjY/dtC2xdc1H7/wIx9dPQdCJZ5i0dxAlFAc XcXahzBewpdQvwar6v+x0BqNKJk3rw8wheQhu7KT2/JtS/GuiUsU22/wZDLvqh5hTfXD ZeGprzI8CefEKAXIqLq1jTXEBEE8CO9dYRiguTrgSkkDBdscfdg+xEiS8epV8UI/iRrr lcWWyDptFm57qbTT7YIGyk5KbBQMKj0VpsoEDjJ0xk04VxfraZzJB4759uNMM8ZlV+Il AunSQXoezoQpiOlpgm+4w86SN17v/BhpySjvgvrbp1ckxxjjscAmFE3VQ6SE8p8GPtmp kHKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uJ43/joG"; 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 eb2-20020a05620a480200b007777245a946si3837850qkb.41.2023.11.01.18.38.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:37 -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="uJ43/joG"; 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 1qyMcT-0007sM-9k; Wed, 01 Nov 2023 21:35: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 1qyMbD-0006b7-Ci for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:20 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbB-00023C-G9 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:19 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5b9a456798eso292129a12.3 for ; Wed, 01 Nov 2023 18:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888855; x=1699493655; 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=6TGhrVvSioZOKLzuGEDT0EYlmb53GWffcGiWzBh1bjs=; b=uJ43/joGWgLhq9NW53EABIIvnOc6yKpKF7/u/bdpavbZ5h4rempg+BIly2n4hJg8jS 5OycgOv7ln1QlKSA80i9mAl4r/z5ml+pqLbB6MEU9XphSPKq0BrBGJu3bq30cJv/8Awp Q40GjOA+OKDU3r3sNarFweXpu12xEUr6nKaGNFR0gEth4DYWorz4Vh6X2siKDIGbTg37 ph2BgBspy04C4w+SI8GaRBep1YN4ku0XMCp8ygaatSBnsMIEUu0GmX/9TNH8vsn+XUM0 dZVOuTECYzAB6is13G4c/nnF9R9sUnu2eg6ndVuvvapd+gnxPmSPWUxDY0jhp3TN2nHS SC+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888855; x=1699493655; 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=6TGhrVvSioZOKLzuGEDT0EYlmb53GWffcGiWzBh1bjs=; b=k9qdS4J2zgyRbMUHnAhSSCn3/WYeKy3+iYQ2B5kHZBzDI7kzvXiaFcwjwycvlXFV5F /gSMmLl8ZwS8RAIG0LsskhxoSH1fesUTdDOfpZMyFAz91eMrLVJ5TKF3IGC/Z2X7qVCG 17VgAFuhTbeF87TsbOHE0yxM3n8SdlmGeouevazVBm/VIjlHJfi+GRB/mQgSgzVIDHMa xQaoU0D82+Pxxgk61UbZyY/8EozbAPSE4As3pjQvOGW1+nEFzvC0zu7iJut/0lIusgh+ 3AJmtXGdkadYKOt2YTWT5LTzaZ7vX5DHB3JQeHayzmevkhLNxirGqBIO0NwLErCzqLhA sWwQ== X-Gm-Message-State: AOJu0YyaextApGJMQ2lHzxtESP6jQnW5lYCyt6VxV0FCeDfUCtA//xn4 TWNWw6qzpKgSwmRtQCcn6CkqgM6zpa+J5K5sLMg= X-Received: by 2002:a05:6a20:bea0:b0:161:27c5:9c41 with SMTP id gf32-20020a056a20bea000b0016127c59c41mr10881293pzb.28.1698888855124; Wed, 01 Nov 2023 18:34:15 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 67/88] target/hppa: Implement HSHLADD, HSHRADD Date: Wed, 1 Nov 2023 18:29:55 -0700 Message-Id: <20231102013016.369010-68-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/helper.h | 2 ++ target/hppa/insns.decode | 12 ++++++++++-- target/hppa/op_helper.c | 32 ++++++++++++++++++++++++++++++++ target/hppa/translate.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 51c24b31b0..c5f1db574b 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -17,6 +17,8 @@ DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(havg, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_3(hshladd, TCG_CALL_NO_RWG, i64, i64, i64, i32) +DEF_HELPER_FLAGS_3(hshradd, TCG_CALL_NO_RWG, i64, i64, i64, i32) DEF_HELPER_FLAGS_2(hsub_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hsub_us, TCG_CALL_NO_RWG, i64, i64, i64) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index bb5cd267b0..87db726d9e 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -68,6 +68,7 @@ &rrr t r1 r2 &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d +&rrr_sh t r1 r2 sh &rrr_cf_d_sh t r1 r2 cf d sh &rri t r i &rri_cf t r i cf @@ -86,6 +87,7 @@ @rrr ...... r2:5 r1:5 .... ....... t:5 &rrr @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d +@rrr_sh ...... r2:5 r1:5 ........ sh:2 . t:5 &rrr_sh @rrr_cf_d_sh ...... r2:5 r1:5 cf:4 .... sh:2 d:1 t:5 &rrr_cf_d_sh @rrr_cf_d_sh0 ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 @@ -187,14 +189,20 @@ dcor_i 000010 ..... 00000 .... 101111 . ..... @rr_cf_d add 000010 ..... ..... .... 0110.. . ..... @rrr_cf_d_sh add_l 000010 ..... ..... .... 1010.. . ..... @rrr_cf_d_sh add_tsv 000010 ..... ..... .... 1110.. . ..... @rrr_cf_d_sh -add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 +{ + add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 + hshladd 000010 ..... ..... 0000 0111.. 0 ..... @rrr_sh +} add_c_tsv 000010 ..... ..... .... 111100 . ..... @rrr_cf_d_sh0 sub 000010 ..... ..... .... 010000 . ..... @rrr_cf_d sub_tsv 000010 ..... ..... .... 110000 . ..... @rrr_cf_d sub_tc 000010 ..... ..... .... 010011 . ..... @rrr_cf_d sub_tsv_tc 000010 ..... ..... .... 110011 . ..... @rrr_cf_d -sub_b 000010 ..... ..... .... 010100 . ..... @rrr_cf_d +{ + sub_b 000010 ..... ..... .... 010100 . ..... @rrr_cf_d + hshradd 000010 ..... ..... 0000 0101.. 0 ..... @rrr_sh +} sub_b_tsv 000010 ..... ..... .... 110100 . ..... @rrr_cf_d ldil 001000 t:5 ..................... i=%assemble_21 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index cba610ac75..9d8e728460 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -455,3 +455,35 @@ uint64_t HELPER(hsub_us)(uint64_t r1, uint64_t r2) } return ret; } + +uint64_t HELPER(hshladd)(uint64_t r1, uint64_t r2, uint32_t sh) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = (f1 << sh) + f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} + +uint64_t HELPER(hshradd)(uint64_t r1, uint64_t r2, uint32_t sh) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = (f1 >> sh) + f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d342df2dfa..dc68d5a263 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2809,6 +2809,28 @@ static bool do_multimedia_sh(DisasContext *ctx, arg_rri *a, return nullify_end(ctx); } +static bool do_multimedia_shadd(DisasContext *ctx, arg_rrr_sh *a, + void (*fn)(TCGv_i64, TCGv_i64, + TCGv_i64, TCGv_i32)) +{ + TCGv_i64 r1, r2, dest; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r1 = load_gpr(ctx, a->r1); + r2 = load_gpr(ctx, a->r2); + dest = dest_gpr(ctx, a->t); + + fn(dest, r1, r2, tcg_constant_i32(a->sh)); + save_gpr(ctx, a->t, dest); + + return nullify_end(ctx); +} + static bool trans_hadd(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_add16_i64); @@ -2844,6 +2866,16 @@ static bool trans_hshr_u(DisasContext *ctx, arg_rri *a) return do_multimedia_sh(ctx, a, tcg_gen_vec_shr16i_i64); } +static bool trans_hshladd(DisasContext *ctx, arg_rrr_sh *a) +{ + return do_multimedia_shadd(ctx, a, gen_helper_hshladd); +} + +static bool trans_hshradd(DisasContext *ctx, arg_rrr_sh *a) +{ + return do_multimedia_shadd(ctx, a, gen_helper_hshradd); +} + static bool trans_hsub(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); From patchwork Thu Nov 2 01:29:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740405 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596955wrv; Wed, 1 Nov 2023 18:44:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmlGmUU10ZS66Gr670MXsaMjR2/SRMnMgOVEQT9+Ge6LGzB6MX0mp8vtp9Dd6CAls8ujcc X-Received: by 2002:a05:6214:242d:b0:66d:3e2b:bf0a with SMTP id gy13-20020a056214242d00b0066d3e2bbf0amr19837714qvb.20.1698889492440; Wed, 01 Nov 2023 18:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889492; cv=none; d=google.com; s=arc-20160816; b=OmSFz3oaCMYnEjKmwGUWnXsjDOtEhqRKzv/MOk32eweVsN4Nb91NhI3sxym+gW7vvL OeyCZYV1Su3/WN9m9cluIKKnZWOtQ9gEvmWpkm78nXMefHAvWQeSMTARR5P2UfL2/8Qh s1pYY3Pb3ZtDDgSWmhc9dowGR6i/A2CekuOICYap07/bqVuTCeTKQC2xrnqKn9w+uEIZ 2mCgbmJ5+ZtY1BtqimVkDmgcljxTHC3+fq0AXWTJMUhF5MZFPBRA6a4yqlr6r9rSBmAc G1hmDYhgsoKxY58g3Ah8P6L1zA3kr4D2jd8oZlX2ncZ0nlvm3k6VmOCLG6ID6nSQTnDr ZRRg== 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=yEHEJ2kNz1FEsr2Q2Yw9HpdWutXT14QU70zWCzMgwBQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=WNznIUhO/bE3+Zjz8KFZvM50ewhpJCU2GJ3s4uuogpd6o1NqOMbt2Ygsujluvnuyg0 5TQTlSeiO3t2ODNu2sxeMIwPUAZiyOCPpAijM1znE6gNTWtLKDoQVeWF+haVBJ1lJpyU SOIDJiPd0UM33Pm3SD7BKUF6dGnCiEjzCopVa1OztqOdZamUTkz60yb558PGhISe/LN0 PGb22KvF+fCzNZ3fCz8HAn/swyInVwRPgMPOgolpwtrUKvdnYurluKoJ/DDnH7TS+EIH 3k/kFEhzV9If6j2qNTwXZBhbtLMvgQ7h/tGwwkHETvjjZCH/EsJqz+IPh3fMKhwFgJDW pXfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="j/p+mxCE"; 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 u9-20020a0ced29000000b0066d121fdf87si3676489qvq.206.2023.11.01.18.44.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:44:52 -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="j/p+mxCE"; 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 1qyMcp-0001RD-75; Wed, 01 Nov 2023 21:35:59 -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 1qyMbD-0006bA-Em for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:20 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbB-00023U-Pt for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:19 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6be1bc5aa1cso489857b3a.3 for ; Wed, 01 Nov 2023 18:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888856; x=1699493656; 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=yEHEJ2kNz1FEsr2Q2Yw9HpdWutXT14QU70zWCzMgwBQ=; b=j/p+mxCEGV9oqdr/6ho6Ewc2YCBepZ3/NunLPIlneM8bnlSIvsHy13GugZrE2q68AO eo1mmglA/ad6s9i5ZqaP7Q3C+mm8B6vfqHe+wC2bY+hXweoxVAFlRNZZ8crOwKgvOVf9 WmzLuIRCThEDU6gdbBC8B4obgTDVKENVNYiFJNi7GLpsyVNYEyFun+gLsh9ddiLV0wzD +EAqJVBccXLo5rCTFzTjhnEvqJ9D0vMAmQnrP+BOMKZ+1VN8KRYn1RNpFFgWfV6VLJeV 69mhjcXBFnSS7CY9QeHqlY3cGxZ64gsejm8PQ9r2EsDvFUwYl56cNc5KiHa0NTF17pvY dSQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888856; x=1699493656; 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=yEHEJ2kNz1FEsr2Q2Yw9HpdWutXT14QU70zWCzMgwBQ=; b=ZP6agwbVceU0/b94N9gSVLv0AlXFdN2ux8lXAz1rIA4cKWvINCEtjju7zMILIlTDEb Z4+Cw0MBsc6BDOOSaTx52ezs/PQ6JR4uoBcGwaV3P618YX/p4FA7reEzibDCQ+R4AYQA uF6pWTb/iHyloLFB8+CCtRdqSmk1631RunftKJ6V/4BaQVz8jSP9XTP5gbfmllPuU2NY /b2v+CpUXq6USF/USB23tS7v2mJpzn00d2X0loJN5ghoRpZFkmwZZJjcUkvOpVbMdSQr xbwdccgi3Ctk4/iZKmTS86Y3Z/eIdo38n0D90oTwJsPBXknKU4P3eOnJMSsfWVGlRbL0 570g== X-Gm-Message-State: AOJu0YwOpp6oIjbRp/Ea5k8vMEaHYwLRxtRoIKc3CYUmtp3RUlVu9JEu uYU4x+HYd2Uj5tIbr/Ew243K/tZeFYv/HQHUEpg= X-Received: by 2002:a05:6a20:d404:b0:15c:cb69:8e64 with SMTP id il4-20020a056a20d40400b0015ccb698e64mr14751463pzb.25.1698888856039; Wed, 01 Nov 2023 18:34:16 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 68/88] target/hppa: Implement MIXH, MIXW Date: Wed, 1 Nov 2023 18:29:56 -0700 Message-Id: <20231102013016.369010-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 5 ++++ target/hppa/translate.c | 55 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 87db726d9e..22ec07f892 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -233,6 +233,11 @@ hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr +mixh_l 111110 ..... ..... 1 00 00100000 ..... @rrr +mixh_r 111110 ..... ..... 1 10 00100000 ..... @rrr +mixw_l 111110 ..... ..... 1 00 00000000 ..... @rrr +mixw_r 111110 ..... ..... 1 10 00000000 ..... @rrr + #### # Index Mem #### diff --git a/target/hppa/translate.c b/target/hppa/translate.c index dc68d5a263..47ca71e2a3 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2891,6 +2891,61 @@ static bool trans_hsub_us(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_hsub_us); } +static void gen_mixh_l(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + uint64_t mask = 0xffff0000ffff0000ull; + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_andi_i64(tmp, r2, mask); + tcg_gen_andi_i64(dst, r1, mask); + tcg_gen_shri_i64(tmp, tmp, 16); + tcg_gen_or_i64(dst, dst, tmp); +} + +static bool trans_mixh_l(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixh_l); +} + +static void gen_mixh_r(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + uint64_t mask = 0x0000ffff0000ffffull; + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_andi_i64(tmp, r1, mask); + tcg_gen_andi_i64(dst, r2, mask); + tcg_gen_shli_i64(tmp, tmp, 16); + tcg_gen_or_i64(dst, dst, tmp); +} + +static bool trans_mixh_r(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixh_r); +} + +static void gen_mixw_l(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_shri_i64(tmp, r2, 32); + tcg_gen_deposit_i64(dst, r1, tmp, 0, 32); +} + +static bool trans_mixw_l(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixw_l); +} + +static void gen_mixw_r(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + tcg_gen_deposit_i64(dst, r2, r1, 32, 32); +} + +static bool trans_mixw_r(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixw_r); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Thu Nov 2 01:29:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740400 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596357wrv; Wed, 1 Nov 2023 18:42:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIhd4M6yYm6vwXchoXrHCFNLmh1aGn/jwr2boxZumZD2XSxfoP07bTKH3uHok3ITF+2klk X-Received: by 2002:a05:620a:2b4b:b0:776:5135:d96d with SMTP id dp11-20020a05620a2b4b00b007765135d96dmr16918075qkb.69.1698889356157; Wed, 01 Nov 2023 18:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889356; cv=none; d=google.com; s=arc-20160816; b=UVyqKysLcZNHhWTCizygFsDDmYGEPuMoTqprKEiCO4ClxfYGH9Qh/fIg5A1KTgzX3q 6iGorzJHe+IwUGk9Ms+Yp/dxtaCWt9PNPFp2Ekx6gNOjPp/SdiiUwYjQLkIXkQ2y47Q/ ZeVl0FrUUl7aFqNlGrxw586VYxRXunjdPsvIvJ2rtPO3YRyKDujOGWc481paYCqqil0q 0cEnLwbZtoGkn8Gdf75Ar+HcqRaCyE2GT5yKiggiGwuJrJ+kzvJlq+LGGtqknZnEtLBA j+GtUqc04YZBAFvyjLxD/SAAMDcpAcU/E9XNg1RoeKBEeR7IEUgI8w8T0c7j2S4eL0Qy Ap3w== 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=dkyljCZpqzWzIh5N8Q5xG0nF40yxIPLXLpPcj7wj9PI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=L/IuHTCPLQ05PLIQQqNRscoeYiyqpDAVhaLsALi5UtihKz3Dt9C2Hi192nEDhTrlTp ZdOXfYtGlk+CWmUFNqF+o9jw9fZwoWVik1EUAFBLnV6Ib+fetdUzhEB34/no/P6hnIi1 s5ewwVntu7PBJoXsgDIf/iPQFnei8iGvnusViCclixnvGYQecbnjo4tisBz2C619XdAr vhaPwgAXAP+b+Y25dH3jlyJD5TFNQhjWYCO+GspNrUmkVieTRI8tvcS3bBGo8TFkPajw 1CmQX8jAFhSu+mo9Rg3CA9vYCF0+ISAdwwP3vOk5wbSd4zA8EZhUSzAp3Cpuf1J+L99s modA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qXjXhsdG; 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 x11-20020a05620a448b00b0077a50b1431dsi1848721qkp.221.2023.11.01.18.42.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42: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=qXjXhsdG; 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 1qyMbP-0006g2-0j; Wed, 01 Nov 2023 21:34:32 -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 1qyMbE-0006br-LK for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:22 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbC-00025H-87 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:20 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5b8c39a2dceso292149a12.2 for ; Wed, 01 Nov 2023 18:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888857; x=1699493657; 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=dkyljCZpqzWzIh5N8Q5xG0nF40yxIPLXLpPcj7wj9PI=; b=qXjXhsdGFvQ/sM1V69tlwpAWY6CkRTB4YQTMArYz/1dRLijgjm8AdkPL2wrTXS66Pt 5ojtPYcNp+uaIijBTo7GVlM7L++iL5HfnOywGQ1B3iPRJTC2N5htDjRVeeajrXrNgZC2 vmTRAVd74FQHBiWDdZbtF9yiVK2B79TS9YcVRb+UOO60JCbAHaG6mK+/lUKKqCYYtFzB gJQuO64+CnNalwMBPbII8DoG5DiTH3d9OO2Ho0nJ8yPzphub0mlOUJqPBToFC773LZYp b2ZMGXKz1y8qw+Jk7xfbpuflkCLEMCW+zvnYixU9JvkcuipktCdonUJWof+PnLcGqXgj YIZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888857; x=1699493657; 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=dkyljCZpqzWzIh5N8Q5xG0nF40yxIPLXLpPcj7wj9PI=; b=g6HmzOZumAFP4sT3a8kYgRKFZ3PCs54hL2/Wfqzppd/iX/Os/mMxw+DtA0BgsbZkhU xGq+GWc5al1oa1xKfhAKO9L+jl9z9sgs57pEpKckQ9T+E11VaYiNHOQBurXlGbrr4D1q NbtHp4YOo7yhT1HEWVutQmHDMT3CGdXww9ALZhIxYw85uIFdepby2gsw2ePyI0ZDMyju Z1UnrH5hVN57nleoBINSCYbfPr1k+LATF/xuHOvIMWwBW35vA4r+5u+c/JHkBDYd8C+r q1u9V7UswHShX7/KTD935o7uHnT7naMT8+d62hNoVV93BsoKyctvlZD8JGH4kXgvqjxR 4flg== X-Gm-Message-State: AOJu0YyPHyJzgwG0CMYaAQfRUaVX6xjVEsAM7UMjEUmo8GUuSLKBOfKP sj+bWb7jwdrkqVgQecwISkUAxGB9IC8/FMwIi9w= X-Received: by 2002:a17:903:2306:b0:1cc:3fc9:1802 with SMTP id d6-20020a170903230600b001cc3fc91802mr11885379plh.61.1698888856753; Wed, 01 Nov 2023 18:34:16 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 69/88] target/hppa: Implement PERMH Date: Wed, 1 Nov 2023 18:29:57 -0700 Message-Id: <20231102013016.369010-70-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/insns.decode | 2 ++ target/hppa/translate.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 22ec07f892..19e537df24 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -238,6 +238,8 @@ mixh_r 111110 ..... ..... 1 10 00100000 ..... @rrr mixw_l 111110 ..... ..... 1 00 00000000 ..... @rrr mixw_r 111110 ..... ..... 1 10 00000000 ..... @rrr +permh 111110 r1:5 r2:5 0 c0:2 0 c1:2 c2:2 c3:2 0 t:5 + #### # Index Mem #### diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 47ca71e2a3..36653486fb 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2946,6 +2946,35 @@ static bool trans_mixw_r(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_mixw_r); } +static bool trans_permh(DisasContext *ctx, arg_permh *a) +{ + TCGv_i64 r, t0, t1, t2, t3; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r = load_gpr(ctx, a->r1); + t0 = tcg_temp_new_i64(); + t1 = tcg_temp_new_i64(); + t2 = tcg_temp_new_i64(); + t3 = tcg_temp_new_i64(); + + tcg_gen_extract_i64(t0, r, (3 - a->c0) * 16, 16); + tcg_gen_extract_i64(t1, r, (3 - a->c1) * 16, 16); + tcg_gen_extract_i64(t2, r, (3 - a->c2) * 16, 16); + tcg_gen_extract_i64(t3, r, (3 - a->c3) * 16, 16); + + tcg_gen_deposit_i64(t0, t1, t0, 16, 48); + tcg_gen_deposit_i64(t2, t3, t2, 16, 48); + tcg_gen_deposit_i64(t0, t2, t0, 32, 32); + + save_gpr(ctx, a->t, t0); + return nullify_end(ctx); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Thu Nov 2 01:29:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740424 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp598546wrv; Wed, 1 Nov 2023 18:51:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEuqPsKKYVseBnM9S5NPHGyf+pWteukQVeXazt4xnGX30c4u2EybtIznksXZfUxj+1uSyYQ X-Received: by 2002:ad4:5943:0:b0:66d:9d71:9b28 with SMTP id eo3-20020ad45943000000b0066d9d719b28mr20068676qvb.11.1698889869740; Wed, 01 Nov 2023 18:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889869; cv=none; d=google.com; s=arc-20160816; b=es/iS8oNMDsBpJGhbOSis33uj3ptZ7CJHFp2PYBK82g51VM+nxi8gZHg8P8c35jN6w jyZ7lsMSScnwX3wHJKIQwdDsAaRYyYzCp5yz1+BaYru+xURXpYOZxpQI+s2lYziPhpo1 YYAnM1bjEFHe7Z25zOaiG+ugGBG9k6xLQFxH22tn/g1P7i+iqGsqnAx91tBi2ItuyL2e 7jYo+kZyJYnIEjdLkBfzKgGx2c0xmXVN1b6cihpBJNWOoAL5D9DbazoXbnp0JtQEc42z BYk4VDnnabjDmz/ZD8EPeXmstlbQ2XFQMfQ+xVky9Cmz0HNO/k+bLtHnZ8PZee0bsoJZ r59A== 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=zVaSUdm8wIzLLsLpBUjpNJYI2RdNW+CR3uBhuw+VEbI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Pm8WVHpoxy8X6MUxKmb614hGOqF+rC+azZlFMsYz3fCVL8DxmujUVlSjC5+V0om+mC brKPKkh3DTzeXN2FI2A2pEJd6Q57gitDpoO58wa+m6xhzUrJVrQUc9xTNXxQX3WKBRoc d4noDUc04uMtI8r3zxJjmjkrK2g3lZL/MjoXSo3PDamrz8omJTEamahXDeSWnUqhJAdk JqngPenifJJ502lofFvZlFcmBM7kHFDIYnrLuJ45jKj0WCPftyz252ojHt9ONsJX0LLy kjrKtcJxB+Alx+Q0OifCXi6jjiGv+YbWcnAg+0M1i68nox0yFtgHKHlBgG43l9soOG57 NFEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SrvU+cWS; 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 bu12-20020ad455ec000000b0065af2299bafsi3573185qvb.276.2023.11.01.18.51.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:51:09 -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=SrvU+cWS; 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 1qyMca-00006i-Cv; Wed, 01 Nov 2023 21:35:44 -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 1qyMbG-0006cA-3g for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:23 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbC-00026J-Ot for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:20 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cc3bc5df96so3138395ad.2 for ; Wed, 01 Nov 2023 18:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888857; x=1699493657; 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=zVaSUdm8wIzLLsLpBUjpNJYI2RdNW+CR3uBhuw+VEbI=; b=SrvU+cWSKj9/E1VZzglxJpvxuawlo4YLOlL9v1ig8rLk33u8H0M1eXQ4zNqGJIwSnv Je0+sPfFZ2capC3e6fnS6K6aDl4zZvPT+VLC+m6O5dx8aMvlReW0xctxzPqn7VXNpII1 Z6kxNI5FkZB6tWSzdmYitTrEthpGOcUA1zGuJb6yfq985EYboxXJ1stPDzvo/VeX8Acn mzSK6uBgw8JY9ehvKrlh0L1HcZ0n9wf4i2dA6shSl4aGywM33Y+PZuOjetwm+U3Erztp Yv8gACupmwSCRhJ/m/o4gEfLcgJezi2aQ43NNO/M1mKF9Ic51FrBSffS2FDP5m5j5wj3 sFVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888857; x=1699493657; 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=zVaSUdm8wIzLLsLpBUjpNJYI2RdNW+CR3uBhuw+VEbI=; b=Qd/D16+7OF+Y1oNBy94DnAxi68ipUDPQHBwVUBLuK3rs9ZnAS7vvBkdlbTn4BmtdGe r3KsVt+9UTibCjm4l1fK4aw8ZESULUamPO3yWKm4N/ItOQ4HSIsoyj/qwsQiyB3vOLjp +ogt5O9ZgJAQMB9DwYBbCrso2zq8jytcX1SoXL2GbOKfiksGTBQc1rdAc3c39QpC0EzF 4W8FwXlD/7dh2n2/+hxYVEWoxrVnoZfZBob3BZCIBoQHO1wixuk9UipSHvQeunlDwEIM W27FkfY6DiXwN6v/igsStH1X/XDhCN9RGx0i8g1zpRtzlh5Jmm6STNrdA2HJytK2ToLc 6UdQ== X-Gm-Message-State: AOJu0YxiKBqBuaYxq2jq0QtLIGCXii95R2yzt9MyAaj0WRI6K8HEKG+9 pm+tCO/h6UAREMomCe3fLaqwOBGx/GHGIAFTcNs= X-Received: by 2002:a17:902:bf41:b0:1cc:2095:b90 with SMTP id u1-20020a170902bf4100b001cc20950b90mr13002747pls.55.1698888857559; Wed, 01 Nov 2023 18:34:17 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 70/88] target/hppa: Fix interruption based on default PSW Date: Wed, 1 Nov 2023 18:29:58 -0700 Message-Id: <20231102013016.369010-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller The default PSW is set by the operating system with the PDC_PSW firmware call. Use that setting to decide if wide mode is to be enabled for interruptions and EIRR usage. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 2 ++ target/hppa/int_helper.c | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index ea676ba062..ea8e7e99a4 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -137,6 +137,8 @@ #define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */ #define CR_RC 0 +#define CR_PSW_DEFAULT 6 /* see SeaBIOS PDC_PSW firmware call */ +#define PDC_PSW_WIDE_BIT 2 #define CR_PID1 8 #define CR_PID2 9 #define CR_PID3 12 diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index f355c4c76b..a11d607b31 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -52,9 +52,17 @@ static void io_eir_write(void *opaque, hwaddr addr, uint64_t data, unsigned size) { HPPACPU *cpu = opaque; - int le_bit = ~data & 31; + CPUHPPAState *env = &cpu->env; + int widthm1 = 31; + int le_bit; - cpu->env.cr[CR_EIRR] |= (target_ulong)1 << le_bit; + /* The default PSW.W controls the width of EIRR. */ + if (hppa_is_pa20(env) && env->cr[CR_PSW_DEFAULT] & PDC_PSW_WIDE_BIT) { + widthm1 = 63; + } + le_bit = ~data & widthm1; + + env->cr[CR_EIRR] |= 1ull << le_bit; eval_interrupt(cpu); } @@ -104,8 +112,10 @@ void hppa_cpu_do_interrupt(CPUState *cs) /* step 1 */ env->cr[CR_IPSW] = old_psw = cpu_hppa_get_psw(env); - /* step 2 -- note PSW_W == 0 for !HPPA64. */ - cpu_hppa_put_psw(env, PSW_W | (i == EXCP_HPMC ? PSW_M : 0)); + /* step 2 -- Note PSW_W is masked out again for pa1.x */ + cpu_hppa_put_psw(env, + (env->cr[CR_PSW_DEFAULT] & PDC_PSW_WIDE_BIT ? PSW_W : 0) | + (i == EXCP_HPMC ? PSW_M : 0)); /* step 3 */ env->cr[CR_IIASQ] = iasq_f >> 32; From patchwork Thu Nov 2 01:29:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740399 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596264wrv; Wed, 1 Nov 2023 18:42:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMEhH3QMJQ6r7zUlKjGSLCeQVJ0n1lsc3eGUukniNuPRbuaxwridMoEadXbxLipv2zYyg3 X-Received: by 2002:a05:622a:d2:b0:41c:e76e:87f8 with SMTP id p18-20020a05622a00d200b0041ce76e87f8mr20699187qtw.34.1698889334224; Wed, 01 Nov 2023 18:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889334; cv=none; d=google.com; s=arc-20160816; b=Np9YXgjgU+wl02+rDzmzphVwtywkKP6iv+MlU3iEW2nQNu8bd7j7Gokm/NXddEAfkX eg7cQIDdGtyh4PM86AkGOGFkZFWb73kRNeDJCAwTe+O06hTkzccV+PBs8Xrt8Ytnh7J8 0njbmtnsTsEwg+Asm2/GIa+n2hqiDNR/NL144ZX3BECgpi+jnF+2+Xq3BCZ2Aw06YsVR qoICuCPot7nJn7QNegFtR53kE5Z5QZnQp75iDepkTUQzLGM94hv3qIJezautiMaYdp3S U4bADWDVTZ0+QOlQI85NJaMQZNwgG6cT+zkuoSSX/ERwBTWFg6Rf8bcmJhbJpAVnp6QJ 3Cfw== 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=Ifv9SSAPN+ChQ5diIn47KGLE/FuvesYppuuoVucSBEM=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=s963LI4+JOkEndJfaU3azsh8/el03bU2hCjPkZo+rwbpdGiz4otJLvZEsVjdVIoej/ yR41WRe0K5xc4iTLBMn1MhjdWJp+84jzMnoXpdufNbyLxWfZQt0Qvru56giDiH/+/WkN 8xxhoNXWz62X8i2uRZMyZ94j2T8zb2Venm49ThUS5WiVXrSeFt+d/HRn11eP5iRrbjxu k7yxq1qP/SoBX9/rHAX8kT/4nPpoKiqbnQ7Y5YrVcw8ZYZVUz81wKNf5kGstczgCtznN BAX8PNo1jpwd+2/9/DdUQFeCPO2nM3lOxqaZ56xLalhOQaCRCDW6lhC8rh/6Ibnid8ty 1jZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pMclFrQq; 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 d8-20020ac85ac8000000b0041b77a08f01si3520039qtd.394.2023.11.01.18.42.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42: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=pMclFrQq; 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 1qyMbs-000786-C8; Wed, 01 Nov 2023 21:35:01 -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 1qyMbG-0006cU-LK for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:23 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbD-00027m-DR for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:21 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1c9b95943beso3341945ad.1 for ; Wed, 01 Nov 2023 18:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888858; x=1699493658; 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=Ifv9SSAPN+ChQ5diIn47KGLE/FuvesYppuuoVucSBEM=; b=pMclFrQqUFyyXU2qAFI6YHiX8UsUUdFkSYA/qP1zaXey5NjZb5QmkLA0DYgzWwApyu Cq8k5rtpAjpdEwdjj+FOIZVOlhlRANahJiaFpSJoRnrF9V2U0tgxjTusYOtJSwO4GyS9 vu9LEurGISWzAaGmR7rUybT6kBln2yc9bUmHiceOVSpq35XysIzgp56aOz/waMOXzUpv FGbcrnp6yRNV3upl+9Zw7zVbhN/7595moDU3KyR3/1S2uY6lBrpxlRQFUDeG8kHwSAZp kBUpHqC2AYPLZAqH05Lli1pDXv+MRR+5oa56+pSRQacEgsmasp+vYEtV2O9j8XPT01/e ZcLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888858; x=1699493658; 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=Ifv9SSAPN+ChQ5diIn47KGLE/FuvesYppuuoVucSBEM=; b=DINihHT5Rb73p4PKT8bJmf9O9Az3PRVoTljBnM1ODo6PbkNb4XlaolJ6XjiHtRT6hN bS1a482E0p7TA8rrYj6N3XE11YCgbLbnhB64PeV0TKl74tx0GEHbB+ZHjFYp/Krv2GW2 6AzQi0zqb97ytwJzeF/Fn7NdOVCnoPzRBc+4xxsqywJbdODU1gRh43NXfFPGMpQPCap8 S2Jn8dWaHmdX38z0XnP09QVB4QuPSiCHZDemo1gyFrxf3JFyoo2rq0nNr99F7tY8FC7z rV6kcifRsacSfLcMLzmnzawftcDg9V7YxBbXErg99/PLixQqMP866oXVYanwKjs/lde7 oR4A== X-Gm-Message-State: AOJu0YydsPUkyHgV8nuMq+KUbppOdbB70yGMll1z1c++BgYq1zXSHn72 Ao3nBEiul5wjPN6E49ywjRp9/S5MoHwQh+jC04I= X-Received: by 2002:a17:902:e805:b0:1cc:482c:bc46 with SMTP id u5-20020a170902e80500b001cc482cbc46mr13328037plg.34.1698888858206; Wed, 01 Nov 2023 18:34:18 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 71/88] target/hppa: Precompute zero into DisasContext Date: Wed, 1 Nov 2023 18:29:59 -0700 Message-Id: <20231102013016.369010-72-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Reduce the number of times we look for the constant 0. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 36653486fb..5d780bcf56 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -53,6 +53,8 @@ typedef struct DisasContext { DisasCond null_cond; TCGLabel *null_lab; + TCGv_i64 zero; + uint32_t insn; uint32_t tb_flags; int mmu_idx; @@ -1017,14 +1019,13 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, } if (!is_l || cond_need_cb(c)) { - TCGv_i64 zero = tcg_constant_i64(0); cb_msb = tcg_temp_new_i64(); cb = tcg_temp_new_i64(); - tcg_gen_add2_i64(dest, cb_msb, in1, zero, in2, zero); + tcg_gen_add2_i64(dest, cb_msb, in1, ctx->zero, in2, ctx->zero); if (is_c) { tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, - get_psw_carry(ctx, d), zero); + get_psw_carry(ctx, d), ctx->zero); } tcg_gen_xor_i64(cb, in1, in2); tcg_gen_xor_i64(cb, cb, dest); @@ -1102,7 +1103,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, TCGv_i64 in2, bool is_tsv, bool is_b, bool is_tc, unsigned cf, bool d) { - TCGv_i64 dest, sv, cb, cb_msb, zero, tmp; + TCGv_i64 dest, sv, cb, cb_msb, tmp; unsigned c = cf >> 1; DisasCond cond; @@ -1110,12 +1111,12 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, cb = tcg_temp_new_i64(); cb_msb = tcg_temp_new_i64(); - zero = tcg_constant_i64(0); if (is_b) { /* DEST,C = IN1 + ~IN2 + C. */ tcg_gen_not_i64(cb, in2); - tcg_gen_add2_i64(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); - tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, cb, zero); + tcg_gen_add2_i64(dest, cb_msb, in1, ctx->zero, + get_psw_carry(ctx, d), ctx->zero); + tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, cb, ctx->zero); tcg_gen_xor_i64(cb, cb, in1); tcg_gen_xor_i64(cb, cb, dest); } else { @@ -1124,7 +1125,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, * operations by seeding the high word with 1 and subtracting. */ TCGv_i64 one = tcg_constant_i64(1); - tcg_gen_sub2_i64(dest, cb_msb, in1, one, in2, zero); + tcg_gen_sub2_i64(dest, cb_msb, in1, one, in2, ctx->zero); tcg_gen_eqv_i64(cb, in1, in2); tcg_gen_xor_i64(cb, cb, dest); } @@ -2458,7 +2459,7 @@ static bool trans_lci(DisasContext *ctx, arg_lci *a) physical address. Two addresses with the same CI have a coherent view of the cache. Our implementation is to return 0 for all, since the entire address space is coherent. */ - save_gpr(ctx, a->t, tcg_constant_i64(0)); + save_gpr(ctx, a->t, ctx->zero); cond_free(&ctx->null_cond); return true; @@ -2667,7 +2668,7 @@ static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf_d *a) static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) { - TCGv_i64 dest, add1, add2, addc, zero, in1, in2; + TCGv_i64 dest, add1, add2, addc, in1, in2; TCGv_i64 cout; nullify_over(ctx); @@ -2679,7 +2680,6 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) add2 = tcg_temp_new_i64(); addc = tcg_temp_new_i64(); dest = tcg_temp_new_i64(); - zero = tcg_constant_i64(0); /* Form R1 << 1 | PSW[CB]{8}. */ tcg_gen_add_i64(add1, in1, in1); @@ -2695,8 +2695,9 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) tcg_gen_xor_i64(add2, in2, addc); tcg_gen_andi_i64(addc, addc, 1); - tcg_gen_add2_i64(dest, cpu_psw_cb_msb, add1, zero, add2, zero); - tcg_gen_add2_i64(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, add1, ctx->zero, add2, ctx->zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, + addc, ctx->zero); /* Write back the result register. */ save_gpr(ctx, a->t, dest); @@ -2996,7 +2997,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a) static bool trans_ldc(DisasContext *ctx, arg_ldst *a) { MemOp mop = MO_TE | MO_ALIGN | a->size; - TCGv_i64 zero, dest, ofs; + TCGv_i64 dest, ofs; TCGv_i64 addr; if (!ctx->is_pa20 && a->size > MO_32) { @@ -3026,8 +3027,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) */ gen_helper_ldc_check(addr); - zero = tcg_constant_i64(0); - tcg_gen_atomic_xchg_i64(dest, addr, zero, ctx->mmu_idx, mop); + tcg_gen_atomic_xchg_i64(dest, addr, ctx->zero, ctx->mmu_idx, mop); if (a->m) { save_gpr(ctx, a->b, ofs); @@ -4380,6 +4380,8 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->iaoq_n = -1; ctx->iaoq_n_var = NULL; + ctx->zero = tcg_constant_i64(0); + /* Bound the number of instructions by those left on the page. */ bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; ctx->base.max_insns = MIN(ctx->base.max_insns, bound); From patchwork Thu Nov 2 01:30:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740396 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596217wrv; Wed, 1 Nov 2023 18:42:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYL91lKZsE4ww2fgfwa0CbF5LthuqM6hPjUBDwGOKBSNuvCprk1ePOD2trAWCe4J0jsQ+B X-Received: by 2002:a05:620a:454c:b0:76f:2899:3a96 with SMTP id u12-20020a05620a454c00b0076f28993a96mr20481349qkp.0.1698889324535; Wed, 01 Nov 2023 18:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889324; cv=none; d=google.com; s=arc-20160816; b=pM/nirYzN7f/EX69o4UOhgaAEWkf+4P4YoMBlb1i6cGI0yXLlhwvt+dOEpNqrs/co3 TaDe1RCU5vjyeKQPv7AE+JxoGH82zT/SC4Q5ccLDEFPiA0IS89BH+w0QIKpq0BHchpto 0ADjGt+57xxseOteszUDWfIMsPYPRYqtNpL6Dd+WeTQQfQrvVHWFesxMIFVGnfWIao3d oOym50Pp4qtiiiWZxD3LKs5T2WFvJppNh/xfXpkBhAdRz5Z5A72yfnkE5DlNe/7tF0qL NlVguTtR+AKJxJHaRvztshaDSW4d1cn436aKejAsINUqeLkD40zg2fhgE65QDlHPlMs5 rhLQ== 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=EAOg6fl3cxRolbZZTtfnbVT8Mh+MYrIU1+C7rjgT91E=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=RHw9c8RP0KzyTpAZYxddYFg08ib4rOyx28K/gK+edinYLLor9yHZfWMse6uPBLJc1W VkDSeadZgPqe4dHgtsNHijJ7xSwueBg7rFR7beyl7ZJE+XnhheC69J4jNxq18tDHQo+K zsonREeSIQdmHWYjTam/U1O4PQ3s7JhRc+NUnqPUrq/rjXQqS/wFkTE0EA9BnBzah95x jlxo3mIf4fBjB7RpcfTclYHOco8NQVDso7/g5JVHhMWs+q16HO7aaVD1DuKmaHHHcy03 BkvjiOwr/atogggcU4e+rAP9WN+Yifha58+FVMKPdEKo3KIzdVKCiP2boXxXjZDf7t7E JJqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E9zn6Oxe; 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 t24-20020a05620a0b1800b0077a3bd8821fsi3400376qkg.775.2023.11.01.18.42.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42:04 -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=E9zn6Oxe; 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 1qyMcY-0008IP-QE; Wed, 01 Nov 2023 21:35: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 1qyMbH-0006d2-Rj for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:25 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbE-00029p-31 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:22 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1cc2575dfc7so3239085ad.1 for ; Wed, 01 Nov 2023 18:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888859; x=1699493659; 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=EAOg6fl3cxRolbZZTtfnbVT8Mh+MYrIU1+C7rjgT91E=; b=E9zn6Oxe18XpepQhqcO9gQu0vwfgoLIAnmk2mX633XXsxW9s20q7fyeDDBu2Ftv3Wd e3Kaf2dCNc5BlLLolq2c/CqGu5Pw2b7A55PqIqo1LTmQ+xfgQZxQfyxtVvf3ibyqh7Uf l23N+pedhs/oiHcYfRvH10mTkR+GGj6RRQwvs41S9ghjS64jkCdGBNDkqvjIAgIlKIpv knV5bxQywvzzTDHMBBgFRZrcps3hJCgza7QQnwlA4k6cxClqcAqFTFvopPon0BJKwsVA djHYCFg/w5DJzA7nXmZ0cvVsULlozSV3g8yrPdsP03Pa6ecm04u59Sw6022LcWTVv+MC TtuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888859; x=1699493659; 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=EAOg6fl3cxRolbZZTtfnbVT8Mh+MYrIU1+C7rjgT91E=; b=XGyqsjiyJh9QX7ahyfujXcGf2c+0+6Yr8lDUBZo+Kovll28rxWZrAgRaOXMjXhDYRv kTaKh7UFXj1qjLMgRkeRM5tu6Fst5iuBMVykgCVoBvPWlncYG7UOT1btzMUUPIMJSdyu Ik1FEfz+R9rUKTGlH10t9kXb6nhVr7LgO0vqCKBVT57rfiZQyX0tAfnHnLCudmxltvVc VdULARIZpU1wzB9CZbGAS3FNuu9xz0ZZ930+g1bbBMBJQWk1ACHbL0qKCAdkdscME7RL v+JHXCS/hIp8fgui3xgVz45lSeIV2s5rCWvzYA2Hn7BXXpqiJxCGypRMSO3mFpc4Q5Vi W+5A== X-Gm-Message-State: AOJu0YxmAI0ugV1KMxVvMILLJqQvzjiPbyIMZBIo6oMK2v4quP/fv+Ct hSmNeBRd7Im78Ioz00L0f5tpiFuuFKjjqo29ezY= X-Received: by 2002:a17:903:44d:b0:1cc:87f8:96bc with SMTP id iw13-20020a170903044d00b001cc87f896bcmr414186plb.15.1698888858920; Wed, 01 Nov 2023 18:34:18 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 72/88] target/hppa: Return zero for r0 from load_gpr Date: Wed, 1 Nov 2023 18:30:00 -0700 Message-Id: <20231102013016.369010-73-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 5d780bcf56..3d8240ea7d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -307,9 +307,7 @@ static void cond_free(DisasCond *cond) static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_i64 t = tcg_temp_new_i64(); - tcg_gen_movi_i64(t, 0); - return t; + return ctx->zero; } else { return cpu_gr[reg]; } From patchwork Thu Nov 2 01:30:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740382 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595373wrv; Wed, 1 Nov 2023 18:38:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfdVbldRm8OV2R+6Y6w7qK/5XtgJrYOPmp2Tg9D+7LeeX0TpPcrA4TIKRfocpsdjbkPuqX X-Received: by 2002:a05:620a:1910:b0:775:da1a:67da with SMTP id bj16-20020a05620a191000b00775da1a67damr20280984qkb.53.1698889123913; Wed, 01 Nov 2023 18:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889123; cv=none; d=google.com; s=arc-20160816; b=RJCB/oQorLetuFLvWcCEfWqhDjGX+aeRNLDP4v8F2T5sWCu43e4pdD8ZRaPExuEReM mL+jGYQHpoBfmuTiAkho28t2QUHYTMIFJEhAtSICiojvLoT+qq2f6YOn088Bi1DfbXv2 2U+ZcQfbMatQ/vM9A0riRWSDDammWBUpAoT/ouFYtRAw24/z4ildJrijvIAkU/xQkDg/ Pi3qoCLQsl05HnQ0VCgp3v+6EcogU6Tj5kgkC4Xfd5zvwqLcVJyazgc2zyWB5T/gwuoY 5UhtttYZJhRmAm3+BDxK5fLYNRGJxDHyZ9CgBEZjBzr4ogqRq8MqyJJ1npDkwOKqCWpi QrWQ== 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=hkIbB3zmI08zQqo8JvI15EoPXprMPyQ2OgXzm/sTzaE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=doGOs78Ok+6K+EDEBp7xxTc4TpPKVAA//AH7CohFbdPK/pqKHy32al1CBPKsgl8EIg FOI8ViwqhQanFhqvTuyxJuUoioOSOgL+Jv9bzt053SkZJulYsTxg6VM+mGx6OQjy5D/Y kVM6/AV1mX1Sohz/uI4zC++NFrqZmMtFxO5NjdjRU9xhrCzJE9D6q6Rl/mDPUWkaPy7m htKzr7ifi2goHhm7sgFu7y1PyTok5xnYHD4wjLf5Ka7/8/TZ7qvfLmJZ+m8KbqjpLBow gQ+Fr4Z3yKV7tzeFHdZPPB6zg8a0FYhEqqizHhsm4v2a3rPB/YGxAzzd3yveONXOFvCU Gpow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A0ZLAK+U; 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 i1-20020a05620a248100b007789dcffd6fsi3707945qkn.312.2023.11.01.18.38.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:43 -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=A0ZLAK+U; 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 1qyMcR-0007qK-64; Wed, 01 Nov 2023 21:35:37 -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 1qyMbK-0006fK-0R for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:26 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbG-0002A3-CA for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:25 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-565334377d0so288822a12.2 for ; Wed, 01 Nov 2023 18:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888859; x=1699493659; 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=hkIbB3zmI08zQqo8JvI15EoPXprMPyQ2OgXzm/sTzaE=; b=A0ZLAK+UHvh6L8H/lWaTooEHX/xqRWgBgwcnRiKpwkpMbzmh/Gj05m9+TkGPgFSG2A JZB8rmLT0qVlHm69tekYMGXMLchFxZpufxm+fShXAoNBUwNPQrOtheg8sFfRqclYAbAG JenZuSsu2PJqAJLjwPnQ/mBqDofBSulzlJl3jDpQLa0rB7vsDoIApaf0cWv/gFUN+87/ O3YHMKnywei+1mcf7XMGhC61KtxdHZsKB27smTeTYJVEFnMelFnDxEQT+skG2Qw9sJxb 8mk0HSWGXkPsC0QxNQppwChkSe+2gLpH8ZInh/56Aq6GYmJhFkkCh+YdPvTAFjqbAbis Jv3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888859; x=1699493659; 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=hkIbB3zmI08zQqo8JvI15EoPXprMPyQ2OgXzm/sTzaE=; b=kgXBsddYSCFMuHfdi1in8zK4/NFO0cr6X/y1+KOW860XOkR3ZuyqJoL73oKKmdtiwQ 38s1LvpHUjeI7EKZiMOYOGDR3gEW8x6B/Ta8jtbgXBmCjGrs7WifjO6xIppCVwxTeS69 Fm4XkUho86f2WLwX4XRa6PmMnjHk54QDtulCSD5nSwFucwLSYRBTR/hfQ2bVERPmLZIl Q7cFRjF00+gIA04MOArusPwjt/2/HhuB75rDcVfQw3uZlo+KU/QICyIZcnZ7zyoQItlg /PzQbnjzoVcoVvKlV8cK9wEQPyDtMB6uJb33Jgf0SOR6mbTlBCaS+POqau2/mCeVX+0f +Y1Q== X-Gm-Message-State: AOJu0YwXKpms3S8KnbaSk79hsDTUvuIW+XXhybJFl3JwCUDGJdcQpAP1 K0WVA17HCwH0IxL0UVmB6rVtADvi5mvqvCs+d2M= X-Received: by 2002:a05:6a21:7782:b0:181:731:89b7 with SMTP id bd2-20020a056a21778200b00181073189b7mr7317173pzc.41.1698888859652; Wed, 01 Nov 2023 18:34:19 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 73/88] include/hw/elf: Remove truncating signed casts Date: Wed, 1 Nov 2023 18:30:01 -0700 Message-Id: <20231102013016.369010-74-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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, T_SCC_BODY_TEXT_LINE=-0.01 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 There's nothing about elf that specifically requires signed vs unsigned. This is very much a target-specific preference. In the meantime, casting low and high from uint64_t back to Elf_SWord to uint64_t discards high bits that might have been set by translate_fn. Signed-off-by: Richard Henderson --- include/hw/elf_ops.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index dffb0e73d2..0a5c258fe6 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -385,10 +385,11 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, } if (pflags) { - *pflags = (elf_word)ehdr.e_flags; + *pflags = ehdr.e_flags; + } + if (pentry) { + *pentry = ehdr.e_entry; } - if (pentry) - *pentry = (uint64_t)(elf_sword)ehdr.e_entry; glue(load_symbols, SZ)(&ehdr, fd, must_swab, clear_lsb, sym_cb); @@ -610,10 +611,12 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, } } - if (lowaddr) - *lowaddr = (uint64_t)(elf_sword)low; - if (highaddr) - *highaddr = (uint64_t)(elf_sword)high; + if (lowaddr) { + *lowaddr = low; + } + if (highaddr) { + *highaddr = high; + } ret = total_size; fail: if (mapped_file) { From patchwork Thu Nov 2 01:30: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: 740418 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597928wrv; Wed, 1 Nov 2023 18:48:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfqTVKLzCnFKfVxfGcRgE5RCeqRwxeXh5aD+a53mlx25fwc4l6vkm3fDG5jdesj80d+QVA X-Received: by 2002:a05:620a:1429:b0:77a:35f:61fc with SMTP id k9-20020a05620a142900b0077a035f61fcmr16578942qkj.24.1698889718719; Wed, 01 Nov 2023 18:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889718; cv=none; d=google.com; s=arc-20160816; b=PZ+o8gmsbPKZ2CGMTZ6TYkyXlcK1HN58xYeiHyLQWUdEZsDwh95ZnTM9KUNPDxyeos VsPaaD1mV+T3HEHki9Jz3CxPyRiBR6NQccTX8qPixkOQvgqhk7QKao5UPchkUd5IcfLK GZPWkPX27DCr0RAhhWBRgtrMB2x3LDzuyRq1KcUBDssi+zdG3gPPGPzpuNb+P/lWsT71 69z11zDnaaivWqFAzmxpMfthgP/gwswlEm9cj6CIu6YS4SYl8ydN3w2zBmmUvwDOpDdx VWa04zGErWESXVKdfCuTXXu07niNoa3h86NiTF6Lr7mH9IL5IQ+O57fdDavKOVJoJePI eBjw== 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=3YpfUmyUa6m05sFckuJpc1CvhipgVeCi72arXwnoozE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=CiZmHxiD9jd9RGbsnf1KZ+i8cxmnT6cKqQm/vpZq+5r+ta2r9bc+NwFOGt8zxjw5QV tco3Ooh7rZQIzb3n3Z+F0A8V3Nrun0wFa9uZr8yRguAmunihBeDCGuHli41H0stQKkUC HX7/ipjTdLtC00Pyd9XDentU16ZldXOv7qZaBWeyL+Q5vi2pgMEq20EMgXoxtLZmhOnu If9TbMt9vOVrgXuEaBPcGIvDhj02rp6Jj570W8uomLa3qzN5EWA1ivgvOnoCgEahqj/T oB8wP55WNOBc6E/+G4Hdt15j9bsoKMDMcGsphdv4sWoYFx+6fZWKsiP3AtW1u7qZ9am2 vU2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="At/ADStd"; 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 r12-20020a05620a298c00b0076dad09277asi2958611qkp.408.2023.11.01.18.48.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:48:38 -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="At/ADStd"; 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 1qyMcb-0000FO-Gl; Wed, 01 Nov 2023 21:35: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 1qyMbM-0006g6-1T for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:29 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbH-0002AK-C5 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:26 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1cc3542e328so3159985ad.1 for ; Wed, 01 Nov 2023 18:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888860; x=1699493660; 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=3YpfUmyUa6m05sFckuJpc1CvhipgVeCi72arXwnoozE=; b=At/ADStd1/6lPJRUV0kNVFFNT98YvsSnr1lMZa4nTLetAMhSgXoRHdlpAsR44va8xo qJyD7HjQE/HRzJe7SmYOSs5cMdP6TtXKAqOkklojNtZ/b833wJ5Ike5Al21pF3IrqruD iKrNMU8NyHm2VxmF/11v8nyGlNlEa1GQ2bFpNXR6656x62Bd1WF8MFg8OjOn1O2v9tid lmBrBalzzV+dQd29NtcBGPlNiRMCWJgqky/kfauuB4zwRXzefzdpwnkMjxwzBlCMnbrA NGHiwHPioFM3MGo7sWL9csn8jWaCOyLEOZmSdHgWMrUIDtsmE1+zSxO1FXrj2AOGY4FD zfDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888860; x=1699493660; 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=3YpfUmyUa6m05sFckuJpc1CvhipgVeCi72arXwnoozE=; b=svBE8Vi2VpH0WxLZFfT8tajLgKSKwOIhBGHSXVl+fCjQpURcl4GUTxa5QJLv94i3H4 uiOCPUPeVUIk7ftumdnoJd1pvLM94Hc3yjcBMFFR84jE8YZswlfI+TZfj/W/Rj+LQitg V+jJPIry8qh5smFskLr1mM2y/+xdgKhQ0epYnGT3LHhdJztO+0nN0kj1KOcdVhS1DVbv m74ZihNosxTxivtEL32tc772L3FpFzXLHXZaiTc9eJqlaWv7xKTpS2+k6MJPof1Bw/ZN uHrpsSZPog8GvMJoli0szAUqmLFneCX3RBz07b4bMipm1KosLGLT8gq+gq1hTfep83hI Prfg== X-Gm-Message-State: AOJu0YzTN+SrMWW7rhGZxz7zXL/NgiTz11s7U9xb9RAAOPrEUFz3FgzM j62EQhq3n0cjZDZI0Alkj7JbLeFmNUSVjZ6LXxM= X-Received: by 2002:a17:902:f093:b0:1cc:3932:4a95 with SMTP id p19-20020a170902f09300b001cc39324a95mr8389998pla.62.1698888860459; Wed, 01 Nov 2023 18:34:20 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 74/88] hw/hppa: Translate phys addresses for the cpu Date: Wed, 1 Nov 2023 18:30:02 -0700 Message-Id: <20231102013016.369010-75-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Hack the machine to use pa2.0 physical layout when required, using the PSW.W=0 absolute to physical mapping. Signed-off-by: Richard Henderson --- hw/hppa/machine.c | 117 ++++++++++++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 46 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 1f09b4b490..43c7afb89d 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -87,7 +87,7 @@ static const MemoryRegionOps hppa_pci_ignore_ops = { }, }; -static ISABus *hppa_isa_bus(void) +static ISABus *hppa_isa_bus(hwaddr addr) { ISABus *isa_bus; qemu_irq *isa_irqs; @@ -96,8 +96,7 @@ static ISABus *hppa_isa_bus(void) isa_region = g_new(MemoryRegion, 1); memory_region_init_io(isa_region, NULL, &hppa_pci_ignore_ops, NULL, "isa-io", 0x800); - memory_region_add_subregion(get_system_memory(), IDE_HPA, - isa_region); + memory_region_add_subregion(get_system_memory(), addr, isa_region); isa_bus = isa_bus_new(NULL, get_system_memory(), isa_region, &error_abort); @@ -163,13 +162,24 @@ static const MemoryRegionOps hppa_io_helper_ops = { }, }; +typedef uint64_t TranslateFn(void *opaque, uint64_t addr); -static uint64_t cpu_hppa_to_phys(void *opaque, uint64_t addr) +static uint64_t linux_kernel_virt_to_phys(void *opaque, uint64_t addr) { addr &= (0x10000000 - 1); return addr; } +static uint64_t translate_pa10(void *dummy, uint64_t addr) +{ + return (uint32_t)addr; +} + +static uint64_t translate_pa20(void *dummy, uint64_t addr) +{ + return hppa_abs_to_phys_pa2_w0(addr); +} + static HPPACPU *cpu[HPPA_MAX_CPUS]; static uint64_t firmware_entry; @@ -179,7 +189,8 @@ static void fw_cfg_boot_set(void *opaque, const char *boot_device, fw_cfg_modify_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]); } -static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) +static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus, + hwaddr addr) { FWCfgState *fw_cfg; uint64_t val; @@ -188,7 +199,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) int btlb_entries = HPPA_BTLB_ENTRIES(&cpu[0]->env); int len; - fw_cfg = fw_cfg_init_mem(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4); + fw_cfg = fw_cfg_init_mem(addr, addr + 4); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size); @@ -258,32 +269,45 @@ static DinoState *dino_init(MemoryRegion *addr_space) /* * Step 1: Create CPUs and Memory */ -static void machine_HP_common_init_cpus(MachineState *machine) +static TranslateFn *machine_HP_common_init_cpus(MachineState *machine) { MemoryRegion *addr_space = get_system_memory(); - MemoryRegion *cpu_region; - long i; unsigned int smp_cpus = machine->smp.cpus; - char *name; + TranslateFn *translate; + MemoryRegion *cpu_region; /* Create CPUs. */ - for (i = 0; i < smp_cpus; i++) { - name = g_strdup_printf("cpu%ld-io-eir", i); + for (unsigned int i = 0; i < smp_cpus; i++) { cpu[i] = HPPA_CPU(cpu_create(machine->cpu_type)); + } + + /* + * For now, treat address layout as if PSW_W is clear. + * TODO: create a proper hppa64 board model and load elf64 firmware. + */ + if (hppa_is_pa20(&cpu[0]->env)) { + translate = translate_pa20; + } else { + translate = translate_pa10; + } + + for (unsigned int i = 0; i < smp_cpus; i++) { + g_autofree char *name = g_strdup_printf("cpu%u-io-eir", i); cpu_region = g_new(MemoryRegion, 1); memory_region_init_io(cpu_region, OBJECT(cpu[i]), &hppa_io_eir_ops, cpu[i], name, 4); - memory_region_add_subregion(addr_space, CPU_HPA + i * 0x1000, + memory_region_add_subregion(addr_space, + translate(NULL, CPU_HPA + i * 0x1000), cpu_region); - g_free(name); } /* RTC and DebugOutputPort on CPU #0 */ cpu_region = g_new(MemoryRegion, 1); memory_region_init_io(cpu_region, OBJECT(cpu[0]), &hppa_io_helper_ops, cpu[0], "cpu0-io-rtc", 2 * sizeof(uint64_t)); - memory_region_add_subregion(addr_space, CPU_HPA + 16, cpu_region); + memory_region_add_subregion(addr_space, translate(NULL, CPU_HPA + 16), + cpu_region); /* Main memory region. */ if (machine->ram_size > 3 * GiB) { @@ -291,12 +315,15 @@ static void machine_HP_common_init_cpus(MachineState *machine) exit(EXIT_FAILURE); } memory_region_add_subregion_overlap(addr_space, 0, machine->ram, -1); + + return translate; } /* * Last creation step: Add SCSI discs, NICs, graphics & load firmware */ -static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) +static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, + TranslateFn *translate) { const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; @@ -324,13 +351,13 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) dev = qdev_new("artist"); s = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, LASI_GFX_HPA); - sysbus_mmio_map(s, 1, ARTIST_FB_ADDR); + sysbus_mmio_map(s, 0, translate(NULL, LASI_GFX_HPA)); + sysbus_mmio_map(s, 1, translate(NULL, ARTIST_FB_ADDR)); } /* Network setup. */ if (enable_lasi_lan()) { - lasi_82596_init(addr_space, LASI_LAN_HPA, + lasi_82596_init(addr_space, translate(NULL, LASI_LAN_HPA), qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA)); } @@ -374,7 +401,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) qemu_register_powerdown_notifier(&hppa_system_powerdown_notifier); /* fw_cfg configuration interface */ - create_fw_cfg(machine, pci_bus); + create_fw_cfg(machine, pci_bus, translate(NULL, FW_CFG_IO_BASE)); /* Load firmware. Given that this is not "real" firmware, but one explicitly written for the emulation, we might as @@ -386,15 +413,10 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) exit(1); } - size = load_elf(firmware_filename, NULL, NULL, NULL, + size = load_elf(firmware_filename, NULL, translate, NULL, &firmware_entry, &firmware_low, &firmware_high, NULL, true, EM_PARISC, 0, 0); - /* Unfortunately, load_elf sign-extends reading elf32. */ - firmware_entry = (uint32_t)firmware_entry; - firmware_low = (uint32_t)firmware_low; - firmware_high = (uint32_t)firmware_high; - if (size < 0) { error_report("could not load firmware '%s'", firmware_filename); exit(1); @@ -402,7 +424,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) qemu_log_mask(CPU_LOG_PAGE, "Firmware loaded at 0x%08" PRIx64 "-0x%08" PRIx64 ", entry at 0x%08" PRIx64 ".\n", firmware_low, firmware_high, firmware_entry); - if (firmware_low < FIRMWARE_START || firmware_high >= FIRMWARE_END) { + if (firmware_low < translate(NULL, FIRMWARE_START) || + firmware_high >= translate(NULL, FIRMWARE_END)) { error_report("Firmware overlaps with memory or IO space"); exit(1); } @@ -411,18 +434,16 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) rom_region = g_new(MemoryRegion, 1); memory_region_init_ram(rom_region, NULL, "firmware", (FIRMWARE_END - FIRMWARE_START), &error_fatal); - memory_region_add_subregion(addr_space, FIRMWARE_START, rom_region); + memory_region_add_subregion(addr_space, + translate(NULL, FIRMWARE_START), rom_region); /* Load kernel */ if (kernel_filename) { - size = load_elf(kernel_filename, NULL, &cpu_hppa_to_phys, + size = load_elf(kernel_filename, NULL, linux_kernel_virt_to_phys, NULL, &kernel_entry, &kernel_low, &kernel_high, NULL, true, EM_PARISC, 0, 0); - /* Unfortunately, load_elf sign-extends reading elf32. */ - kernel_entry = (uint32_t) cpu_hppa_to_phys(NULL, kernel_entry); - kernel_low = (uint32_t)kernel_low; - kernel_high = (uint32_t)kernel_high; + kernel_entry = linux_kernel_virt_to_phys(NULL, kernel_entry); if (size < 0) { error_report("could not load kernel '%s'", kernel_filename); @@ -500,41 +521,42 @@ static void machine_HP_B160L_init(MachineState *machine) { DeviceState *dev, *dino_dev; MemoryRegion *addr_space = get_system_memory(); + TranslateFn *translate; ISABus *isa_bus; PCIBus *pci_bus; /* Create CPUs and RAM. */ - machine_HP_common_init_cpus(machine); + translate = machine_HP_common_init_cpus(machine); /* Init Lasi chip */ lasi_dev = DEVICE(lasi_init()); - memory_region_add_subregion(addr_space, LASI_HPA, + memory_region_add_subregion(addr_space, translate(NULL, LASI_HPA), sysbus_mmio_get_region( SYS_BUS_DEVICE(lasi_dev), 0)); /* Init Dino (PCI host bus chip). */ dino_dev = DEVICE(dino_init(addr_space)); - memory_region_add_subregion(addr_space, DINO_HPA, + memory_region_add_subregion(addr_space, translate(NULL, DINO_HPA), sysbus_mmio_get_region( SYS_BUS_DEVICE(dino_dev), 0)); pci_bus = PCI_BUS(qdev_get_child_bus(dino_dev, "pci")); assert(pci_bus); /* Create ISA bus, needed for PS/2 kbd/mouse port emulation */ - isa_bus = hppa_isa_bus(); + isa_bus = hppa_isa_bus(translate(NULL, IDE_HPA)); assert(isa_bus); /* Serial ports: Lasi and Dino use a 7.272727 MHz clock. */ - serial_mm_init(addr_space, LASI_UART_HPA + 0x800, 0, + serial_mm_init(addr_space, translate(NULL, LASI_UART_HPA + 0x800), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_UART_HPA), 7272727 / 16, serial_hd(0), DEVICE_BIG_ENDIAN); - serial_mm_init(addr_space, DINO_UART_HPA + 0x800, 0, + serial_mm_init(addr_space, translate(NULL, DINO_UART_HPA + 0x800), 0, qdev_get_gpio_in(dino_dev, DINO_IRQ_RS232INT), 7272727 / 16, serial_hd(1), DEVICE_BIG_ENDIAN); /* Parallel port */ - parallel_mm_init(addr_space, LASI_LPT_HPA + 0x800, 0, + parallel_mm_init(addr_space, translate(NULL, LASI_LPT_HPA + 0x800), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA), parallel_hds[0]); @@ -543,15 +565,17 @@ static void machine_HP_B160L_init(MachineState *machine) sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA)); - memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA, + memory_region_add_subregion(addr_space, + translate(NULL, LASI_PS2KBD_HPA), sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0)); - memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA + 0x100, + memory_region_add_subregion(addr_space, + translate(NULL, LASI_PS2KBD_HPA + 0x100), sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1)); /* Add SCSI discs, NICs, graphics & load firmware */ - machine_HP_common_init_tail(machine, pci_bus); + machine_HP_common_init_tail(machine, pci_bus, translate); } static AstroState *astro_init(void) @@ -573,21 +597,22 @@ static void machine_HP_C3700_init(MachineState *machine) AstroState *astro; DeviceState *astro_dev; MemoryRegion *addr_space = get_system_memory(); + TranslateFn *translate; /* Create CPUs and RAM. */ - machine_HP_common_init_cpus(machine); + translate = machine_HP_common_init_cpus(machine); /* Init Astro and the Elroys (PCI host bus chips). */ astro = astro_init(); astro_dev = DEVICE(astro); - memory_region_add_subregion(addr_space, ASTRO_HPA, + memory_region_add_subregion(addr_space, translate(NULL, ASTRO_HPA), sysbus_mmio_get_region( SYS_BUS_DEVICE(astro_dev), 0)); pci_bus = PCI_BUS(qdev_get_child_bus(DEVICE(astro->elroy[0]), "pci")); assert(pci_bus); /* Add SCSI discs, NICs, graphics & load firmware */ - machine_HP_common_init_tail(machine, pci_bus); + machine_HP_common_init_tail(machine, pci_bus, translate); } static void hppa_machine_reset(MachineState *ms, ShutdownCause reason) From patchwork Thu Nov 2 01:30: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: 740379 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595320wrv; Wed, 1 Nov 2023 18:38:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0SgNME2X/Qdq8FyROsQR450wtF0bwpblDz9kBJque2N7qtpl0hPwUgtG5to5J58TdJmC5 X-Received: by 2002:a05:620a:408c:b0:770:f346:e9e8 with SMTP id f12-20020a05620a408c00b00770f346e9e8mr19447254qko.10.1698889111798; Wed, 01 Nov 2023 18:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889111; cv=none; d=google.com; s=arc-20160816; b=utafZ5zh1YInjyPsQXrXn0YddqY+zN9SEv3EE5cDzZuqRgZ3PMbboK0quNiNtf7TGE T9lIrpI6jmcK+hUfux3i6ttkUYviSafO1skrUOCmbVJyBUVEk3xUlR+a0UJse9pzgYN+ cqRvCy6d6Xe9ffdJiF6YJwVtx/wsNRuWcMcQYcXxj7pdS5DjWZ/6fj1TTRwykL8TzVW2 n6rmccv5DBwdZ+4kVSqsXrYsUz3rPMXVWDsmdOFdY3vmaGiWgodryNyo6kTCAnD04sTp L3dFfuYNgeV7gZIsLCT3AuVhNCAiOpG7ibIg2ljmnK1Z++8zgO377K3Umvf/ms8Hm5D0 7jmQ== 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=hES6yVQ0/11qdrvyqhHvx3Mqj7cvamUGm715KS/hVjU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=LzlUAk+uvQtLrgYfpxS4y+zJrOEi0aLXFDjT6Vp1M7i+zxKL0EBEgqS72Gybzw/7Uw /+QDMorCwY1lWiBzV9oHQxGRI4cs3PSw7G/DUEOpWqVYX1qeLWBBsuAEtWNnSOxJot+D ojet2bPbnLex3jwOeX8Wc5ju450InsgtLAsPaVQ71ef8L68KJCHfQwQCIShG0P4czhkp GODJ59QIOkbxGIEEY05cFaVxOdmN99Fp3WKsGRSrfBghBAWx+ABGNAg0F21mro6UGE8Q MoTH3c2hv7KSNUbTvijJypKfwX75K7GbpWlxpCHNZjj3uvMQ2o4VC0xYJUtW8QOuHLWJ oMOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NGqTch6w; 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 qy12-20020a05620a8bcc00b0076eee78a65asi3483059qkn.744.2023.11.01.18.38.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:31 -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=NGqTch6w; 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 1qyMcX-00087S-89; Wed, 01 Nov 2023 21:35:41 -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 1qyMbK-0006fI-0C for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:26 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbG-0002AN-EZ for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:24 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b3c2607d9bso475030b3a.1 for ; Wed, 01 Nov 2023 18:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888861; x=1699493661; 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=hES6yVQ0/11qdrvyqhHvx3Mqj7cvamUGm715KS/hVjU=; b=NGqTch6wuRH+AzUY4mbTETsgw9Y9cQKvDXBiPLIrwRJajsk9sAxcVs2Klr/7HYGTjk fgP3bCE3qohElocxBIhihlbLm0gRL/lwW1tlCCkwRxwZmKe9alyRh5CEEaucPp7ZnzTx blQQOf0qwfAzVht5qtgMVTeYwE+vwTVzOFsiGt8nbKZ3y0/w+DvRcxl5zbz0/WU96PqM Ph6lbTSodlGKRv4x3YfNVY7aHSndAce1rIJdSxzoAzdF8ktNtblWUqWiAHS82pxJA3Nw l8a38j0jj8r5D1wpf0BvkgRwTWtHYPCuu0RTHGzDFD704evFyBPdr226AAJY19g7YfO+ OzBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888861; x=1699493661; 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=hES6yVQ0/11qdrvyqhHvx3Mqj7cvamUGm715KS/hVjU=; b=oKQ+U8EgoFu/Wt15RpGByyV+tuqwG58rElPPDN/CDd7VriaVJCLid4nf/OhnK3OzUr PFkJOL7yq9T9bsOMStihyV0z23MHMjfRLBOXPYkbDQRcTt0o8k1kSZ23DtTuaPJ9uRU+ BK4TJVraD5hxZRwXV3kSdUUjAUZxPuc9BNtOYoD/Vdyz5nIg6K8DUIpEB7U8v2CY8DJB Pxwzsj/ifCLFoPjIP5UQRSDnwB6BLIK5yjrljlBSaAYu/2UpYvKG5XneMeBCssYadQyK Vw4iyJlz/6dUnr9duj0hyrB4jtMcSHuIke+o9HZ044rP77FCiIfXA/4XDX6PWIlU9LT8 lwPw== X-Gm-Message-State: AOJu0Yxefz1ofQUlkfdjD4W2BninTK6xUd7kcJP84xA8uUFeEWcwhX7Q TjwiJC94zN1lSWTb83hBWTAR8Yj4HQ8a8lH0bH8= X-Received: by 2002:a05:6a20:258d:b0:152:be08:b013 with SMTP id k13-20020a056a20258d00b00152be08b013mr16926335pzd.42.1698888861157; Wed, 01 Nov 2023 18:34:21 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 75/88] linux-user/hppa: Drop EXCP_DUMP from handled exceptions Date: Wed, 1 Nov 2023 18:30:03 -0700 Message-Id: <20231102013016.369010-76-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 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 --- linux-user/hppa/cpu_loop.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 8ab1335106..d5232f37fe 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -147,12 +147,10 @@ void cpu_loop(CPUHPPAState *env) force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR, env->iaoq_f); break; case EXCP_ILL: - EXCP_DUMP(env, "qemu: EXCP_ILL exception %#x\n", trapnr); force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->iaoq_f); break; case EXCP_PRIV_OPR: /* check for glibc ABORT_INSTRUCTION "iitlbp %r0,(%sr0, %r0)" */ - EXCP_DUMP(env, "qemu: EXCP_PRIV_OPR exception %#x\n", trapnr); if (env->cr[CR_IIR] == 0x04000000) { force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->iaoq_f); } else { @@ -160,7 +158,6 @@ void cpu_loop(CPUHPPAState *env) } break; case EXCP_PRIV_REG: - EXCP_DUMP(env, "qemu: EXCP_PRIV_REG exception %#x\n", trapnr); force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVREG, env->iaoq_f); break; case EXCP_OVERFLOW: @@ -173,7 +170,6 @@ void cpu_loop(CPUHPPAState *env) force_sig_fault(TARGET_SIGFPE, 0, env->iaoq_f); break; case EXCP_BREAK: - EXCP_DUMP(env, "qemu: EXCP_BREAK exception %#x\n", trapnr); force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->iaoq_f & ~3); break; case EXCP_DEBUG: From patchwork Thu Nov 2 01:30:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740404 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596954wrv; Wed, 1 Nov 2023 18:44:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsOXf7d7reY3p/dcy5wyb2TstiG6IsQjJVC11kqLNta8gQJjpzJxpL3uuBBj8ELYrRuTEi X-Received: by 2002:a05:622a:393:b0:41e:1674:5dd8 with SMTP id j19-20020a05622a039300b0041e16745dd8mr20402622qtx.48.1698889492103; Wed, 01 Nov 2023 18:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889492; cv=none; d=google.com; s=arc-20160816; b=q78W+DaFEDlrDprCCqiGS4QzlQ9Dm+Fl+9AkNLTrWSJptH8Sy5fwEJX2uZLIua8vkW Y9/ZFAxWDvak2DZeD2pBonsTfxsaLb4xfHyYdD5n6/fbmmbwdU88xLGV4TbsUBbWV8Qv Wjv6wdlacsb9uI7q6vjAhXu5D1zwt/VNV2AbaU2txGAfB0UJg28tfkmW15zkQ99kHRhE fcS6ytrmUlxyx/UufjJuNvk590xYfJkSYPCIgycqyBpgAHC+7EXeEb9d0l8b9A34DsSr 7aUcG008XGaOjNOn5C5+sMt6cnJxiVm8kpJPE9wiJFtI+zKfU7ZjhqljP9qj7aGsPKL8 eYOg== 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=hozauViA59+hLTL6ZLv3We/p27nrWdEmoLtLynuHCIg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ewNOvDd80FD4yH5KerZ2qeK2bZsZ8vs93N0FHnx0nt+J7dEZZX4y0mP2soznIscl+u xL52BpGjENMifTfnjpG0vqtcytiHbYFm93Olq7a9NwpAUU4Dc8ax7+kEu4itEC/iTMLz A3R572w73hzQwdQfQ7yaS2L5LDwI6dUt1Ac4DpDaSuXXMDQX4MYrpVxuA17utDW6dJ/L UpUhZ3rId+GvutESHwGWTdmft4QkK9JtEvZ2kCdiMgACP/RBmZ7pk3FwTW1SE9wSQzYb 6notmHv4zXTgwLU3YGwsnTz65L+8M/T4nXqiEC0Zqd105y5mcl7lG40/XH92YBpfqKp4 634Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BazxGFPb; 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 w8-20020ac857c8000000b00417b2074a0esi3479157qta.457.2023.11.01.18.44.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:44:52 -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=BazxGFPb; 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 1qyMco-0001GU-6B; Wed, 01 Nov 2023 21:35:58 -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 1qyMbM-0006gL-AB for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:29 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbH-0002Al-Tr for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:27 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6c115026985so503606b3a.1 for ; Wed, 01 Nov 2023 18:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888862; x=1699493662; 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=hozauViA59+hLTL6ZLv3We/p27nrWdEmoLtLynuHCIg=; b=BazxGFPbfaLRZKdGd8E362vt1Eq1QA6u7iwtLiRMS/HOsu34DkBvFgmSDyqVnC/f3+ 5KnTHcPT38H0XUAS3s/QhAKxN9bZJCyfgoI5OKxuZKQDOOq1E6yicTbHQHWmnBZAH/gW AAJ7mSqY+npZV2hWPpJ80BTtxFC63oNQVkXOvbPtLwChwd1G1RtPnF0W/450AieL2CMj P3nKaO2Rq9PNFodTOIHecVHMRuCWEVbTaOAyYi0J6N/8z+gFr0mxmBV66sKC5uBJDnQQ LiF3BuWbgnSptjyKEC2gTsqrv3nJnyIv646GL3uWSaGLbyOZolZBUyqzgNRrVXqybnU0 ld9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888862; x=1699493662; 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=hozauViA59+hLTL6ZLv3We/p27nrWdEmoLtLynuHCIg=; b=Zpr7dXdYiNKsLpSnMRFY/HGiT+fXrMjTZi5vNhv/oJ2SOR3aRPfZrshowT4TCD3flP KcCvxzBklYbqvjPI2UZyy9OHAUHB1n5/XI/yA+ZkzeZCvZENXcv6SMLxAU44MC66hFOp m6C9IbiRuuRhJN+yITs3WkzqrnwHZAK8dhd1rZHrtRMnzhpvnwJQhMtyV5LfrKzhwzcP z/gEVX6CDkY152Io2sc017BHJoBMQBqqFpQAgpO6VOgvENqmqgiuTO0YlBxY5Vg+aqLN qJnEdozQu9a1NPOVN0VepNdEq7iK2mDMIqYNnRqbjdxa8FrPFaG4IpNteDaFXrJmXZn+ vXdA== X-Gm-Message-State: AOJu0YxJQg5dVr0pP5DZfO7oazNfI7HIei9G0qtY7gRIexSeX7fVkBY1 zg5+NXNl45KLWZvlCPRd4T5MviT8vmAk+kXeFVA= X-Received: by 2002:a05:6a20:da95:b0:17b:426f:829 with SMTP id iy21-20020a056a20da9500b0017b426f0829mr23984689pzb.37.1698888861863; Wed, 01 Nov 2023 18:34:21 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 76/88] target/hppa: Implement pa2.0 data prefetch instructions Date: Wed, 1 Nov 2023 18:30:04 -0700 Message-Id: <20231102013016.369010-77-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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, T_SCC_BODY_TEXT_LINE=-0.01 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 These are aliased onto the normal integer loads to %g0. Since we don't emulate caches, prefetch is a nop. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3d8240ea7d..0883b146a9 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2976,7 +2976,15 @@ static bool trans_permh(DisasContext *ctx, arg_permh *a) static bool trans_ld(DisasContext *ctx, arg_ldst *a) { - if (!ctx->is_pa20 && a->size > MO_32) { + if (ctx->is_pa20) { + /* + * With pa20, LDB, LDH, LDW, LDD to %g0 are prefetches. + * Any base modification still occurs. + */ + if (a->t == 0) { + return trans_nop_addrx(ctx, a); + } + } else if (a->size > MO_32) { return gen_illegal(ctx); } return do_load(ctx, a->t, a->b, a->x, a->scale ? a->size : 0, From patchwork Thu Nov 2 01:30:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740389 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595743wrv; Wed, 1 Nov 2023 18:40:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFslfUg5BOGV3vtUfayjhIE6VCT63+HoafB9QvbVHiaTojNtubWPCXcGKvDlUPu8gHQ0ja X-Received: by 2002:a05:622a:1914:b0:418:1057:d835 with SMTP id w20-20020a05622a191400b004181057d835mr23900572qtc.34.1698889210863; Wed, 01 Nov 2023 18:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889210; cv=none; d=google.com; s=arc-20160816; b=yAirslm2CasrGwnt2aV9pByMRfrxdR6NfUq1pmbdSaFDXfBDpzmquetbf63VaZ7XVw 11WXOWjnAKTqMNXmIsglCwn0cHzuDxAAdn+R8i7TTF+bi+Z+mQxdsLRUKMd97Q3Ryaz1 pQD1ap08plrcceGTH0mmGUMehSQEHpBHlAErx0ChL+fjGTbSCOWbopH1rfUcsQ0L9bEE dx8xyG/lr2Y24o6ptnTLAaWcTydGiHP6MGgTzMLZXIbVkkPmiEV5nNmmVYfe98Rt0tg5 KJC/1CNivl8a70XYfnWDu4A+BAIzd4vLKImBTOQKnCutmv7iAxWrVbNedCU23+P4UqFm kAOA== 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=6DhUgnJx2bDPyCGWWiMXujGb/uA1mvQXQHcYK+Blx5U=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=MYVg/MeGPuZbBsRRnUnlYrblwUelUrwfsDKaYQXHzJRjlPYFb1UKwmWe6km3nKIcee WSr3DywujEWZ6u+Pl2dr+6v1NOa0mGYmM+6uBEvFxR3JajJaFBjru8m6oROPGb+8hunJ E8NMNx29ObOyFkkSUk97253YEmIqEm+N06Y5LqTX3AWs2zopShKlrnTHaqTdaL0vDJmS kWweG3nZGBiewXLW6oUc5sp6OG2++sVeejNMRmhAQxadyGErpPR1QZpAkzxcwPWl9FvR j/rNxBTNd53ux65cZVBfzvM7cpwBdD9kRViQmYZoDmWLaw17R+oxgJb6CT099TpdH1jg a8Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I5NYW8wB; 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 o19-20020a05622a009300b0041979aba2c8si3682416qtw.244.2023.11.01.18.40.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:40:10 -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=I5NYW8wB; 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 1qyMcW-000850-Rf; Wed, 01 Nov 2023 21:35:40 -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 1qyMbM-0006iB-Nh for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:30 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbJ-0002B2-LI for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:27 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cc7077d34aso3212445ad.2 for ; Wed, 01 Nov 2023 18:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888863; x=1699493663; 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=6DhUgnJx2bDPyCGWWiMXujGb/uA1mvQXQHcYK+Blx5U=; b=I5NYW8wBib7cTL4c7zkOBjcJ6jPxBqqA9o2xBIVD20y91m0mlWHHmfvDLjWF695tUd ZsR4VSIuGA6Nmf4l7gQRws9LuEZpEcsoJzU1DQVmo9dccWfvbBFVqnFIQb7quNP4jxx7 wf+1eTvHphQhHhsMdsq+zPD/cy5qu+TVimr6pAyMmLt79yuC97fqKkCuTB3YIa2wtLf4 z2qQxDKdzYa0hmDjysZk+Y51S6Z/XvdSDRWq3ideyxUds001TzIieS5mHv5aYMiNDFpL iI/aq1pgEgjZFERCtOLXStTWFM31hUbwpgBxhMR2F4L4WBrqAte8fttpjLZcGavAmnL2 GHzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888863; x=1699493663; 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=6DhUgnJx2bDPyCGWWiMXujGb/uA1mvQXQHcYK+Blx5U=; b=iCqN9XcfrrGqRBNb16W1E0VJP01iIrORHwi83a67YNHZUkQ3nUKf1GfDQWMqu7Q45u fpPqa6dDdDVY11cyZRL+KZ3I3j/1V3ap3ZrmU4yq9/uQfmapXZoPcXnDsLI/3nygm1wb ppymobhhMazisAyQV/vDDTZdBzKfbG0y1VZjU97+OqbB/hkpWyHf8ym4NjN5zE8jljZw oaaKK5nRuW7NMKDzE6/1zWwtTSm/YPwlJEEhRqUQEpSmLV8FNfxDI/de6w5cJsNLPzxZ TR8oAYN0jMK3osugCHP8id18OYOt5Isuelu6VPCYbrq6Twect9/C8L5+HJzF8j68ThM6 kWZw== X-Gm-Message-State: AOJu0Yx9Fk7S5ZvuUPM+7e8N1nSDGcVjXTX80dt9Jj9NIaBXHEHhEBjA V7kcQHBUpbis0fm+sr/FFkSXR3YdfGzH0rxwYEU= X-Received: by 2002:a17:902:d4c3:b0:1cc:5aef:f2d2 with SMTP id o3-20020a170902d4c300b001cc5aeff2d2mr9480172plg.60.1698888862712; Wed, 01 Nov 2023 18:34:22 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 77/88] target/hppa: Add pa2.0 cpu local tlb flushes Date: Wed, 1 Nov 2023 18:30:05 -0700 Message-Id: <20231102013016.369010-78-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller The previous decoding misnamed the bit it called "local". Other than the name, the implementation was correct for pa1.x. Rename this field to "tlbe". PA2.0 adds (a real) local bit to PxTLB, and also adds a range of pages to flush in GR[b]. Signed-off-by: Helge Deller Signed-off-by: Richard Henderson --- target/hppa/helper.h | 1 + target/hppa/insns.decode | 20 ++++++++++++++--- target/hppa/mem_helper.c | 26 ++++++++++++++++++---- target/hppa/translate.c | 48 +++++++++++++++++++++++++++++++++++----- target/hppa/trace-events | 1 + 5 files changed, 84 insertions(+), 12 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index c5f1db574b..c38539c76e 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -98,6 +98,7 @@ DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tl) DEF_HELPER_FLAGS_3(idtlbt_pa20, TCG_CALL_NO_RWG, void, env, tl, tl) DEF_HELPER_FLAGS_3(iitlbt_pa20, TCG_CALL_NO_RWG, void, env, tl, tl) DEF_HELPER_FLAGS_2(ptlb, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_2(ptlb_l, TCG_CALL_NO_RWG, void, env, tl) DEF_HELPER_FLAGS_1(ptlbe, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tl, env, tl) DEF_HELPER_FLAGS_1(change_prot_id, TCG_CALL_NO_RWG, void, env) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 19e537df24..f5a3f02fd1 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -161,9 +161,23 @@ ixtlbxf 000001 00000 r:5 00 0 data:1 01000 addr:1 0 00000 # pa2.0 tlb insert idtlbt and iitlbt instructions ixtlbt 000001 r2:5 r1:5 000 data:1 100000 0 00000 # idtlbt -pxtlbx 000001 b:5 x:5 sp:2 0100100 local:1 m:1 ----- data=1 -pxtlbx 000001 b:5 x:5 ... 000100 local:1 m:1 ----- \ - sp=%assemble_sr3x data=0 +# pdtlb, pitlb +pxtlb 000001 b:5 x:5 sp:2 01001000 m:1 ----- \ + &ldst disp=0 scale=0 size=0 t=0 +pxtlb 000001 b:5 x:5 ... 0001000 m:1 ----- \ + &ldst disp=0 scale=0 size=0 t=0 sp=%assemble_sr3x + +# ... pa20 local +pxtlb_l 000001 b:5 x:5 sp:2 01011000 m:1 ----- \ + &ldst disp=0 scale=0 size=0 t=0 +pxtlb_l 000001 b:5 x:5 ... 0011000 m:1 ----- \ + &ldst disp=0 scale=0 size=0 t=0 sp=%assemble_sr3x + +# pdtlbe, pitlbe +pxtlbe 000001 b:5 x:5 sp:2 01001001 m:1 ----- \ + &ldst disp=0 scale=0 size=0 t=0 +pxtlbe 000001 b:5 x:5 ... 0001001 m:1 ----- \ + &ldst disp=0 scale=0 size=0 t=0 sp=%assemble_sr3x lpa 000001 b:5 x:5 sp:2 01001101 m:1 t:5 \ &ldst disp=0 scale=0 size=0 diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 9be68b860b..7132ea221c 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -448,16 +448,34 @@ void HELPER(iitlbt_pa20)(CPUHPPAState *env, target_ulong r1, target_ulong r2) itlbt_pa20(env, r1, r2, va_b); } -/* Purge (Insn/Data) TLB. This is explicitly page-based, and is - synchronous across all processors. */ +/* Purge (Insn/Data) TLB. */ static void ptlb_work(CPUState *cpu, run_on_cpu_data data) { CPUHPPAState *env = cpu_env(cpu); - target_ulong addr = (target_ulong) data.target_ptr; + vaddr start = data.target_ptr; + vaddr end; - hppa_flush_tlb_range(env, addr, addr); + /* + * PA2.0 allows a range of pages encoded into GR[b], which we have + * copied into the bottom bits of the otherwise page-aligned address. + * PA1.x will always provide zero here, for a single page flush. + */ + end = start & 0xf; + start &= TARGET_PAGE_MASK; + end = TARGET_PAGE_SIZE << (2 * end); + end = start + end - 1; + + hppa_flush_tlb_range(env, start, end); } +/* This is local to the current cpu. */ +void HELPER(ptlb_l)(CPUHPPAState *env, target_ulong addr) +{ + trace_hppa_tlb_ptlb_local(env); + ptlb_work(env_cpu(env), RUN_ON_CPU_TARGET_PTR(addr)); +} + +/* This is synchronous across all processors. */ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) { CPUState *src = env_cpu(env); diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 0883b146a9..d9595c5c7c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2320,7 +2320,7 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) #endif } -static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) +static bool do_pxtlb(DisasContext *ctx, arg_ldst *a, bool local) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY @@ -2330,15 +2330,53 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) nullify_over(ctx); form_gva(ctx, &addr, &ofs, a->b, a->x, 0, 0, a->sp, a->m, false); - if (a->m) { - save_gpr(ctx, a->b, ofs); + + /* + * Page align now, rather than later, so that we can add in the + * page_size field from pa2.0 from the low 4 bits of GR[b]. + */ + tcg_gen_andi_i64(addr, addr, TARGET_PAGE_MASK); + if (ctx->is_pa20) { + tcg_gen_deposit_i64(addr, addr, load_gpr(ctx, a->b), 0, 4); } - if (a->local) { - gen_helper_ptlbe(tcg_env); + + if (local) { + gen_helper_ptlb_l(tcg_env, addr); } else { gen_helper_ptlb(tcg_env, addr); } + if (a->m) { + save_gpr(ctx, a->b, ofs); + } + + /* Exit TB for TLB change if mmu is enabled. */ + if (ctx->tb_flags & PSW_C) { + ctx->base.is_jmp = DISAS_IAQ_N_STALE; + } + return nullify_end(ctx); +#endif +} + +static bool trans_pxtlb(DisasContext *ctx, arg_ldst *a) +{ + return do_pxtlb(ctx, a, false); +} + +static bool trans_pxtlb_l(DisasContext *ctx, arg_ldst *a) +{ + return ctx->is_pa20 && do_pxtlb(ctx, a, true); +} + +static bool trans_pxtlbe(DisasContext *ctx, arg_ldst *a) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + nullify_over(ctx); + + trans_nop_addrx(ctx, a); + gen_helper_ptlbe(tcg_env); + /* Exit TB for TLB change if mmu is enabled. */ if (ctx->tb_flags & PSW_C) { ctx->base.is_jmp = DISAS_IAQ_N_STALE; diff --git a/target/hppa/trace-events b/target/hppa/trace-events index 8931517890..a10ba73d5d 100644 --- a/target/hppa/trace-events +++ b/target/hppa/trace-events @@ -10,6 +10,7 @@ disable hppa_tlb_fill_success(void *env, uint64_t addr, uint64_t phys, int size, disable hppa_tlb_itlba(void *env, void *ent, uint64_t va_b, uint64_t va_e, uint64_t pa) "env=%p ent=%p va_b=0x%lx va_e=0x%lx pa=0x%lx" disable hppa_tlb_itlbp(void *env, void *ent, int access_id, int u, int pl2, int pl1, int type, int b, int d, int t) "env=%p ent=%p access_id=%x u=%d pl2=%d pl1=%d type=%d b=%d d=%d t=%d" disable hppa_tlb_ptlb(void *env) "env=%p" +disable hppa_tlb_ptlb_local(void *env) "env=%p" disable hppa_tlb_ptlbe(void *env) "env=%p" disable hppa_tlb_lpa_success(void *env, uint64_t addr, uint64_t phys) "env=%p addr=0x%lx phys=0x%lx" disable hppa_tlb_lpa_failed(void *env, uint64_t addr) "env=%p addr=0x%lx" From patchwork Thu Nov 2 01:30:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740416 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597790wrv; Wed, 1 Nov 2023 18:48:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLSNzvbL4OyqbwYFRGkKRPdoBHGJKxJLxeU+26piyIB8yn8NvPmIXragLpBmEMI3aXyi8F X-Received: by 2002:a05:622a:208:b0:417:d600:115d with SMTP id b8-20020a05622a020800b00417d600115dmr19420945qtx.66.1698889686057; Wed, 01 Nov 2023 18:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889686; cv=none; d=google.com; s=arc-20160816; b=MkteC4YUSJ+ARElxCFqUNM+wseRLQb0V/aS0tBpIMbV4OFhP/70Zb1YLo/ArT+x0c+ gnQDw7CUrbEHmx1j4Ii74mntOaYSfENrq6E8/E9/sqrqT6rAiY/YG9PraeJZE3wK0F2V Y+d2G00MP5F72UfPiaaWurXh4n+/YNCpq0fGG6qpqFsRQ2iGQhkOFFaUJdbqVA0e+NSV pmeSQhXVT4QfKBfIj6AaOOmjdhNIYBclrvVd7WtMBNyQdz7wPUz0fkBT5aO7E2FFeViC 4b8AlPacvjyuBWD82hI12849SmTtR1ZWGTpoupTHPY5MNTVm975uXsh08aCdqKp1BDbc ANeA== 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=nPDrqyoPtn/P2Y3dlnz8L7OPFIA66GeNv3k0Fexkp9U=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=BAeUoLpUc5gXWFu6b15+zfNfvPyJi3aUrTSDQ9QU/fhwiWVMDfdd6mC2C5kTN5xSST U28ymbU8Oq+w3WGKQFeDrlgLWSjeIadszV3zqfDvERPzzFa0kgglV+g1P5Lxu0GoIXPv M/HfF/Dm68jOqm5oeWDKvAGqY/5JlQZsBe6v6iWKACrbSoFtvtU20GHrTHz6SAmoIuqa T1Bs4Zsm8yNmTx5dJgMrtAI6wRBt39QhMZjEr7KN3Vdkct+7ohbxmWPTeIVyQbddLeEt onnS9tyGfr1JfHpgZxfnNLCjXRJTDI87kySXMFYAitjZRUoYcakUJIoyi7iVJm3bWt60 /0mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hzS+e9Mc; 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 c13-20020a05622a058d00b00416547101b3si3618358qtb.720.2023.11.01.18.48.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:48:06 -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=hzS+e9Mc; 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 1qyMcc-0000S9-V0; Wed, 01 Nov 2023 21:35:48 -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 1qyMbN-0006iO-0U for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:30 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMbJ-0002BT-Na for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:27 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1cc68c1fac2so3495015ad.0 for ; Wed, 01 Nov 2023 18:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888863; x=1699493663; 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=nPDrqyoPtn/P2Y3dlnz8L7OPFIA66GeNv3k0Fexkp9U=; b=hzS+e9McjoBxmaeepjlz1ZtieXAgRPKC0fql+/Zjko+QfPWwIh2y6aLyeiIsJOSgAO vTZzyFYkczRklRzIDEZUFMmbQbOdeKTf8C5n9IxReDEn+s0ZihAG0L/1nJoFd/isdyFA 5LS200YjaghUz8ylmJZScyNBCKvpbWR5qJ7mtgBTF1sw5l603h/TmpsiRcZoUvT/jC9m rIi7219JuMx91fjsnIdXg1xabk+9apqG4KDufHz7z/JnCf1Dv/R8PnWCClxArQDxGB4l 6bmrhjgj/DkWuqLQ8hztWiANN6fAeVrNU2eJn07Ru7sWLJrzJoCfK7RsxGFLgt8oUgp2 c4+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888863; x=1699493663; 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=nPDrqyoPtn/P2Y3dlnz8L7OPFIA66GeNv3k0Fexkp9U=; b=R+6mfmxoN9SUcxCounlLUGc3KuALK6ru3EPclLbzkTcjdKbauTupswtwSTAAtOz/xe 37UK4qwWa2M8CkP9bccdX3d/ugKc+7JDJ26UUgic+41bV+QJjeY7WvpiOuiohTADUHeS U/CGD+WidzJQMYGst1zAjE1B9+vNru7M2SSkGvlLrPJ8Q8/puvKFZsHPs2lBzLwEP8VW czdZ7CaNfwndlMw+zdqr1/Vl1QyL4zbGaxS49oYntrlCflC4b76ubBFz0sSWv5JNaTnB 5Ce+SgcMgY5x7y6rf3Am6YMUFvRzHh8WDr2H0L3bnlGxoMmAwhipwYpL7JTwoEKCw+tP VHDw== X-Gm-Message-State: AOJu0Yza9FQg/7r+9NVPORKTOIBECjB2V/ynOwCFhDtQXKlWF//nmUXz 3zfpMlyiNwr5mAq1Az7m+PEpyGSdMApro5CsZvo= X-Received: by 2002:a17:902:ab81:b0:1ca:7f91:aa5d with SMTP id f1-20020a170902ab8100b001ca7f91aa5dmr15637499plr.16.1698888863578; Wed, 01 Nov 2023 18:34:23 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 78/88] target/hppa: Avoid async_safe_run_on_cpu on uniprocessor system Date: Wed, 1 Nov 2023 18:30:06 -0700 Message-Id: <20231102013016.369010-79-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/mem_helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 7132ea221c..602e6c809f 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -480,6 +480,7 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) { CPUState *src = env_cpu(env); CPUState *cpu; + bool wait = false; trace_hppa_tlb_ptlb(env); run_on_cpu_data data = RUN_ON_CPU_TARGET_PTR(addr); @@ -487,9 +488,14 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) CPU_FOREACH(cpu) { if (cpu != src) { async_run_on_cpu(cpu, ptlb_work, data); + wait = true; } } - async_safe_run_on_cpu(src, ptlb_work, data); + if (wait) { + async_safe_run_on_cpu(src, ptlb_work, data); + } else { + ptlb_work(src, data); + } } void hppa_ptlbe(CPUHPPAState *env) From patchwork Thu Nov 2 01:30:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740412 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597499wrv; Wed, 1 Nov 2023 18:46:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOuv2+ksnzEbspxu7cY8gAOMj31oBHFSAU85r05U8KO/prPRcYp4aBWG4M+ZnaV6cV9V9K X-Received: by 2002:a05:620a:15a4:b0:774:3540:89ee with SMTP id f4-20020a05620a15a400b00774354089eemr16844144qkk.61.1698889619277; Wed, 01 Nov 2023 18:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889619; cv=none; d=google.com; s=arc-20160816; b=USLd1odytEgXI4xMhU3Rsy0Ujp129D9szYN7P2jo/QXcsbubGg7UG2uRfL85+tw4WK 1hyDr4lq4eKTZM9Az8NrOqD5Ofsqw26OnluvaAVCfmjFwmki94wfvnAr8WwQvmXUXLBM rsLDa1yRRh3LLbVtuvqznFsRJbQO+XIElIF8x5iYSnGBudEYYcYaZHOvtAQGxTuqYYjQ joqYES2BzqRq72o527Bt0CTr65vNptQUVjWhQoa6a4o9CF5wFm/jWtlh0ZOD04uQFKX6 BPOTeV9Rb57VC/NRRhAW+tgE8FHbAXnRPW5pLb2ufnDdv0VnDH6XxDktXr9Rxm8xnGEP TZ3Q== 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=IyMEcH+XK8Eknr0xQsBIB3lMxzOGskoIpAWKROo/aKo=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=IXaX61AIDq1zFCmuHl5o/DRw/w177gvDJlGGtSSws+Te7uav30T0+8rTI1Lpfw5avW qbf5/RNtDgHtXeq0c18T4UyIsGUSfvEVvjpL1WsUZ8dDBRoMyqAu5PjIJ87GzsUUUsel Xzk0kOsdB3AiXurEro1hA5Dx4WqTpesg5BYpoKf/vjs/y0neoFwOiJgcJGe6STScJC6i l+FjkTU28IStk9BPza40ZTMyVNPcwt7H2juGWZK7MCrRp9nKCTUPSfSE8rDsou8ILZ52 IErwfn7n36SnSjyw+y4ZrMVvi/A5oUdpsSPpA6Ex9q41MmB7NWG3Ia/x2QBN3+bacvR9 nmiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yEfILW/1"; 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 f18-20020a05620a409200b007759a519e0dsi3692629qko.73.2023.11.01.18.46.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:46:59 -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="yEfILW/1"; 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 1qyMcb-0000Hy-ML; Wed, 01 Nov 2023 21:35: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 1qyMbN-0006iQ-8r for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:30 -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 1qyMbJ-0002DP-Ou for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:27 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1cc329ce84cso3327915ad.2 for ; Wed, 01 Nov 2023 18:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888864; x=1699493664; 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=IyMEcH+XK8Eknr0xQsBIB3lMxzOGskoIpAWKROo/aKo=; b=yEfILW/1+/WndNI6j3OMo2Tj4lACg0VHUJ135DiukZHCSBhC4b22O0jBxBGYDyavHE Unp2dgKLbHCuNIZDVCjg3kUtNJQfwY0QUmTyFnTFzzI0W886E+c5T1z7WfspJQg8GTss Adb4Olg0eIBWs5qCED+aM2yN30Th/Zf7UiJb/VmuszVt/9LGItrgPZmlgE7DrFUaIA1k W05/sZR8Ym9qTW0lOtWVhXJ5wTKyxhiY9CWy9dHmpZGXqSlvQBHLPfrq0Oh5lv/8UKAU IJKBBGHH333wsiiyN+J3pG+EtKfXeIfjTamxIv0Tv13Vn75YP+q5sqqVuC404KXZRmy0 aULw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888864; x=1699493664; 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=IyMEcH+XK8Eknr0xQsBIB3lMxzOGskoIpAWKROo/aKo=; b=QbJWxkoOSs+HJccmjJf464Ek/hcThiDdN/lzEgQP3g611CWrQeIkJLvcucJz34FgpU 6hX85suzs4wVGkUbldbxs4yHm6ASLONPutKpbyhEGOJ92HJZPHhdMfzWF0O6zjd6na6m mRzhIFVQSvjfLZnutMnJMhDRn67wYf9peVskcgOfbSkf8zUbDTXRP6qJlDgfBZL4rdfA sEji2G/ZrfqIJ94L1BkLjX26E2dAAqha3KI5CaBW6by9rlqASXIFTh0E3/UTVlxKbS1m JoN0N0IaMXViRkgRm2gfwZdMnnv/RiTLKwHOExOVkf4lbEYHS4HtX+2wQijmr29wi+xs 688w== X-Gm-Message-State: AOJu0Yxz9dNYw46iJslTnMvRMwUraxoYZ0pi8y2ZO2x4q8hjxjNGA64f NH07g/H3VimdzzPuMVUtwrXLuNGCXfNqjETHt18= X-Received: by 2002:a17:902:e5c2:b0:1cc:3fc9:7d09 with SMTP id u2-20020a170902e5c200b001cc3fc97d09mr13100680plf.15.1698888864317; Wed, 01 Nov 2023 18:34:24 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 79/88] target/hppa: Clear upper bits in mtctl for pa1.x Date: Wed, 1 Nov 2023 18:30:07 -0700 Message-Id: <20231102013016.369010-80-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller Signed-off-by: Helge Deller Signed-off-by: Richard Henderson --- target/hppa/translate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d9595c5c7c..f7621590e4 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2060,7 +2060,13 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) #ifndef CONFIG_USER_ONLY nullify_over(ctx); - reg = load_gpr(ctx, a->r); + + if (ctx->is_pa20) { + reg = load_gpr(ctx, a->r); + } else { + reg = tcg_temp_new_i64(); + tcg_gen_ext32u_i64(reg, load_gpr(ctx, a->r)); + } switch (ctl) { case CR_IT: From patchwork Thu Nov 2 01:30:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740374 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595243wrv; Wed, 1 Nov 2023 18:38:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6lrY1cHbjn8TNSajAXZdkfhW8RuJdYea/VV7SPbMVRHabm9VQS+4srvki4wchT9atT3Q5 X-Received: by 2002:ad4:5aea:0:b0:671:92a4:6a52 with SMTP id c10-20020ad45aea000000b0067192a46a52mr10721937qvh.12.1698889098831; Wed, 01 Nov 2023 18:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889098; cv=none; d=google.com; s=arc-20160816; b=dbBttMFbaxM1uTGLapGFBGwsWBRu9ZkPP7Ggyszn9wvHSX5sYqkLmkKKLyBx8++y23 NT8u7ODLnxzd3QEV64zRBYUEwBgDc1UmllRc0tFfmZebNnyrKiC7baWrQDpetXHgx7ZK TDgNCiobNsJjaam+8Xs/1NXUUKdgqc5f6O80lh4RdcGB4p803wN5tUSwHz/T+Bw16LJA TElav9TE6EmChYT4iZ69MIE1ps2TehRViGPj/wbismUPxqaob699MHNcf8n5Z3pLTkFb khidA6hfZAL+cANyhoPAVr+o0H/AMpYhb7jVZFnMOEj35vpR9hPzwwxzHyY0mEk9qTu1 E/BQ== 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=M7+4SBqNUCdb83UyaUX4TiYteHeHosFCPYbW+VU+89Y=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=e+/RhFXJMFxUNBSaw4dPWc9zVUrPSmNHNL1qq2gxgu5Dnvrl2ZqxAlGN0PmhEspzEs 7kegX4aj9y+FuYbvA+tAMZYv0JJC9RICW/AlXD5F/KBmF1IIRRD/W4fV2q3rkZ1RKtV4 1NJ9VueRgx5gIWCR2obRIS1ANM+FX7FIJpjTtzSKyRBV48ouH+ernOoyKdVpZNh4kCeS W4y8BrjLcZCJMKQ3yGqxF85x1nvl/C285y0mhr9a6B2Z8+ZnlLyzJoi3jbZ6X3BXJBKj AKqBNDPHz9ew3oMHg/Ab4VTNOyrtsU9nl5CggE3ROEt9QyG7gk5fAEl4J1Todj9Fz5Nb gKCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sBOWiJ2G; 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 el17-20020ad459d1000000b006562a20b82bsi3438659qvb.327.2023.11.01.18.38.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:18 -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=sBOWiJ2G; 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 1qyMeN-0006K6-D3; Wed, 01 Nov 2023 21:37:35 -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 1qyMeG-0005xd-JV for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:28 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeE-0004IH-Vm for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:28 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so493501b3a.2 for ; Wed, 01 Nov 2023 18:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889045; x=1699493845; 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=M7+4SBqNUCdb83UyaUX4TiYteHeHosFCPYbW+VU+89Y=; b=sBOWiJ2GnrUePOmASQ6Xa3iFuugnWMczNPDwjwyqQWEgjE2Uveu1sKrGzbDFUDh2O9 xIWLI0m+HUONXIIlFDQKW89k9r2O8w0FX6TLkP5R+Xgw0z9U5jHkHRwSjmSMjOq5gbtU jwEWAYhR1WOZMbSUvfuPmF1lLglH3rzK6VJSSnL4uwimIOgSU7QZEKcu1Skiiny5QeSe rvPXXxpZN5ViRyOqFywkWb6oWOgvzJopqT6pnFIvg68uHvG53T0fDXgdZ0JJU32vydi8 J2epGxPuHu2MXjjRI7d6KIlHruY4KWNKT+0dYwRGJ7OkCftbN4051zDWSdDIX/Zixnr3 rYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889045; x=1699493845; 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=M7+4SBqNUCdb83UyaUX4TiYteHeHosFCPYbW+VU+89Y=; b=OSaIsyZlACIDpIiiF3VYDCSSNvWMVVq9pBboWDQhhz3H8dDp+rvDTnYWKudJFZbI9f pkDiVSYxWeFMKiR51Bwo4/iBr/mcr4vZhqjqIN5JVsVYgBLWY8V3eN+NIDqvHRSR2uy1 XzI/ZAz6CyqY/87jmTQkTuQOB05+KVxOyfwVxYI8pqdwzbEb0R6VhkLE3AvpB75AXl7z e60hI/cAPHH9zrml8vfedHrDQeh9rHKt4s15EHymP8038DCtZltLpqL1w2Jn8zxewJ25 OJvqs9xqaWW7ImLb5AaGhBz28Rm0/yQk/lyzIHuelbyulJm2QeI/1/B5R/Of7CD/BKI2 bTvA== X-Gm-Message-State: AOJu0Yzrsmyvo6PTZsEoZcxeV5q4WGLPUBHBWjqHLUsQ8AY7vtOMJoIx SCQTiItqdDByOXlHzs03IFde6i7I8Zb3kLWnxZY= X-Received: by 2002:a05:6a21:27a4:b0:170:3e5b:bccd with SMTP id rn36-20020a056a2127a400b001703e5bbccdmr14877986pzb.30.1698889045602; Wed, 01 Nov 2023 18:37:25 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 80/88] target/hppa: Add unwind_breg to CPUHPPAState Date: Wed, 1 Nov 2023 18:30:08 -0700 Message-Id: <20231102013016.369010-81-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Fill in the insn_start value during form_gva, and copy it out to the env field in hppa_restore_state_to_opc. The value is not yet consumed. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 8 +++++++- target/hppa/cpu.c | 1 + target/hppa/translate.c | 13 ++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index ea8e7e99a4..144794d089 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -45,7 +45,7 @@ #define MMU_IDX_TO_P(MIDX) (((MIDX) - MMU_KERNEL_IDX) & 1) #define PRIV_P_TO_MMU_IDX(PRIV, P) ((PRIV) * 2 + !!(P) + MMU_KERNEL_IDX) -#define TARGET_INSN_START_EXTRA_WORDS 1 +#define TARGET_INSN_START_EXTRA_WORDS 2 /* No need to flush MMU_PHYS_IDX */ #define HPPA_MMU_FLUSH_MASK \ @@ -208,6 +208,12 @@ typedef struct CPUArchState { target_ulong cr_back[2]; /* back of cr17/cr18 */ target_ulong shadow[7]; /* shadow registers */ + /* + * During unwind of a memory insn, the base register of the address. + * This is used to construct CR_IOR for pa2.0. + */ + uint32_t unwind_breg; + /* * ??? The number of entries isn't specified by the architecture. * BTLBs are not supported in 64-bit machines. diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index e1597ba8a5..04de1689d7 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -80,6 +80,7 @@ static void hppa_restore_state_to_opc(CPUState *cs, if (data[1] != (target_ulong)-1) { cpu->env.iaoq_b = data[1]; } + cpu->env.unwind_breg = data[2]; /* * Since we were executing the instruction at IAOQ_F, and took some * sort of action that provoked the cpu_restore_state, we can infer diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f7621590e4..27846f5ad8 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -44,6 +44,7 @@ typedef struct DisasCond { typedef struct DisasContext { DisasContextBase base; CPUState *cs; + TCGOp *insn_start; uint64_t iaoq_f; uint64_t iaoq_b; @@ -234,6 +235,13 @@ void hppa_translate_init(void) "iasq_b"); } +static void set_insn_breg(DisasContext *ctx, int breg) +{ + assert(ctx->insn_start != NULL); + tcg_set_insn_start_param(ctx->insn_start, 2, breg); + ctx->insn_start = NULL; +} + static DisasCond cond_make_f(void) { return (DisasCond){ @@ -1324,6 +1332,8 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, TCGv_i64 ofs; TCGv_i64 addr; + set_insn_breg(ctx, rb); + /* Note that RX is mutually exclusive with DISP. */ if (rx) { ofs = tcg_temp_new_i64(); @@ -4455,7 +4465,8 @@ static void hppa_tr_insn_start(DisasContextBase *dcbase, CPUState *cs) { DisasContext *ctx = container_of(dcbase, DisasContext, base); - tcg_gen_insn_start(ctx->iaoq_f, ctx->iaoq_b); + tcg_gen_insn_start(ctx->iaoq_f, ctx->iaoq_b, 0); + ctx->insn_start = tcg_last_op(); } static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) From patchwork Thu Nov 2 01:30:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740406 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596965wrv; Wed, 1 Nov 2023 18:44:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqluablihwbiIxYd4PqwtqsgobHnqyDncVcMS1z9aD3J9nlAGT3/VccTQvazCKbA/dD4Zs X-Received: by 2002:a05:622a:40a:b0:417:b45b:84c3 with SMTP id n10-20020a05622a040a00b00417b45b84c3mr22436029qtx.65.1698889493728; Wed, 01 Nov 2023 18:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889493; cv=none; d=google.com; s=arc-20160816; b=JUCbiP06n703NhQcssRxkmqm6MsZ34TR4diGF0mspKwx90k0CAU9tjFFWMVvIM2lrS ox0KxTfzFWXWFLbdDotd3VhcP9zdt0+x39kev6qmMHQcU8Wn/N37Nfjt8QReZPLuwnev nGiDvn7c3J29KI3AX98E8AJzhUw3r5+ZNTh/q+ENQHDZ1dlh23zRqLK5MOlQWBpqix8e jF32h0kI/65aA7xpDqKPJv2h8YcXsJXt7b3wTGatIHNkscgB3FhP9hAO0zYeCsTMY0Ue j9PwhTUjwi7iyaiONcBpRC9Tn4lED12Du8xAMgbjO9DEWnm9W+SJlmGkUw1+l2+Hp4de rQUQ== 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=l8fr3+CRJQ2fSyTIfaR9JmF1licLAR+9v7s8wM6sbYc=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=0oH2GsKA69CK8OfRb39zomVZU8GKBvPfVdrY4Ja7CtF8MIGCNqw7jTw0tN1prPUQu/ y7YXP9B0QzntSEA5ncA82V8hOI5DNreB3RelvD/To2/PIaN5j7aoZkVJ6mzi8pK/4tkg kAiK/kYh1AmLqw46/11PslMp00TQpsUEpunziW73qSofN73ESA/0HNepaNZOzpPHh6Wi +f7VZ/DUg6mHEyAqBF7JyCVVsqP4Aun0GJYdloWTo0ptedjBXzp4bXDaKhXjp+otYx2D nqdUkWuCo5wVFTGHentTV94RQRpYJ3C0yyC31BGM8uKIeqJdUvkYDn05gBnJNnFvrCE3 hm9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qocJiGYF; 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 17-20020ac85911000000b00417b523872dsi3696077qty.621.2023.11.01.18.44.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:44:53 -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=qocJiGYF; 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 1qyMeQ-0006aR-Cf; Wed, 01 Nov 2023 21:37:38 -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 1qyMeJ-0006BA-GG for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:32 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeF-0004IQ-Tf for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:30 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6c0f14d6875so475586b3a.1 for ; Wed, 01 Nov 2023 18:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889046; x=1699493846; 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=l8fr3+CRJQ2fSyTIfaR9JmF1licLAR+9v7s8wM6sbYc=; b=qocJiGYF7GrzYxqW/Q/7plufTCnRFgIbK05yjToCR48tBsXgn69AZ9rmqqkoI7dhWJ eLLJ/noslY9BBrw0ZcznObQCaX0oULayWREKo2YWucSFJ6oRVw/lIXiUuvzXZIXJg270 o4nDBgtOHyELybFEceNWyTcG2fY1B+g7nTLV3OauZQKmkdirGV9TT9JOkZ9cYnL+psSj p4wiX/CVuJ+iqFweKbkCWQYMoRXQuvJMW2zyXYPtfv9uM38D21LxXLTidFOeWPKcVVJr js8QDmt+zW2cv2w8AVa4MDH/GqAbVrkJxdL+VBeznnb2i0BXf0L+PY/xp0+KkDVfNKIb HtbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889046; x=1699493846; 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=l8fr3+CRJQ2fSyTIfaR9JmF1licLAR+9v7s8wM6sbYc=; b=Q4ut4iF7BCzVXDLhUED72uhSY5FOtJVpaVEzlxjYjaqkoYIP3ryEcF7ZkW5K7KfFll C5FA8yaARebgiKXNdxtdSoFldKUrzingZ41eIDIScLZAo/+RJuJ9s+xah5uIM0L2641/ G7MrBKi9HrX+Ik2n4gqFKeeFD0vkzArxiNINP35hXVZ16cmIvnhr6qVYxYRbgkQoM5nv Bo7GnvF1I0sqfciKevhVMS304nN+YT6SiT/yaVKDKz631bg1FGLZxu0kTSrgMAafkv/c 8mXQqyXgDQJzbikKuSXZziue4ToyaJ3/triNzELDbZ+91HxZQCVbbNnxcmHMzCg29kvU szcw== X-Gm-Message-State: AOJu0YxAfKLmkuZCFiI0hbBef8hV3czlwh6UUh5eMpern9aSwhxouOGX gseRTrgSquMLmXWYQNDis3XKZUdKBb5GYqU9b4w= X-Received: by 2002:a05:6a00:cd1:b0:6c0:1096:e7d3 with SMTP id b17-20020a056a000cd100b006c01096e7d3mr16849331pfv.18.1698889046413; Wed, 01 Nov 2023 18:37:26 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 81/88] target/hppa: Create raise_exception_with_ior Date: Wed, 1 Nov 2023 18:30:09 -0700 Message-Id: <20231102013016.369010-82-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Handle pa2.0 logic for filling in ISR+IOR. Signed-off-by: Richard Henderson --- target/hppa/mem_helper.c | 64 ++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 13 deletions(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 602e6c809f..858ce6ec7f 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -289,6 +289,53 @@ hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) return excp == EXCP_DTLB_MISS ? -1 : phys; } +G_NORETURN static void +raise_exception_with_ior(CPUHPPAState *env, int excp, uintptr_t retaddr, + vaddr addr, bool mmu_disabled) +{ + CPUState *cs = env_cpu(env); + + cs->exception_index = excp; + + if (env->psw & PSW_Q) { + /* + * For pa1.x, the offset and space never overlap, and so we + * simply extract the high and low part of the virtual address. + * + * For pa2.0, the formation of these are described in section + * "Interruption Parameter Registers", page 2-15. + */ + env->cr[CR_IOR] = (uint32_t)addr; + env->cr[CR_ISR] = addr >> 32; + + if (hppa_is_pa20(env)) { + if (mmu_disabled) { + /* + * If data translation was disabled, the ISR contains + * the upper portion of the abs address, zero-extended. + */ + env->cr[CR_ISR] &= 0x3fffffff; + } else { + /* + * If data translation was enabled, the upper two bits + * of the IOR (the b field) are equal to the two space + * bits from the base register used to form the gva. + */ + uint64_t b; + + cpu_restore_state(cs, retaddr); + + b = env->gr[env->unwind_breg]; + b >>= (env->psw & PSW_W ? 62 : 30); + env->cr[CR_IOR] |= b << 62; + + cpu_loop_exit(cs); + } + } + } + cpu_loop_exit_restore(cs, retaddr); +} + bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, MMUAccessType type, int mmu_idx, bool probe, uintptr_t retaddr) @@ -318,14 +365,10 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, return false; } trace_hppa_tlb_fill_excp(env, addr, size, type, mmu_idx); + /* Failure. Raise the indicated exception. */ - cs->exception_index = excp; - if (cpu->env.psw & PSW_Q) { - /* ??? Needs tweaking for hppa64. */ - cpu->env.cr[CR_IOR] = addr; - cpu->env.cr[CR_ISR] = addr >> 32; - } - cpu_loop_exit_restore(cs, retaddr); + raise_exception_with_ior(env, excp, retaddr, + addr, mmu_idx == MMU_PHYS_IDX); } trace_hppa_tlb_fill_success(env, addr & TARGET_PAGE_MASK, @@ -553,16 +596,11 @@ target_ulong HELPER(lpa)(CPUHPPAState *env, target_ulong addr) excp = hppa_get_physical_address(env, addr, MMU_KERNEL_IDX, 0, &phys, &prot, NULL); if (excp >= 0) { - if (env->psw & PSW_Q) { - /* ??? Needs tweaking for hppa64. */ - env->cr[CR_IOR] = addr; - env->cr[CR_ISR] = addr >> 32; - } if (excp == EXCP_DTLB_MISS) { excp = EXCP_NA_DTLB_MISS; } trace_hppa_tlb_lpa_failed(env, addr); - hppa_dynamic_excp(env, excp, GETPC()); + raise_exception_with_ior(env, excp, GETPC(), addr, false); } trace_hppa_tlb_lpa_success(env, addr, phys); return phys; From patchwork Thu Nov 2 01:30:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740407 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596970wrv; Wed, 1 Nov 2023 18:44:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKJcqNVQPb/xDKJpV9vk+1Y77sXRuvMOAcEjZS7JKNfL2xCR+uiaY8HsSU937B0UAUv442 X-Received: by 2002:a05:622a:1386:b0:41e:1777:b474 with SMTP id o6-20020a05622a138600b0041e1777b474mr21874557qtk.31.1698889494427; Wed, 01 Nov 2023 18:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889494; cv=none; d=google.com; s=arc-20160816; b=PUOmSwrwPgMXqtjdZmlsCSpNr8mrbRwaD+lrSvzJj+iObdYv41HzY2HciONhgSH8mT c6yG9AeY2tRwe6iDfmCfR4IWf/MTjFROEk6hk8Ncn5kolGAmHNkhAGB2NUR55y5QquTv 54uWC854tiKRqumqnG2iY+Hx8AGYmGHSMxY4sMl+Pelnzy/nVXFewxi0kHF9WMzVIZ0P mSShiT4EUBf5qaxSL7FNDMdxe9Qc/zovHlGDTV0lkQkXiMFlw/gxlHrC+HPJb5ryYfg6 uVxc/YAWk3GvYlT8alPgd+Wb66pH9wjsNAzc5ZfyBFc0mzZMBLUiKNKtYW5PCU5o2plg s4xQ== 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=Uo0Zhvofbd6vpRMbc6PjwjiK07TZFi7sIhEIgzM+1zU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=XVFohk6ox6MiFKODMzs1Lm70hCuHputVy9EzoWDXGCRctzGoqlMOKuX/ujYr6odRsG zIgjIVK8QRKCliu3mo+yRg4AjC39brloElCV8wFG16y2/sIPwDK0Pv/AO0CK4x9w0XjQ J6kEg+ANcQLeKUQJc5tQEroQUkpzxsQ2UmiqtZGPh9yR8WfyguaOMZhGJPX0sHTXzWCp zbtBN5InCSiOQ/4gNdHb+u6Cmt+qNtjZoI95vJJHUjryOiU34LUh16wb/Obkhe47z44d HuKh0AFH20BmGQLGX+AUwD0+mFI01cnX19r9I3ncaiNe0AKETtaBg6kh9Fc4DzZovEeT 8Yow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i9du1G2H; 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 r13-20020a05622a034d00b004195716fc55si3602139qtw.711.2023.11.01.18.44.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:44:54 -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=i9du1G2H; 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 1qyMeO-0006Ty-Sw; Wed, 01 Nov 2023 21:37:36 -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 1qyMeJ-000688-80 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:32 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeG-0004Ia-G3 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:30 -0400 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3b40d5ea323so266561b6e.0 for ; Wed, 01 Nov 2023 18:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889047; x=1699493847; 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=Uo0Zhvofbd6vpRMbc6PjwjiK07TZFi7sIhEIgzM+1zU=; b=i9du1G2HePqf5LaO8EGEm7OlWIGs8AN6jHS2yfSHdEkYfhwCcFEw1NdZth7ErdyCxr hSWMjk9FHRa0FE6HV7HFwYITWt1DXJpe/gVHHvopgftGZhac8sLFxYVXjraqFg3k9jmk 8b7Mn++jlI+n1tnlEPzTcv88bZ0wxMOTv2xHH0YhY151mTpR0fP8spIWfcfA4QKCcmcv 0j5TxiBiTgMdUDfZ6Y3eyLVwjtVj3GO0TeKbVny0yz1kTVmKf7BEFkavrspfpUAsEmIR ljgWuXYWTK3SG5Vif+ca9lU91V/SRJcQUq3jl2gXK5Ii3fhwLgbJqiWXrlqOQx1mK3ZB jN5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889047; x=1699493847; 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=Uo0Zhvofbd6vpRMbc6PjwjiK07TZFi7sIhEIgzM+1zU=; b=En66LpxgMF01n0L5BMUtiuSrpWhMOzQGmRkCf3Vj+x57kpxA/JI74WIoqXNrDNHLqK oEGhxikxPoudNe4CmtadEwz14h/DOuiLIpRMEECjZLe8vqQl8/jQmGOPyHAYN+eigVgf rJ9mWX2zWksPbLgnF5HMnsn63QP2gCrYR4pazwEoar0i/nYMS+oBukpg0wcQOFbWYRtc 8aSXdPRywvnstIb6wz5rmHHyHs5bjSt3vnHpAJZS0WM6Kah+gVWZDwGKf+2whRYkk3+Q FbekGzArqmbrwON12jCfBghnaLuzmo7QvB5lLk5V7U2ZEsZpkRdzZmrQoVFAYvbwmmJ+ MRdg== X-Gm-Message-State: AOJu0YzSOsMD1zbTTzBIQTtIR4fAzYM4zWekpbUbxAtZJDjGxkjCZN00 6rjGKs5gTG31QHbK6NSz8SyPojzNtqPAn892q+w= X-Received: by 2002:a54:4794:0:b0:3b2:dd03:12ff with SMTP id o20-20020a544794000000b003b2dd0312ffmr18532807oic.8.1698889047257; Wed, 01 Nov 2023 18:37:27 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 82/88] target/hppa: Update IIAOQ, IIASQ for pa2.0 Date: Wed, 1 Nov 2023 18:30:10 -0700 Message-Id: <20231102013016.369010-83-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 These registers have a different format for pa2.0. Signed-off-by: Richard Henderson --- target/hppa/int_helper.c | 46 ++++++++++++++++++++++++---------------- target/hppa/sys_helper.c | 10 +++++++++ 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index a11d607b31..54875442e7 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -102,11 +102,7 @@ void hppa_cpu_do_interrupt(CPUState *cs) HPPACPU *cpu = HPPA_CPU(cs); CPUHPPAState *env = &cpu->env; int i = cs->exception_index; - target_ulong iaoq_f = env->iaoq_f; - target_ulong iaoq_b = env->iaoq_b; - uint64_t iasq_f = env->iasq_f; - uint64_t iasq_b = env->iasq_b; - target_ulong old_psw; + uint64_t old_psw; /* As documented in pa2.0 -- interruption handling. */ /* step 1 */ @@ -118,10 +114,25 @@ void hppa_cpu_do_interrupt(CPUState *cs) (i == EXCP_HPMC ? PSW_M : 0)); /* step 3 */ - env->cr[CR_IIASQ] = iasq_f >> 32; - env->cr_back[0] = iasq_b >> 32; - env->cr[CR_IIAOQ] = iaoq_f; - env->cr_back[1] = iaoq_b; + /* + * For pa1.x, IIASQ is simply a copy of IASQ. + * For pa2.0, IIASQ is the top bits of the virtual address, + * or zero if translation is disabled. + */ + if (!hppa_is_pa20(env)) { + env->cr[CR_IIASQ] = env->iasq_f >> 32; + env->cr_back[0] = env->iasq_b >> 32; + } else if (old_psw & PSW_C) { + env->cr[CR_IIASQ] = + hppa_form_gva_psw(old_psw, env->iasq_f, env->iaoq_f) >> 32; + env->cr_back[0] = + hppa_form_gva_psw(old_psw, env->iasq_f, env->iaoq_f) >> 32; + } else { + env->cr[CR_IIASQ] = 0; + env->cr_back[0] = 0; + } + env->cr[CR_IIAOQ] = env->iaoq_f; + env->cr_back[1] = env->iaoq_b; if (old_psw & PSW_Q) { /* step 5 */ @@ -154,14 +165,13 @@ void hppa_cpu_do_interrupt(CPUState *cs) /* ??? An alternate fool-proof method would be to store the instruction data into the unwind info. That's probably a bit too much in the way of extra storage required. */ - vaddr vaddr; - hwaddr paddr; + vaddr vaddr = env->iaoq_f & -4; + hwaddr paddr = vaddr; - paddr = vaddr = iaoq_f & -4; if (old_psw & PSW_C) { int prot, t; - vaddr = hppa_form_gva_psw(old_psw, iasq_f, vaddr); + vaddr = hppa_form_gva_psw(old_psw, env->iasq_f, vaddr); t = hppa_get_physical_address(env, vaddr, MMU_KERNEL_IDX, 0, &paddr, &prot, NULL); if (t >= 0) { @@ -191,14 +201,14 @@ void hppa_cpu_do_interrupt(CPUState *cs) /* step 7 */ if (i == EXCP_TOC) { - env->iaoq_f = FIRMWARE_START; + env->iaoq_f = hppa_form_gva(env, 0, FIRMWARE_START); /* help SeaBIOS and provide iaoq_b and iasq_back in shadow regs */ env->gr[24] = env->cr_back[0]; env->gr[25] = env->cr_back[1]; } else { - env->iaoq_f = env->cr[CR_IVA] + 32 * i; + env->iaoq_f = hppa_form_gva(env, 0, env->cr[CR_IVA] + 32 * i); } - env->iaoq_b = env->iaoq_f + 4; + env->iaoq_b = hppa_form_gva(env, 0, env->iaoq_f + 4); env->iasq_f = 0; env->iasq_b = 0; @@ -251,8 +261,8 @@ void hppa_cpu_do_interrupt(CPUState *cs) qemu_log("INT %6d: %s @ " TARGET_FMT_lx "," TARGET_FMT_lx " -> " TARGET_FMT_lx " " TARGET_FMT_lx "\n", ++count, name, - hppa_form_gva(env, iasq_f, iaoq_f), - hppa_form_gva(env, iasq_b, iaoq_b), + hppa_form_gva(env, env->iasq_f, env->iaoq_f), + hppa_form_gva(env, env->iasq_b, env->iaoq_b), env->iaoq_f, hppa_form_gva(env, (uint64_t)env->cr[CR_ISR] << 32, env->cr[CR_IOR])); diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index 8850576ac3..a59245eed3 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -80,6 +80,16 @@ void HELPER(rfi)(CPUHPPAState *env) env->iasq_b = (uint64_t)env->cr_back[0] << 32; env->iaoq_f = env->cr[CR_IIAOQ]; env->iaoq_b = env->cr_back[1]; + + /* + * For pa2.0, IIASQ is the top bits of the virtual address. + * To recreate the space identifier, remove the offset bits. + */ + if (hppa_is_pa20(env)) { + env->iasq_f &= ~env->iaoq_f; + env->iasq_b &= ~env->iaoq_b; + } + cpu_hppa_put_psw(env, env->cr[CR_IPSW]); } From patchwork Thu Nov 2 01:30:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740398 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596253wrv; Wed, 1 Nov 2023 18:42:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUnodzTG2luPR2oI6KFCmDPJMqmuiyYWpnaYeTXFabBzj0KudYQzQDKFMiNzsgFP0wINP5 X-Received: by 2002:a1f:2a93:0:b0:49a:466c:199e with SMTP id q141-20020a1f2a93000000b0049a466c199emr15758651vkq.2.1698889333088; Wed, 01 Nov 2023 18:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889333; cv=none; d=google.com; s=arc-20160816; b=LFl4SlqJn/eRPCu8sGQGb+BFUZQpnApa4pRRM1Gz8L6C8IZt4wTEUtTaDmIMvNvZGo IcbVawQWYGZpd1nwOuCLtz0ql+O06fEW4VTF7OD8HOnxyyHb2wcUY3wzEeHhJVjHubB+ XfrlM0ihzoKaoCE90ybT7lvy8rYbToN0yW4ufUrHAprLPyQlh2JxlyJ3gwLrG0EX4WOP XtS91jsuvz6RHMqGF1Uamlo+i2wWiS6qusO44y6vSITKl/2k9iYfZHMwYV0yhYSjFVi6 TW6w1IIsen+OrVgo69S29LKCsKxmbNz6sVVoJgKNoJOiCkwTocs/ndjr5Ni/4FkT35GS IXzA== 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=Kd6/eT9J299b8JKalao90u4vBcVmHm6G2kVANEbq6n8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=prIprpBOyC6Wef7mOlQAJyWdirZqvxkqSzNo2ONTFqEE57JE+RVuOFr7dGXArvjeXU Or+eSGdshR41pvwbj2ARL9KF4LeNCyHhFfKYaqQraUIH6OQF/B6NotbrLCWh4VlMX717 dQrcfBUo61dJNKrvwX6gXdLCVmS4/NUdzSvX4Y0sCL8d3bfZPepwK0wYtr5p2SsUBf6c TeAwtBMPPR54d2UQHBO5k9szL5I41l7ppE8SaIQlVt1UADmtC+6eKI2NhcLL+oows3Oi GBsTjnxg0/Ad8x3M+TjN6qI2cWjHZjpH85pv2lvGxLOasGnZhPKSmmvyMVFxnqnFVoXD Nk7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y+ztHnoM; 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 pz10-20020a05620a640a00b00776b91c0b1esi3725383qkn.23.2023.11.01.18.42.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42:13 -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=y+ztHnoM; 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 1qyMeS-0006do-1k; Wed, 01 Nov 2023 21:37:40 -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 1qyMeL-0006Ev-8W for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:33 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeH-0004Il-BX for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:32 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b709048f32so496441b3a.0 for ; Wed, 01 Nov 2023 18:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889048; x=1699493848; 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=Kd6/eT9J299b8JKalao90u4vBcVmHm6G2kVANEbq6n8=; b=y+ztHnoME3T+rZeEhZQkQyTjNyrongAvfAb6AnE/KjFIcgyCZXu+6oLtCOMC+eWOvW kpW57xrW+qXJIWCJ70I3pBx245hlsPe2a4NcJEm8P3JINmzpoxR4ZVFi4bsq6fljc+s2 uwEOVoNx/uSj6NO0UPeoRQvdCxyQYuyodeUb8wcRQG8+gDpSG9gCIDUZCI7EWwQ/XZGF RbEXfG0JB5k3YZcBqhy5++RdE7pfYjQAxHqGgTApzSfk4O8kvL+S47m68YVDrI0OOCmB 6NJOvMJlEtt5xSG9FovrzvshLRerb2tCC4aQZx3KvzggxVa/6f0WsTgb919eeuIZZbOC fWvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889048; x=1699493848; 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=Kd6/eT9J299b8JKalao90u4vBcVmHm6G2kVANEbq6n8=; b=SSV87yLM9UyAxQ71aLt7tjNKuUQ8JtNXHqAeXzJLA1nApIEDj3RTeERltDyRHdZANz r8OMDY01iURyHNJUtKg3o1QVGTsni8c9ka4KMlRvE5IODQMHNvSOR9vCaqyYoGeHRCBa 7HzTxIK0xz2dkxVVAaYIQlwj9oM8nH7m+2/KcdlAV9TpQ9Oi/AqO3IDHdFL+MwIeHbpb LiA9fOpeD5uBUe0AwsancmEGI1vO84YFQexU5ghVj5WUwogYRhzYfVek90AQyPGfWefH keBPV+Ifp+J+zEvhMjJb6W8u0+DJWkTZ/b1fLxudQEEMU+RdKBweyg4URdK8KrC8aACd lifA== X-Gm-Message-State: AOJu0YxoAPGScwqvDHp5Oj4U9+/fshvJEHaahp+uSZp2oiUMXBYavSaO cpd+k+WUONOUf9mq09UgR1j/JUXZO8YCe1czhfQ= X-Received: by 2002:a05:6a00:1410:b0:6ba:bd35:9efd with SMTP id l16-20020a056a00141000b006babd359efdmr14791538pfu.5.1698889048051; Wed, 01 Nov 2023 18:37:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 83/88] target/hppa: Improve interrupt logging Date: Wed, 1 Nov 2023 18:30:11 -0700 Message-Id: <20231102013016.369010-84-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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, T_SCC_BODY_TEXT_LINE=-0.01 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/hppa/int_helper.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 54875442e7..467ee7daf5 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -258,14 +258,10 @@ void hppa_cpu_do_interrupt(CPUState *cs) snprintf(unknown, sizeof(unknown), "unknown %d", i); name = unknown; } - qemu_log("INT %6d: %s @ " TARGET_FMT_lx "," TARGET_FMT_lx - " -> " TARGET_FMT_lx " " TARGET_FMT_lx "\n", - ++count, name, - hppa_form_gva(env, env->iasq_f, env->iaoq_f), - hppa_form_gva(env, env->iasq_b, env->iaoq_b), - env->iaoq_f, - hppa_form_gva(env, (uint64_t)env->cr[CR_ISR] << 32, - env->cr[CR_IOR])); + qemu_log("INT %6d: %s @ " TARGET_FMT_lx ":" TARGET_FMT_lx + " for " TARGET_FMT_lx ":" TARGET_FMT_lx "\n", + ++count, name, env->cr[CR_IIASQ], env->cr[CR_IIAOQ], + env->cr[CR_ISR], env->cr[CR_IOR]); } cs->exception_index = -1; } From patchwork Thu Nov 2 01:30:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740376 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595283wrv; Wed, 1 Nov 2023 18:38:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnttrDpeBpZ3+4Megv/qBNen+/HWmLQzW3ii1opsJ0uXn7kUY/0gX095rCrGsd4A5m6XnB X-Received: by 2002:a05:6214:27cf:b0:65d:4840:6eb4 with SMTP id ge15-20020a05621427cf00b0065d48406eb4mr21108317qvb.6.1698889105407; Wed, 01 Nov 2023 18:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889105; cv=none; d=google.com; s=arc-20160816; b=TCgg7bqvfMi5Ht/zZMaagqvz4b7rbWo+TyNiWiECEG/SUhIbMhBxtc3YqdGvxp8vqz whL28GuhvWHfsajJEBXa1r6TDrdqrNPj8MtTAW85biSAItGO/snM7NnhMWZn71nun/1n dF8lkAsUvHvKEyX/Hh7qTr4Veu7xOe4fmm4VgmOH2V1Z6p6r2cupmqr/ugvcg5j8u09e vqCRkbLc9CaS3qDZ3xJK2JFmlfC1Uh2cwgGPK/OLzkwidN71kSA5itE5djt1aUZu7i1L L/FkQX2cU70/ZlROgbY9qbREu33oI3Wh9Gpr13nzFhDsXnJuX0OPTbhzzR/NIiLRYdTP qORQ== 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=jCD7MGoBGBvFUMEqCraVMyK1zfse2SsJ+vuTkGcLU/A=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=HuJ0ZMCzPOuNPlSa1HHU8QVEB05EI9QF0hpbumUV1P3neqYkrurRGI3/WXY67SIfiJ mVcWH1aS9BznGiP6VxM4SS5Rd2eOGMa0EJe6GzCU8AZux4/Uqy/Pxxplc0hs+tKAy5Br Y2+tT/5/GLC//cuC2TrwYDJfqTtaU4VMjT4NiDHyDzvk6LMOE8X1UbzfPnbnJzUx1E4O 20RJ3wH1SQahHWbt482QmbMK0JZI4yQ/08ho3fKcao6LgJ9qqkKx9kvBZM23ftT9Z/CH uF6sUFUSQyDkMlSLWjj44ymWH46ZBtsVOjLDpKuLE7RPMs+qnqrEtJIuCzgqoC11BUq7 Xggg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pXbvUGGe; 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 h6-20020a05620a284600b0077736eb9fc4si3597256qkp.4.2023.11.01.18.38.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:25 -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=pXbvUGGe; 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 1qyMeT-0006zf-4w; Wed, 01 Nov 2023 21:37:41 -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 1qyMeM-0006Js-Fl for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:35 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeI-0004Iv-An for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:33 -0400 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3b565722c0eso256826b6e.2 for ; Wed, 01 Nov 2023 18:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889048; x=1699493848; 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=jCD7MGoBGBvFUMEqCraVMyK1zfse2SsJ+vuTkGcLU/A=; b=pXbvUGGeg02hjluVnLmUvDp630W9vnY7IqPmSawJzk+RKjr+W12p+O2RfsDMmgSdFB VTpLAPQ0rHdQb8ljo1QnAGupaPrLH/YoP7LkbD4mYME9QW82rkMUMbqaSGZnf6hs5IHA 5p5AOIOjIbhPk2sxytaBS7JcfW/zQmQPNjK7OUfXEzV6o1hIoJ4nkVD0BubpDVRV6dhd zHOW3J4SmOcWxbB9T8VRVSm0nUV1LQ0gPbKRSQFTwAPVKrOxp9ob72oiwkSbUXAz56lx sz0688foefsze5ARitC4DoK/Tg9LHloxOqhmS7jlep5lcukyFiff7yDJ84+9K3PWgksg DVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889048; x=1699493848; 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=jCD7MGoBGBvFUMEqCraVMyK1zfse2SsJ+vuTkGcLU/A=; b=ITlw+cZlaka+eMTH5YSaS49zwvhASukiwIpUccZPhyhMmBxQGSngIhAeuRalzuMv/y j6r3r4NgRcJpl5EmUWhqm2wSOHzw6rfpdlDr44TrueHEvj53LWoIZ5ZowfrZKUmPyT/7 ePxLyp6qLd6nZSVZ9fB25xzY4vrFQFtwmhVYzkaXlM1gms8AoLE4ENGR9wO0c/OEBz40 xU3CyZEBjCIeYpZmQBPn8ChbvfMXyGa5XwEeudadsURsKVlFhfZ9eeKg9w4SeJUXwz4B /F22mtsaeDulDMdYIB3tCZbRczkI4B1d5UyMy/NV9e4b3mjZfQiXA+HLZx4yqxead3mk xgnQ== X-Gm-Message-State: AOJu0YxV6TrpTaxRcUc7WTuRVgHPgkabAmieAUPskYxeaKXAKuiEqvtg m+9M8LDwXGYxWkrL70tNNCopTGBMxdKSL7F+qa8= X-Received: by 2002:a05:6808:19a5:b0:3a8:f3e7:d691 with SMTP id bj37-20020a05680819a500b003a8f3e7d691mr22622485oib.37.1698889048782; Wed, 01 Nov 2023 18:37:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 84/88] hw/pci-host/astro: Map Astro chip into 64-bit I/O memory region Date: Wed, 1 Nov 2023 18:30:12 -0700 Message-Id: <20231102013016.369010-85-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller Map Astro into high F-region and add alias for 32-bit OS in low region. Signed-off-by: Helge Deller --- hw/pci-host/astro.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c index 4b2d7caf2d..df61386bd9 100644 --- a/hw/pci-host/astro.c +++ b/hw/pci-host/astro.c @@ -19,6 +19,8 @@ #define TYPE_ASTRO_IOMMU_MEMORY_REGION "astro-iommu-memory-region" +#define F_EXTEND(addr) ((addr) | MAKE_64BIT_MASK(32, 32)) + #include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/units.h" @@ -821,15 +823,16 @@ static void astro_realize(DeviceState *obj, Error **errp) /* map elroys mmio */ map_size = LMMIO_DIST_BASE_SIZE / ROPES_PER_IOC; - map_addr = (uint32_t) (LMMIO_DIST_BASE_ADDR + rope * map_size); + map_addr = F_EXTEND(LMMIO_DIST_BASE_ADDR + rope * map_size); memory_region_init_alias(&elroy->pci_mmio_alias, OBJECT(elroy), "pci-mmio-alias", - &elroy->pci_mmio, map_addr, map_size); + &elroy->pci_mmio, (uint32_t) map_addr, map_size); memory_region_add_subregion(get_system_memory(), map_addr, &elroy->pci_mmio_alias); + /* map elroys io */ map_size = IOS_DIST_BASE_SIZE / ROPES_PER_IOC; - map_addr = (uint32_t) (IOS_DIST_BASE_ADDR + rope * map_size); + map_addr = F_EXTEND(IOS_DIST_BASE_ADDR + rope * map_size); memory_region_add_subregion(get_system_memory(), map_addr, &elroy->pci_io); From patchwork Thu Nov 2 01:30:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740409 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597253wrv; Wed, 1 Nov 2023 18:45:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTdbVLyQHd4Eh9mk5tFFRK58eQUtVN3ouwbyer76Lu6R0zg51M8uvfFa9eROda59/9QcTR X-Received: by 2002:a05:622a:3cb:b0:416:4cc5:2f51 with SMTP id k11-20020a05622a03cb00b004164cc52f51mr10942602qtx.1.1698889559296; Wed, 01 Nov 2023 18:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889559; cv=none; d=google.com; s=arc-20160816; b=IR1Om7JqmigZfWqygrqviBENlX1Iu9g068EXlXd5kjzfI45X8dw4IDyoLljW2M745v BAa1BBsd8rtnIi/1UvJ4U/Jl9ZiaJu3FTdc5tpVCbya/aZphn+6a5m3WXVVuX2aRgPNv J7L4x3R+BOeW1FkgRZKQa0QHM4Kolqh9CjZ63pscv/P1MIcoQOYTWZsYLfc4n1W664Hf aiGNtA5uNGpn5zqdBX7nTVNEWRa/m+eSIz9cgpJ7WU1LsBBlwJabw2p9Vu2vVKSLotnR wgOQpV6VtsfI3y7L/qKneBIwwducGgJ5kmgYUbnpZfBsOVVRFTvdaLiMlbo2SYBIFpWr LzHA== 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=ExjsDSAVXPHl9Xgq+QdlGUyx4ksBZYfOfahGxiLtgN0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Bgu8y+RrjMA1aHfRwwk0tbrrMeGUo1SiNtG1Y2LiEhRoCgyHGeQOD7AdatguXuDlCr oH1qVMsSkGeXoB3ULV4pkROrKMCEh770bxkbjlook46EsU58krFmraOzR9dwqqORpkpV 9mbKfEVYSZnKZExWE5nmKhNpGmGOlioSIefMXEm6hWdl+HaVs8EqbvYWj7aP79okt629 rSafV87NOaQi3i8mqzmm1PBKjlaiz5f9h9WVqpPD7Je5paM8z+vRWO/2YMbRAb/Ypmgp 2borMgIMr8jgG8y31DYT1IkzPbrtklkxsd9WY3ehT6Gzwe61pwUFN248WHlApWdFIiWL BIvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GAH4msn5; 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 5-20020ac85945000000b00417d075d66esi3676698qtz.5.2023.11.01.18.45.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:45:59 -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=GAH4msn5; 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 1qyMeU-000755-6g; Wed, 01 Nov 2023 21:37: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 1qyMeM-0006LG-Rk for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:35 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeK-0004Jy-Mm for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:34 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6b44befac59so1258913b3a.0 for ; Wed, 01 Nov 2023 18:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889049; x=1699493849; 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=ExjsDSAVXPHl9Xgq+QdlGUyx4ksBZYfOfahGxiLtgN0=; b=GAH4msn5JfduD0z1BBRpwp2i+HGXH+cIONkajZZv9UHkBGfswE+lKpi8xltDB+7dbJ LbkOQcNrL6azsgn7AOY+Z6qTHkQ6i0klOQh/eFWjU8U949MUupSvrIP+w3iNs5V9Io7+ Na1GyexkqIMUqp2XAgyW4SmkTHDzBYG0JtaGvgCwluVBoD4db+3ntBxb4n2aVqxgoJJ1 lz7g3egaAGOlTjcJVyek6HZ3o6fOR63A4nTEwGaWQrj31WpS+SXh2Kk6UD1YBoKDaIM2 8ALFqzDQ1QfbYa+Fd82PcKhUwCR8hYrrcQn74YtA+NVXBnO0Nt5BId4R4f6WaLEz8Eb8 /1iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889049; x=1699493849; 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=ExjsDSAVXPHl9Xgq+QdlGUyx4ksBZYfOfahGxiLtgN0=; b=OFDjjw4qVVNnlyeNwyWESgLUkgHj/RPdgqe1M7izsN5kTAqbapwvHujJ5CQ1VxPuvh R8Q/N6iNjGwq/Eo5t7UZATyg6/3PFUq9Ax5HvHt33jwiG3REMa2YRANdUaGqPoxfhOr0 sH5bu7ZegE3gKY7g92EvXtPDMC0PRuCgLnXiZc6nJkZ7t7kfZxa9hFe//QW/5Sj+LxFv qqFhrytvDlbvuCiSykaElZ0MyIaX5csBIrR8ZEFDSBYbX+Nj5xwnU06atMdZ+B2T7mnG 7epmNWkSz0S0YmMsCnuGOdW6IbRmJGXO06MxyCrKwzYbgzD5gG3GohFwrp/CMy61OR/D 3HQg== X-Gm-Message-State: AOJu0YxMSXCmIjG+4EoEMkohv3RGUkWB/oDQXi2neV/IQLg9VFBauiNq p5GxfSvxkks2rCWm/KsRDP4g4Z/VtmwCc9Hf4jw= X-Received: by 2002:a05:6a20:4325:b0:13e:debc:3657 with SMTP id h37-20020a056a20432500b0013edebc3657mr7908070pzk.30.1698889049425; Wed, 01 Nov 2023 18:37:29 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 85/88] hw/pci-host/astro: Trigger CPU irq on CPU HPA in high memory Date: Wed, 1 Nov 2023 18:30:13 -0700 Message-Id: <20231102013016.369010-86-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller The CPU HPA is in the high F-region on PA2.0 CPUs, so use F_EXTEND() to trigger interrupt request at the right CPU HPA address. Note that the cpu_hpa value comes out of the IRT, which doesn't store the higher addresss bits. Signed-off-by: Helge Deller --- hw/pci-host/astro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c index df61386bd9..b19f0917c5 100644 --- a/hw/pci-host/astro.c +++ b/hw/pci-host/astro.c @@ -384,7 +384,7 @@ static void elroy_set_irq(void *opaque, int irq, int level) uint32_t ena = bit & ~old_ilr; s->ilr = old_ilr | bit; if (ena != 0) { - stl_be_phys(&address_space_memory, cpu_hpa, val & 63); + stl_be_phys(&address_space_memory, F_EXTEND(cpu_hpa), val & 63); } } else { s->ilr = old_ilr & ~bit; From patchwork Thu Nov 2 01:30:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740408 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597117wrv; Wed, 1 Nov 2023 18:45:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+XZWLJ8h4xamKb+gnXq8VYQJ00ZySqBAtG7mpHew0SbRibX9X8hgIjzF8UUv5wJxRa8+r X-Received: by 2002:a25:25d6:0:b0:d9a:dece:d9cb with SMTP id l205-20020a2525d6000000b00d9adeced9cbmr16529435ybl.54.1698889527732; Wed, 01 Nov 2023 18:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889527; cv=none; d=google.com; s=arc-20160816; b=U7FMfjzG6LzQ42PssXdxR2wLOrp+19tCweCCrsxb9DZtdvKsSYvKcLGNTzWkzJ8z5y Kb9mlZZE/En37YbTOdQY/4xnhPRmukbkZrFLXcX5QGkBX+2waSUfcNZJDMIFPRiAbg6k XiN6z6x/lTNnAScZ7mAsr1SRErlDUsgSFqZwJDU0A2HBk+neWAz7cn9BxOdeea1/2zxg SQYPOiw1Cv/quM59I1RVuTRyNTqyvXdhsBl7hwbrGPBD0CF4cHUbMiL3XtLZJD7ixoMY NqIWQ4M8an34kQ1FUL2lTJA3pTuqR6Sdv1smlkgVgwetCCkhKkbl5QjpbPW6rZYzUx97 Y6Ng== 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=DfcfvCM44CNzCfVh5n1nc5lCu8ey+5nlcTa0SEohSWE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=wOLdBIb5UWcSJvuUyflnbssJqTWu/Di/3ThsqcEKWczxYfxs9k0qEn/ChOOKbRJHwL ylhYdBxAl8Or4rlZGiUKmDAQGy7CV9/QjMWy3T7431s87C4w/TjPTI2zRD8p5+i4D69x EEnEJ9YZwrKIg8OAzJdB7DkANkp9Pw7DtI/YmibFYs76E2RZBRwr9FGe4GJGyas+rwmF fxKbIJvsZnL+d95fT3itmXqBrxmKrcKgQZhJGgH2v2FtaO+Hg3XvDD2zgB1nPu3ty+Up RDc9xdpxK0v1Bt3WkuQ87W3kAs58YLiyMCO9bet1Bg2UCpY04nkA4NGJqIxlpMVzP4Qd KZKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WYyz7Krf; 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 ew18-20020a0562140ab200b0065b2226fe46si3507633qvb.140.2023.11.01.18.45.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:45:27 -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=WYyz7Krf; 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 1qyMeW-0007ID-Nt; Wed, 01 Nov 2023 21:37:44 -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 1qyMeO-0006Tx-Bo for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:36 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeM-0004LL-5x for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:35 -0400 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3b2e73a17a0so264556b6e.3 for ; Wed, 01 Nov 2023 18:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889050; x=1699493850; 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=DfcfvCM44CNzCfVh5n1nc5lCu8ey+5nlcTa0SEohSWE=; b=WYyz7KrfjSySDJKYHhmvszBxmjRGUWdVJpin12zZcTw1JZpq12y/O6yqPnfqwxOPRG j4VHGlK66aarJ7uWUheEppCcY3Jj3ylaw7lVMs1vBWqD6BkcZ0DXAECI7xwlyJKTUaq+ q9zmf+iVCBuYZNcf+9cst6a4C/vnzH8b00tQV891kRNOTptJ96dAH5e0WzrsVFRD+yXD UV/EgxQs4z7j1WQuIKOoTNLZh2oOrU+hwXXtlUkEBSLoj+JS7nx8DmprR3AgbKvS+weD q5UebbIEV34yWQ4WgRmJlLN22nPhjp3OvoSsjRZRwIGdUc+7VFVeT8bKB5nRtVgkUQZK 39wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889050; x=1699493850; 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=DfcfvCM44CNzCfVh5n1nc5lCu8ey+5nlcTa0SEohSWE=; b=bouZ9UKUeWQMADheGZf3Ffvwc0A3GV3n9XhUN89XswWO0pbddeDJegwHN5RlAyD+VC pNbobNuupjJlrSfiBB6GhGcp39++Xj+uVQ2UMN+aSZIW9Gsahr1eJ2XDzM56LavIQKN2 tOhhfW8go3WisjuWRPNkZTtIipmvAqW+ws40qi3meZvoXPa7V/KQCKBmn49Yd6k+a8RG keF5MrYDrUQLSGiHELOjCgKKv9lcmyZZ/uNNbggTeR6F08Z5cqCZ9aUtWvRpmj5gkfoY qV9C0NVvHzrb5RdoSaIxOKoXEla6uDBsUsGiOl0g/Dw7A7rzDWoHkDdUX5Yu0IcyKGhz UD2w== X-Gm-Message-State: AOJu0Yx+UbUoFGCapu99N0RPEUhOUv7KviVR6UYDnPKey6ty28suim26 m6XtRzHdInyQmVBO1d7VARLg8XAK8fbpWIEFfMY= X-Received: by 2002:a05:6808:1790:b0:3b2:f54b:8b45 with SMTP id bg16-20020a056808179000b003b2f54b8b45mr23159348oib.40.1698889050483; Wed, 01 Nov 2023 18:37:30 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 86/88] hw/hppa: Turn on 64-bit CPU for C3700 machine Date: Wed, 1 Nov 2023 18:30:14 -0700 Message-Id: <20231102013016.369010-87-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller Signed-off-by: Helge Deller --- hw/hppa/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 43c7afb89d..da9ca85806 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -696,7 +696,7 @@ static void HP_C3700_machine_init_class_init(ObjectClass *oc, void *data) NMIClass *nc = NMI_CLASS(oc); mc->desc = "HP C3700 workstation"; - mc->default_cpu_type = TYPE_HPPA_CPU; + mc->default_cpu_type = TYPE_HPPA64_CPU; mc->init = machine_HP_C3700_init; mc->reset = hppa_machine_reset; mc->block_default_type = IF_SCSI; From patchwork Thu Nov 2 01:30:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740401 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596386wrv; Wed, 1 Nov 2023 18:42:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH21xFSamHrFhbaYhEmFVCNPD4zCAxZAwaGwGxJu+VMnPzeGimgXOJDnDCDD63XHGul8v59 X-Received: by 2002:ad4:5747:0:b0:63d:3bea:f663 with SMTP id q7-20020ad45747000000b0063d3beaf663mr23302349qvx.47.1698889361378; Wed, 01 Nov 2023 18:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889361; cv=none; d=google.com; s=arc-20160816; b=0/jG8c3HV//po9GKPDUSiVry1aEXZmvhCgpDud1zuPuwDbxEN7uc5Rp2pE/A5G2eah 5uDFlk3/Mqo+EWqAluMfGY4E9I1XufT+0dWs8xkflFysFS4jEVhmOB3TeyFPqHPxy2sF JOcBTRSwA1RKLzgb0ReO+LZLCt3djbhM3+PAXOyH2sSRsC8ZhAyo/vqhD1g4lmH89JWL 8XoeNB6QxgipPCOnH5W5VQPJHv4+Cne54xLvMDpXkVMIUElSLkjTLyyZwJaw/KeNDiii mHKDf3ECUEMTs6uwqUEKW34lmFmC5BKXwrZ7CzHpufNTgFNsZIjGnRqyeCNTFUaoDM/a uZIA== 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=LIgodu9H6MNqcm2FpnHbkFw215Q/P+nlqcEfUhnn984=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=oCRw80aALpkB7f9niQdMj71g6OB9f+xgluY0mFwOv3T2lon41aqTcrft7f14C24PJQ 7QulVuIucTlpFVxUQIe0+E9T+qJP31kVaj3k13H5I1FPJAuo8nPylbnUOwd8N+FBykH8 uU8D3wHz2+oGrhOpNakhrHJswEbK6zVTgwkETfAVXalMANoQl2Fu6DtQmkADZpvkKCPP 6SJErdCpGyilEeJC1qQ9o5DcFQFTdhukf4N9g4lp1oUhv9uVsNYUXKSB/RRKBeu842Yl TxXxocZZjP0ktcwzH1W1K8T5nGxuFe7v5hA4XCdnNnwl59cnzLBshsqytX/j6wtwh7TA G06A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n2mceh4a; 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 u12-20020a0562140b0c00b0066d1ca1cb7asi3423236qvj.405.2023.11.01.18.42.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42:41 -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=n2mceh4a; 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 1qyMeU-00076f-Fc; Wed, 01 Nov 2023 21:37: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 1qyMeO-0006U5-D8 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:36 -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 1qyMeM-0004MV-67 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:36 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b2f28caab9so262958b6e.1 for ; Wed, 01 Nov 2023 18:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889051; x=1699493851; 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=LIgodu9H6MNqcm2FpnHbkFw215Q/P+nlqcEfUhnn984=; b=n2mceh4asuF27q/XfGBMLcAaZTPockRpNdCAXXKJR+S5GnF8DFiPUBorrYzTgspWI3 igH0OI/xqE0dzNNw9o2Bnd5r2MsPCgYy0z/2NhzmYJP1jRQhUdHg1oUP+mzu+fWrMhU8 kcjl48Qtq1/q4+7kRXTngJJPKjZoZuQsJayMPEQQR87r0T9mN6JUiQDJTyHC5E4XBaS1 U70YONDs2qo0+J3RK/JHv9kODodHhT8sJFesRs9ujPMR1EIIjeHzEelWfd1qSC7rhmUN cwj2IZgaUJDeyOfcafvDds8O4h1eKAklI29TZfoYI0zoV1iPp7lWXgy+YyqBOoUtRQiG JiJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889051; x=1699493851; 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=LIgodu9H6MNqcm2FpnHbkFw215Q/P+nlqcEfUhnn984=; b=Nv6m3TUIJsbSWn3LCex/5HGVcKsArdnqAJiKgInsedQMWDgW2F/SGZaA0rYtCW+4ZE aEzlstNi6MvYYeX/Ys2P2+PqQ/PJjQuIPYKIH99gXaNjMGP8rZ6kdHYdD3adqadZ7/ey VjBgLlWgHqa1dqcTEkg4W+UKH+Pd7AmjTayG4s7ZTgPTBFAbSyUTHL6POpKghY8QHOw0 2KD+L+Eyia5q5jHXGfjS0SBVCIjjIDdSvznx2hF4MppiSEl7ooMEkPDAfsebB7MA6Ql4 nlpP6FpKIeOf5jpuWn+L/qE6ic4FP29p6+0pI2edNTrmihTtxzopWM0alduv3i3CdY1Q LKBQ== X-Gm-Message-State: AOJu0YzWlF4Wr/rdiy+HDO6ClPGIXEHVtZjkBt1h9S0Ui/87i4/lXGLj UwnbMtlcSCdRz8GiZ07s+9CAI+RoZNvayvlMSz0= X-Received: by 2002:a05:6808:10c8:b0:3ae:251b:5552 with SMTP id s8-20020a05680810c800b003ae251b5552mr23179902ois.12.1698889051341; Wed, 01 Nov 2023 18:37:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 87/88] hw/hppa: Allow C3700 with 64-bit and B160L with 32-bit CPU only Date: Wed, 1 Nov 2023 18:30:15 -0700 Message-Id: <20231102013016.369010-88-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller Prevent that users try to boot a 64-bit only C3700 machine with a 32-bit CPU, and to boot a 32-bit only B160L machine with a 64-bit CPU. Signed-off-by: Helge Deller --- hw/hppa/machine.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index da9ca85806..a3222d3a96 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -528,6 +528,12 @@ static void machine_HP_B160L_init(MachineState *machine) /* Create CPUs and RAM. */ translate = machine_HP_common_init_cpus(machine); + if (hppa_is_pa20(&cpu[0]->env)) { + error_report("The HP B160L workstation requires a 32-bit " + "CPU. Use '-machine C3700' instead."); + exit(1); + } + /* Init Lasi chip */ lasi_dev = DEVICE(lasi_init()); memory_region_add_subregion(addr_space, translate(NULL, LASI_HPA), @@ -602,6 +608,12 @@ static void machine_HP_C3700_init(MachineState *machine) /* Create CPUs and RAM. */ translate = machine_HP_common_init_cpus(machine); + if (!hppa_is_pa20(&cpu[0]->env)) { + error_report("The HP C3000 workstation requires a 64-bit CPU. " + "Use '-machine B160L' instead."); + exit(1); + } + /* Init Astro and the Elroys (PCI host bus chips). */ astro = astro_init(); astro_dev = DEVICE(astro); @@ -659,6 +671,11 @@ static void hppa_nmi(NMIState *n, int cpu_index, Error **errp) } } +static const char *HP_B160L_machine_valid_cpu_types[] = { + TYPE_HPPA_CPU, + NULL +}; + static void HP_B160L_machine_init_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -666,6 +683,7 @@ static void HP_B160L_machine_init_class_init(ObjectClass *oc, void *data) mc->desc = "HP B160L workstation"; mc->default_cpu_type = TYPE_HPPA_CPU; + mc->valid_cpu_types = HP_B160L_machine_valid_cpu_types; mc->init = machine_HP_B160L_init; mc->reset = hppa_machine_reset; mc->block_default_type = IF_SCSI; @@ -690,6 +708,11 @@ static const TypeInfo HP_B160L_machine_init_typeinfo = { }, }; +static const char *HP_C3700_machine_valid_cpu_types[] = { + TYPE_HPPA64_CPU, + NULL +}; + static void HP_C3700_machine_init_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -697,6 +720,7 @@ static void HP_C3700_machine_init_class_init(ObjectClass *oc, void *data) mc->desc = "HP C3700 workstation"; mc->default_cpu_type = TYPE_HPPA64_CPU; + mc->valid_cpu_types = HP_C3700_machine_valid_cpu_types; mc->init = machine_HP_C3700_init; mc->reset = hppa_machine_reset; mc->block_default_type = IF_SCSI; From patchwork Thu Nov 2 01:30:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740391 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596081wrv; Wed, 1 Nov 2023 18:41:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmbnw58PTl9GKwEVFdjXMIBpZWD1HhTQzEmEDhDL/HNPUREsnCMUjs491HAQQLicnrOtkI X-Received: by 2002:a05:6214:21aa:b0:66d:6586:f2b4 with SMTP id t10-20020a05621421aa00b0066d6586f2b4mr20189628qvc.21.1698889285657; Wed, 01 Nov 2023 18:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889285; cv=none; d=google.com; s=arc-20160816; b=fLFrYoju4Myq46uO47vtZJ9LlKE3dcQT9VkoAAbcXOm4YMpkZnQd9OaRNIcjopdsMd AC7aqdtYps+Qa31w2Hjxtzo0ITcq2aaD7iXY0eSAiMVJfWVQMEmWLEbdWyZMBtSRDqNU DhPRY+tTqcZKNy4aFn+Zgq9kxhQYlSCb+BkE32nDP3ke7ZjoQ28MZDwfLqPHFXzSb52+ ZWnLEzhhbcIM/xzAhv0IXAXRXoxTxG14XOP6fH/9sh/kW6m1Hhjr8aD3Kjln5yuIWUvw mCoRZMPDUEqfEzfyC+beaeDDJVhPb64agsRV0iT0nZw/iVSCCOmF365WPCeWqATCyskG JoPQ== 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=pp6zfL97EYv9sP49urhM/V8BoPWbAzzDBRAX05BVoII=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=pY6lHD/4+LOaitbzyMXkXxVVwmEVlrdeXwDA1XNJEYvbZ2zyQnOsB/cleI84GtuNCa gwoI4JsVYBxQx9Y6FCXm9+jjHrXcvXG4iZhlOM0UmCJ4Sh/mkFpfBxx9pkmvtPtJfO4Q +Hp/gmCmKN9/MaWzt3hVF3OyAIVFMv3RL24wjXg7HvonrpxUu92DF6VPCHUwJT7If2UI UiTTTVuZYd/1eWW5ULHhf8V5mQT2xLwVB1RwsBxLFGgNqe6d7uvSzLbo4Y2RB0XOcv7T EnPR0p2KaZL2s2EocE9qwKFrh3GUhw/Z6kU/x5rAjF0n49aqoWC63yzSP3r0VwzB3QaU yNCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vzeeO8lk; 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 b11-20020ad4518b000000b0065d0358ebc5si3579293qvp.394.2023.11.01.18.41.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:41:25 -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=vzeeO8lk; 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 1qyMeU-00076P-FI; Wed, 01 Nov 2023 21:37: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 1qyMeO-0006UG-Eu for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:36 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeM-0004N5-6H for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:36 -0400 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3b2f28caab9so262963b6e.1 for ; Wed, 01 Nov 2023 18:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889052; x=1699493852; 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=pp6zfL97EYv9sP49urhM/V8BoPWbAzzDBRAX05BVoII=; b=vzeeO8lkCdfCUvY8wfa8wteguJdhzHa8tK3HRju6R0eGLM0V2A3A08sQp12jZmv80h 52tWvkDkul2UkKp8vquHKKmi9azWVE/n6+kaj+WXhTrqqrEVlD5rHb22Au/u8QmFb5Ds 78MEQj2sNV2TKo5tR2+ml9K2dS5ZdPBH77Rl7P/+gyd5y3BguuzQC8LkwDJiodu2auIE ZbEfVaVPKWbVAtn6B3tSp0tmN9Y36TxUZvTWO+jm0/rI0gkLGOTLkI7efAqLmE+ZqSf2 eeg+R7eW8dFlIGHqBNylvVohwftPnXYpUPZoD3xp+7VKER5lmzggectd0tTfJcCMI4fu 85YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889052; x=1699493852; 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=pp6zfL97EYv9sP49urhM/V8BoPWbAzzDBRAX05BVoII=; b=nzbWkFeqX5Keh4TKZYMj1i5a86OEVOvYHqtP8+6PpwFun7nf0O8x6iYfnDl5HVla2e kxQ1aakO3ploHcUJ1+T0Kg9VdKdIZ7VQcwSfZmOR7WKJJxeexnuuf9muwPd6TUzsvmso aocN2cNyJ1ZmfyI+Wl0NsAxq/5jk+18XoAkN2rIWZJBHMGbzgk9jO+tmDyvjhAgYSXFQ C2OZ+wG6/LMBpKOJq/qXDhXo9kMpvjrtRMBr0MdRHZbwfGXLB67sSlCAqV5jz1RbncrV AIbzleSMJD/1pTSvXO3CzC3mP65iENCOFhc4lVFz+CelgBAByL23DLBcuaIoDvc67PbR P/8A== X-Gm-Message-State: AOJu0YymzW8n75Hfjw48/LqH7ApwFMw4CohFxjWaD9RJaSIUkhXSlNeq kjTgS/micGg+ImKhxBoX7wEnkGKgLMw2Sg/YkPA= X-Received: by 2002:a05:6808:3084:b0:3b5:75ec:44fd with SMTP id bl4-20020a056808308400b003b575ec44fdmr5916939oib.13.1698889052163; Wed, 01 Nov 2023 18:37:32 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 88/88] hw/hppa: Map PDC ROM and I/O memory area into lower memory Date: Wed, 1 Nov 2023 18:30:16 -0700 Message-Id: <20231102013016.369010-89-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Helge Deller When running a 64-bit CPU in 32-bit mode (e.g. when using a 32-bit kernel) the PDC ROM and I/O area has to be accessible in the 0xf0000000 memory region. Signed-off-by: Helge Deller --- hw/hppa/machine.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index a3222d3a96..e488914bba 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -603,6 +603,7 @@ static void machine_HP_C3700_init(MachineState *machine) AstroState *astro; DeviceState *astro_dev; MemoryRegion *addr_space = get_system_memory(); + MemoryRegion *io_low_alias = g_new(MemoryRegion, 2); TranslateFn *translate; /* Create CPUs and RAM. */ @@ -614,6 +615,20 @@ static void machine_HP_C3700_init(MachineState *machine) exit(1); } + /* map PDC ROM into lower memory region, needed if PSW.W=0 */ + memory_region_init_alias(&io_low_alias[0], NULL, "firmware-alias", + addr_space, translate(NULL, FIRMWARE_START), + FIRMWARE_END - FIRMWARE_START); + memory_region_add_subregion(addr_space, (uint32_t) FIRMWARE_START, + &io_low_alias[0]); + + /* map all of I/O area into lower memory region, needed if PSW.W=0 */ + memory_region_init_alias(&io_low_alias[1], NULL, "iomem-alias", + addr_space, translate(NULL, 0xf1000000UL), + 0xf000000UL); + memory_region_add_subregion(addr_space, (uint32_t) 0xf1000000UL, + &io_low_alias[1]); + /* Init Astro and the Elroys (PCI host bus chips). */ astro = astro_init(); astro_dev = DEVICE(astro);