From patchwork Mon Jun 5 20:14: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: 689223 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp2285152wru; Mon, 5 Jun 2023 13:16:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+ovniIDWJkBPGj4kmjwe7Mi99i9DAZ8GzI3jD8A2RYHgXlElQbht98Q5x0e5Tha2P9LKC X-Received: by 2002:ac8:5a12:0:b0:3f2:ba:62b3 with SMTP id n18-20020ac85a12000000b003f200ba62b3mr10835391qta.32.1685996199092; Mon, 05 Jun 2023 13:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685996199; cv=none; d=google.com; s=arc-20160816; b=S7KaUQo2MTXlhD7vxrkUwiM9XWbOYAbHGr54mBf1Zd/pCpnt4fZFraIrM03uwWfQKw l1A4Exebq+TFOudPTuwfkIgZDuPYS6A+x+v+yPe7QaSKqkTcU6Tm1GK5WSidAesh9KzT LFioYwQs4oVhvBycThKxGGEKYo98BPld4Q8PZMJanAo1SksSRSGKwnwDbemzejww7C4Q qk+gwSfLZR+Hipa4NPdiyHSMFlJt47L9DmkDpaincAIavZv7hBKfplUWxoGV7kfoeLTy St/J6NV2KNZFKNwKK9ie0FT2HWFdWEjcfhYwUHeVILvS2ZopmsfwgeBspcTeBL3PyK3i SvGg== 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=nn9Tf0IYWBrZfMOrfRS/Ef1buY3fjYVKvOc76GeHvCA=; b=uEZZcKG34v3Xy3ZO5ClX9TfmQy+jf/juMQqJj8n86ckwGSV8yejtctYwVCOKBdj6pZ YaxFlzlpJ4bsX1VHh+ROcoKZ45Wy7bkJF4CnLOr+vRsmccBLpv/I96A1N6nnMjx5fj+g Ed/6/N6pDgYEm3SK2gfVFY0lx5eMzECEtvVMgJtmtQR+m9/LZ/tV520T8gm19I3m5hT0 +UeTdH6K0BvCfOkciCTiyadGFsxCTqOgVVD1gX/97mln0eOGskAj7ohpfd55R6wOARNt yePU6WaZbHK0rJlyC9n4IrY3tewSullIvI+DGBTuQ5CZObIMfArZZ+2iUzloM10VPj9S sXhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KCrV7zhJ; 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 q18-20020a05622a04d200b003f6b8d11c28si5005201qtx.477.2023.06.05.13.16.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Jun 2023 13:16: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=KCrV7zhJ; 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 1q6GcP-0001ku-Ts; Mon, 05 Jun 2023 16:15: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 1q6GcN-0001jk-6Z for qemu-devel@nongnu.org; Mon, 05 Jun 2023 16:15:55 -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 1q6GcL-0003hV-Di for qemu-devel@nongnu.org; Mon, 05 Jun 2023 16:15:54 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-655fce0f354so1323077b3a.0 for ; Mon, 05 Jun 2023 13:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685996152; x=1688588152; 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=nn9Tf0IYWBrZfMOrfRS/Ef1buY3fjYVKvOc76GeHvCA=; b=KCrV7zhJ+UOYsowtRaEFl85GmaY1xbIKl/A+DaW372OWXJHu9syEE5cws43Uv/EFf/ pScFA+p4+Ns51B0GR98VMgXTDPTN0uPMdEhCncwBgWxJSDp/B+4dWueyPov7NRzLnfRo xi9694V4X1vArQl5/qXOpPXJlnB6SuQzBlHOniAsilNyhC+4xp8EW++1OB8xetLEAjTz Utu8y8QSKnWHG0HUnMwy413UlI/tGiBgfyGeaqYgu1N30IUnZeeI0ud2mBRuO+7f4uOG uqQIGDkyC3dMERDYoEIp3wCOXyZqZMF8SduAvdZUq2B9Z8z/QG5Agj3zVT007knHXmUo 6OgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685996152; x=1688588152; 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=nn9Tf0IYWBrZfMOrfRS/Ef1buY3fjYVKvOc76GeHvCA=; b=dNAQh6OtUFltJS1Npk2q8m0y5mrPoEJyJ2pp00vGJ0dmoBV+kwb2QxDLyoSBy8IFuv ZgGjXO75UElpT+lO2hUqvN3WpHhV5kyzT5moeqQToqdKykMuvIEWwQYQonUM0as9YDXC faY80t6YnAet0m/8PvkukfdnhEQ+/fRUjBXLJDLfy9jYXbZrlym3hpRkhjwy7aw1A0Zx CUMgqAkE9mkVo3YPQlegsOtXgfRXFtZaaCw+zceQVr4itkaKedz9sIijNtElVu2q0/mD +AXJzotsSWJpEHa+ZC/yPgSwGkdosTWNzfQakt/YTrXC3LmrxB5vITiupF2NgGsW6W8D qQxQ== X-Gm-Message-State: AC+VfDzQSdII1TWGRc+BRyodyC/2u/J/i2zogKQ+psr0OfIcZpZRAfc2 KK/5msT7G8mN0bVoJsMcrSIpS9GSSAUN2CMX0Aw= X-Received: by 2002:a05:6a00:850:b0:653:b76d:4d62 with SMTP id q16-20020a056a00085000b00653b76d4d62mr1029119pfk.24.1685996151923; Mon, 05 Jun 2023 13:15:51 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:3f85:a600:6a3e:e465]) by smtp.gmail.com with ESMTPSA id f18-20020aa78b12000000b0064d32771fa8sm5552924pfd.134.2023.06.05.13.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 13:15:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 01/52] tcg/ppc: Remove TARGET_LONG_BITS, TCG_TYPE_TL Date: Mon, 5 Jun 2023 13:14:57 -0700 Message-Id: <20230605201548.1596865-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605201548.1596865-1-richard.henderson@linaro.org> References: <20230605201548.1596865-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 All uses replaced with TCGContext.addr_type. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index d47a9e3478..11955a6cc2 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2046,6 +2046,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, TCGReg addrlo, TCGReg addrhi, MemOpIdx oi, bool is_ld) { + TCGType addr_type = s->addr_type; TCGLabelQemuLdst *ldst = NULL; MemOp opc = get_memop(oi); MemOp a_bits, s_bits; @@ -2098,17 +2099,18 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, tcg_out32(s, AND | SAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_R0)); /* Load the (low part) TLB comparator into TMP2. */ - if (cmp_off == 0 && TCG_TARGET_REG_BITS >= TARGET_LONG_BITS) { - uint32_t lxu = (TCG_TARGET_REG_BITS == 32 || TARGET_LONG_BITS == 32 + if (cmp_off == 0 + && (TCG_TARGET_REG_BITS == 64 || addr_type == TCG_TYPE_I32)) { + uint32_t lxu = (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32 ? LWZUX : LDUX); tcg_out32(s, lxu | TAB(TCG_REG_TMP2, TCG_REG_TMP1, TCG_REG_TMP2)); } else { tcg_out32(s, ADD | TAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_TMP2)); - if (TCG_TARGET_REG_BITS < TARGET_LONG_BITS) { + if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { tcg_out_ld(s, TCG_TYPE_I32, TCG_REG_TMP2, TCG_REG_TMP1, cmp_off + 4 * HOST_BIG_ENDIAN); } else { - tcg_out_ld(s, TCG_TYPE_TL, TCG_REG_TMP2, TCG_REG_TMP1, cmp_off); + tcg_out_ld(s, addr_type, TCG_REG_TMP2, TCG_REG_TMP1, cmp_off); } } @@ -2116,7 +2118,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, * Load the TLB addend for use on the fast path. * Do this asap to minimize any load use delay. */ - if (TCG_TARGET_REG_BITS >= TARGET_LONG_BITS) { + if (TCG_TARGET_REG_BITS == 64 || addr_type == TCG_TYPE_I32) { tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_REG_TMP1, offsetof(CPUTLBEntry, addend)); } @@ -2151,7 +2153,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, } /* Mask the address for the requested alignment. */ - if (TARGET_LONG_BITS == 32) { + if (addr_type == TCG_TYPE_I32) { tcg_out_rlw(s, RLWINM, TCG_REG_R0, t, 0, (32 - a_bits) & 31, 31 - s->page_bits); } else if (a_bits == 0) { @@ -2163,7 +2165,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, } } - if (TCG_TARGET_REG_BITS < TARGET_LONG_BITS) { + if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { /* Low part comparison into cr7. */ tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, 0, 7, TCG_TYPE_I32); @@ -2183,8 +2185,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, tcg_out32(s, CRAND | BT(7, CR_EQ) | BA(6, CR_EQ) | BB(7, CR_EQ)); } else { /* Full comparison into cr7. */ - tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, - 0, 7, TCG_TYPE_TL); + tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, 0, 7, addr_type); } /* Load a pointer into the current opcode w/conditional branch-link. */ @@ -2211,7 +2212,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, h->base = guest_base ? TCG_GUEST_BASE_REG : 0; #endif - if (TCG_TARGET_REG_BITS > TARGET_LONG_BITS) { + if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { /* Zero-extend the guest address for use in the host address. */ tcg_out_ext32u(s, TCG_REG_R0, addrlo); h->index = TCG_REG_R0;