From patchwork Tue May 23 13:52: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: 684982 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1742723wrt; Tue, 23 May 2023 07:13:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75s/WwFEj59G+UC5I8d2bKQA0uFexYuUHBQ0y67Gy0G4daoziqWossUv8S1KZIQ3Rv50Wl X-Received: by 2002:a37:843:0:b0:75b:23a1:8e49 with SMTP id 64-20020a370843000000b0075b23a18e49mr3959911qki.26.1684851194365; Tue, 23 May 2023 07:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684851194; cv=none; d=google.com; s=arc-20160816; b=RN/02nw1ee38hZ9N8wF2lSoCZ1w9/x/0h/Fa3XNIiT0uyNv5oXUG6MN5C26eQGvZUA Rx6XbW0ozm7gVHx3J38AhuuMv/maA1rl8+ILiK3Y7cnn7ZruOScFm9iqXlVtHl9rGclr lbnYLGHaOhgGMJPEeMClLlE3Ee45/d8nASwQ4MzqUpcbIk1pI5yddNUCX+2Y8oK/v8dK E2ZvACbSizFVp/QzUtgHG2m5Qv9BS4gAL29/gmIhO/QkDek1zrGU7a8jg9UL0CUINvHD qfxyGG/V3AT2PD9na6lskBbMH4WcZVuDDU0eQiXQDxvL/HNG9yTwKRSVK9QKNhYbSh2W o9SQ== 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:to:from :dkim-signature; bh=0B6ZiccHfjA9+3V6I3lMmu3S/Ef9HuPrl6mcYOHXodE=; b=svMbtYRc2Gt3cl7voiviAxMB61Uo2ehARWSC5+qXpE/SPOur71YXMpH4nk8BSwZqIH FV5Vz8ctLlgfrInUng+lR8ZhWMjBKN+H/32MsbQKjdsxAXsOeXzQybQ3RSxQwRHmXn6C X0S/lx/yUY4rgAKW6EVfOTqsER3ZG+g7LqzEw5Rfu4xJN9hBM73MjryRmqb177QqJbhV DmzZWJi5yzZdev2tnL8elFNnRFTs05Y+c+4uyUsSuM+y1b/Jxr2VCpTJaa0HzMuGHaHg Y45NeurIm0G3ZWDwgB/BtIRe2q7m7ll39DlzdBXbmAwoSvcWwqt0PqNdysQFDfzgl/U+ o2TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x4HTLSoq; 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 a24-20020a05620a125800b0074fb646790csi114552qkl.631.2023.05.23.07.13.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 07:13: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=x4HTLSoq; 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 1q1SSi-0005He-FL; Tue, 23 May 2023 09:54: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 1q1SSH-0004bY-TX for qemu-devel@nongnu.org; Tue, 23 May 2023 09:53:39 -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 1q1SS7-0002zu-IM for qemu-devel@nongnu.org; Tue, 23 May 2023 09:53:36 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-64d577071a6so3557887b3a.1 for ; Tue, 23 May 2023 06:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684850006; x=1687442006; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0B6ZiccHfjA9+3V6I3lMmu3S/Ef9HuPrl6mcYOHXodE=; b=x4HTLSoqRgazApQT252BV9W4VbPWh4fLVYMlkxXXuzWRsPUVxVsNhBOZsIDR/39wd/ lgAhhoAN8LLUn39XxhEI/wJi1FPhBoXR8FEjdChwYthZWt1huLzmk3Y/CUaO4tRAammU Iw8ijHkRWs4pm5sSSvgy3X9phoYG2ldNMD6edoAG4pBHfKxseNmeN2AzTJxAsZHgsMId RBxc7l7bEDdSIDQtbJ9VGW6669shAEQDV12QumQcY1zBtcaxEy/V5wDbOmywwY7M0WO4 KHlNHQZYjs+tWBC9Zoqx7tv1NZk3wfcwUMp1F1rHhJZZGGyasFK1WZCTIXyWGFQBsqf+ Hesw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684850006; x=1687442006; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0B6ZiccHfjA9+3V6I3lMmu3S/Ef9HuPrl6mcYOHXodE=; b=So+joKc7LlCVCsUG7l3MjED7A75hVule6ZKzZXAj2ZoiTBZNeldHVoY1EIW4PCpZEr Xuz2T+9xhVW1J2OiZSc4jh8h8ZA0xBiF4eMbFKmRkG4caQuKOeWuy86cOIMzRqMxbZTD FzJdrYphmNHd4znNW4JOG544EjFK2lxdPXsj/GHTrZgzBueHxIpDIyEUmCPnqCk+IZJA zYqlnVr4T/zaqkFbM1fgWDGh28cvxWRLd+x3nrXa6rolGNNyjJUAm8Ubyoq35S+wKNkH 44XFIW9oQj+YVQSJBy+wbPm5rY4BvJA5m84RJ1xvrchRpZqrV9aykx8SgETJfV5EhhzO MMmQ== X-Gm-Message-State: AC+VfDyjFyPJd+DTMmpOhjlYBbkrQQbHX7yGc1I1NmcWTjBrv7xmdiCO Ykbx5IAMaQGmmEgKKlpdpAF8/XSDk4Wf1C7wGyw= X-Received: by 2002:a05:6a20:a111:b0:10c:3535:162f with SMTP id q17-20020a056a20a11100b0010c3535162fmr4770325pzk.0.1684850005799; Tue, 23 May 2023 06:53:25 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:c13a:d73:4f88:3654]) by smtp.gmail.com with ESMTPSA id b8-20020aa78708000000b0064d27a28451sm5796111pfo.100.2023.05.23.06.53.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 06:53:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/52] tcg/riscv: Remove TARGET_LONG_BITS, TCG_TYPE_TL Date: Tue, 23 May 2023 06:52:32 -0700 Message-Id: <20230523135322.678948-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230523135322.678948-1-richard.henderson@linaro.org> References: <20230523135322.678948-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, 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. Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index ff6334980f..45bd09cfc4 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -908,6 +908,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, TCGReg addr_reg, MemOpIdx oi, bool is_ld) { + TCGType addr_type = s->addr_type; TCGLabelQemuLdst *ldst = NULL; MemOp opc = get_memop(oi); TCGAtomAlign aa; @@ -949,19 +950,19 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, addr_adj = addr_reg; if (a_mask < s_mask) { addr_adj = TCG_REG_TMP0; - tcg_out_opc_imm(s, TARGET_LONG_BITS == 32 ? OPC_ADDIW : OPC_ADDI, + tcg_out_opc_imm(s, addr_type == TCG_TYPE_I32 ? OPC_ADDIW : OPC_ADDI, addr_adj, addr_reg, s_mask - a_mask); } compare_mask = s->page_mask | a_mask; if (compare_mask == sextreg(compare_mask, 0, 12)) { tcg_out_opc_imm(s, OPC_ANDI, TCG_REG_TMP1, addr_adj, compare_mask); } else { - tcg_out_movi(s, TCG_TYPE_TL, TCG_REG_TMP1, compare_mask); + tcg_out_movi(s, addr_type, TCG_REG_TMP1, compare_mask); tcg_out_opc_reg(s, OPC_AND, TCG_REG_TMP1, TCG_REG_TMP1, addr_adj); } /* Load the tlb comparator and the addend. */ - tcg_out_ld(s, TCG_TYPE_TL, TCG_REG_TMP0, TCG_REG_TMP2, + tcg_out_ld(s, addr_type, TCG_REG_TMP0, TCG_REG_TMP2, is_ld ? offsetof(CPUTLBEntry, addr_read) : offsetof(CPUTLBEntry, addr_write)); tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP2, TCG_REG_TMP2, @@ -973,7 +974,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, /* TLB Hit - translate address using addend. */ addr_adj = addr_reg; - if (TARGET_LONG_BITS == 32) { + if (addr_type == TCG_TYPE_I32) { addr_adj = TCG_REG_TMP0; tcg_out_ext32u(s, addr_adj, addr_reg); } @@ -995,7 +996,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, } TCGReg base = addr_reg; - if (TARGET_LONG_BITS == 32) { + if (addr_type == TCG_TYPE_I32) { tcg_out_ext32u(s, TCG_REG_TMP0, base); base = TCG_REG_TMP0; }