From patchwork Wed May 31 04:02: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: 687233 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1061232wru; Tue, 30 May 2023 21:04:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7jODBnCxdDubzrTVUy/faIaUC0wdv9/m0RJJrh5y2zmBam8jyDoXCvLxNT65hgxhC+WaFD X-Received: by 2002:a05:622a:15d1:b0:3f6:9cfd:ca49 with SMTP id d17-20020a05622a15d100b003f69cfdca49mr3967728qty.58.1685505857645; Tue, 30 May 2023 21:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685505857; cv=none; d=google.com; s=arc-20160816; b=DFudv4ZontFcm5Vp/gMRBTz2YeC90NNkogldXThc/GHNoj+Jy2/9SJBIwnvYCOf2+y fStw0U+q+MvA2AvdMjePxiE05hea5eDS4JBNQa1e0cnF/1VZ1R612Qz98x/fWWluQx4m L3fzXtRXcYZNs8lzzDCX9nYgcl0Kljux1pPee2739rfkQzmd9HPGhgUi1ilrjOD1VUkY 0IxI8aIQsSL1BSAml0ZY98aV4yK7izDJ/cqLZiR5FyqarJwCNIZb1dxKlCW7Ygg9o/zl wfBMFQ3Uurzd+FD31o1+25Bv5msvocTQYMBGdBNkeM9CeyGYPjoYpA17A4IOyE6yadQH jcww== 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=kh1osczTPDGp8x+f+m9a8kz2OfGPlp3T/ofnmQAjdR8=; b=Ki+57/765iH1c+gmhHoDOjaiqnfHC49x/exmmBehB+7UADYyfk3Cw7Eez6yxW5ZmS1 1mmLlB2ff3o5MfhvohQq9lLoxkUd2FQDdak3oYiqjTcCSUYnrDbOMmqnUB0Y9VNlNqa/ 5PSS8rH/zsXEZDcrupAYVIu9XYx8RDgDGo3kIOGNiwRQS44es1UCVOjaWADtepCQcGl7 BnF7hsk26AIBGb2w0srETRtC774vJeRjOl4W3uO53I2FyTiAyq60xlMM0ZISfH8oWCU7 jI8omiNfu7x5M0eZr7TsOYGp9yySyZpdIepWIFieFWV7bJoEErzUmgIy3wmZtC23/BNG USjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hx9oDB0b; 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 z13-20020ac87f8d000000b003e96dcde986si7643408qtj.692.2023.05.30.21.04.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 May 2023 21:04:17 -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=hx9oDB0b; 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 1q4D3j-0006pZ-Jx; Wed, 31 May 2023 00:03: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 1q4D3h-0006or-9n for qemu-devel@nongnu.org; Wed, 31 May 2023 00:03:37 -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 1q4D3e-00068v-BZ for qemu-devel@nongnu.org; Wed, 31 May 2023 00:03:36 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-64d2467d640so6071947b3a.1 for ; Tue, 30 May 2023 21:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685505813; x=1688097813; 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=kh1osczTPDGp8x+f+m9a8kz2OfGPlp3T/ofnmQAjdR8=; b=hx9oDB0bM6iK+loHMxHXp8+gos4W/gWEHDzZflJhRmhnuHp0gXzPilSrXEtNHafOnk O8Sx+GDpFvR5PihK1hKlNaUEnt8lGUWXcdaFgaXV/kv7Pyb4/ap/pVA3DTS5TqhYreoS WDtTNIWM9IsSIERN1/C4M0W9yRmbiReNlGUDVHq8YPrGOw/jMDTtW+j5AJ2CoDE8MtzG Y8+wwQ01j31P7uwuMqpAc5Y1v7Gb1hEPuxDsRgERoZWVw4Qh21wXFrT0aYJ4SRnhW1PT h3/c1sFBD1QR4SfymzDyJ9A1eDjg9gzYECd6VCwie70UNmI457EgqI7n9K03zpOu2vqG 1beQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685505813; x=1688097813; 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=kh1osczTPDGp8x+f+m9a8kz2OfGPlp3T/ofnmQAjdR8=; b=Ly5i2FtJlhrTYLiwicxE27U4W8M9VuBRRsYGvK8voOhtOTljSQ8yPBGNiRCCwEcdwI l7R2HNMtGgYDUMHGXdkt0oRPoAGeZ6D6efRVdnAY00KP1m+kmlrSJcsGrvvui2rsJyPt 8tA3AAfzmiZKsdlsIGZHlUqT+LSmvteqyV8dDjl4eqiQxlTEXpl29gSZxWWvhc2a7nSN ghbb0OjpezYjxFXv491TREQqPF4lq5UH8Ls6Ob+kQdto6FMhb+JxHdlfR8cDSSoSmnjl 74mqGuFV9Rd7CpDqxnGcugLODbvGcM9onN7PeKTs8wRQTsdgn6wk3NbLzbZWKQ4ZaT9e DW/Q== X-Gm-Message-State: AC+VfDwHRcK+2d34zI0UEF2lOFQQcvR6AmuoeA+EKCGzgA2Zc81SSpHY xy84hVJN7t9Ok+dBZCKP2g0rRt1e5JRCkGsLegc= X-Received: by 2002:a05:6a20:2d23:b0:10f:195f:6556 with SMTP id g35-20020a056a202d2300b0010f195f6556mr4093367pzl.31.1685505812855; Tue, 30 May 2023 21:03:32 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:1cd:ec7a:a720:ce9a]) by smtp.gmail.com with ESMTPSA id j12-20020a63fc0c000000b005348af1b84csm194814pgi.74.2023.05.30.21.03.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 21:03:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 02/48] tcg/riscv: Remove TARGET_LONG_BITS, TCG_TYPE_TL Date: Tue, 30 May 2023 21:02:44 -0700 Message-Id: <20230531040330.8950-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531040330.8950-1-richard.henderson@linaro.org> References: <20230531040330.8950-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 All uses replaced with TCGContext.addr_type. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/riscv/tcg-target.c.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index c0257124fa..a8f99f7e77 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1195,6 +1195,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; @@ -1236,19 +1237,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, @@ -1259,7 +1260,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, tcg_out_opc_branch(s, OPC_BNE, TCG_REG_TMP0, TCG_REG_TMP1, 0); /* TLB Hit - translate address using addend. */ - if (TARGET_LONG_BITS == 64) { + if (addr_type != TCG_TYPE_I32) { tcg_out_opc_reg(s, OPC_ADD, TCG_REG_TMP0, addr_reg, TCG_REG_TMP2); } else if (have_zba) { tcg_out_opc_reg(s, OPC_ADD_UW, TCG_REG_TMP0, addr_reg, TCG_REG_TMP2); @@ -1287,7 +1288,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, if (guest_base != 0) { base = TCG_REG_TMP0; - if (TARGET_LONG_BITS == 64) { + if (addr_type != TCG_TYPE_I32) { tcg_out_opc_reg(s, OPC_ADD, base, addr_reg, TCG_GUEST_BASE_REG); } else if (have_zba) { tcg_out_opc_reg(s, OPC_ADD_UW, base, addr_reg, TCG_GUEST_BASE_REG); @@ -1295,7 +1296,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, tcg_out_ext32u(s, base, addr_reg); tcg_out_opc_reg(s, OPC_ADD, base, base, TCG_GUEST_BASE_REG); } - } else if (TARGET_LONG_BITS == 64) { + } else if (addr_type != TCG_TYPE_I32) { base = addr_reg; } else { base = TCG_REG_TMP0;