From patchwork Mon Jun 5 20:14: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: 689247 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp2287902wru; Mon, 5 Jun 2023 13:25:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6FF74Bl5h9Eo2CpLaDMD9aE8VFWHpdBsugjftAWpTEjd8EB7tUN2OgGjzcDgMPw2G6lEFQ X-Received: by 2002:ac8:7f8c:0:b0:3f6:910a:aace with SMTP id z12-20020ac87f8c000000b003f6910aaacemr10808538qtj.23.1685996702986; Mon, 05 Jun 2023 13:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685996702; cv=none; d=google.com; s=arc-20160816; b=SABSXxV49VAhdjPcqTnzPeMY7AGWv0KOc8HhTmeRvgtOcHdZMS3LfN1f3IoILMP0xn 8gVzlkpOLjL0JNQOX2SdfnlPh/QY4oOMBxyAwZIFZjm73c0E7Zh6KbhJa06dHY32ClMn r8Ga50Ptza9nZWAbMuofsRGFlQBbbIJV2PwkzLwwC3t31M8CIXuu8NjLIDinlkSHiIAc a6KYV514g8hxiTyEDM+bIWVCfO1juzO+qIGPBXy9seTRfWSRzfU5NzTdjjKMdYnTyhC+ AYIO4dvNFIg67vbVMbYCwt4M5pgEcLZQpomV+sahJASHZQQbVvWLd+o55EclDbHMmF6q MnxQ== 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=Zq0inShA79yUCPfBvlF6JU5DFl9lHhMswh4eTv6SbBc=; b=PfjuIqdA7i/s1luf9UIH3LBmp7oMiSp0FtJXimMEjhSKZj/I9p5eyiKr3d3m63L6Fk WTyjUpsOqpiZwdQKZtKTPoTaClgFnytAdCHcM2W6tZkC99LuuFh9t/CQNYwnoMsVcdGi O/kp3sM2P4E8F2OTgLlZPtbB3gmX8DmJyRyQxTszpe2eDbeeZR/sOlROSo8t12k0TKl5 jDb5EdJFSFA4U/+ZYl2JdrYHnBvMpiWXwD0OSgBexjjY7GcUWGHqCnuG9crJ3olCqE3v dHJQ+bK/mTvQtK21RR4jNiIHk6eomZQc1zpK1Xh8iHvTdAYqevsPBmlO79nVr9s26g93 zlAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MWeAP5Cx; 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 b14-20020ac87fce000000b003f4f44d9676si5267495qtk.615.2023.06.05.13.25.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Jun 2023 13:25: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=MWeAP5Cx; 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 1q6GcY-0001pu-Jm; Mon, 05 Jun 2023 16:16:06 -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 1q6GcU-0001oD-ND for qemu-devel@nongnu.org; Mon, 05 Jun 2023 16:16:02 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q6GcM-0003i3-3X for qemu-devel@nongnu.org; Mon, 05 Jun 2023 16:16:02 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-65242634690so2955183b3a.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=1685996153; x=1688588153; 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=Zq0inShA79yUCPfBvlF6JU5DFl9lHhMswh4eTv6SbBc=; b=MWeAP5Cxoduu0+5FavthYhr0zcLw7TZ3N6oqn/JWCfC77aGzGR3Ekgcmpk6HLt4MHa yDNb1NWTJAxQU4c6ty7Ly2M/m0CsZDY2Skn32GFT2AElXLiMeaSnoT5Tya5jHVZiHiib TkYZ0cyLnOkSda8U6DErDCmnlzoMXQkqhM0g20UWZ/WI4OIt6NX1zZpG4ESGHA5vFVqL O6m5hSoV/RI8o/ElzymRawQ2KLrDc+9dbq1R7aBpE+KU1D23slDDkukHZDse/f7HXVFQ 1yGtZ0XeOIrbW0HLrfWPdQpxFK+kGV6CHR0qjNi6tcKC80TPa20E+w1DpMQoHUA+wu37 5vUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685996153; x=1688588153; 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=Zq0inShA79yUCPfBvlF6JU5DFl9lHhMswh4eTv6SbBc=; b=UvlXg2S5IUdlzDG2NOUHUqWOlEPQf2D/7eP3Wju1bUyeLTVHYqpjqWH7kzWjnv+a3p 4t2pC8UNICnlNgdPIEI2Kaj6h7ndYCBEPPYe4Wi25SxysijhJPAA7qtCoSekGN5GfRLE bGGJAtJSPQTWk9XwXwhRNkvdjebpW09bMIV2jL45A8wNJHduKqNuxvHZhAdxu0VlA+pl NNIZRM664/UThCrPESAlmzblk+1hxceMqxSCdv+hwTOBt4aIPDXRIC442as5OS+RrcGb w6cpm30AE174MgVh7tYWjN+KiVFZfA9v76y+Sb0/RoVmOMH+vsZNLIankMCd7nykC6nG 5kxQ== X-Gm-Message-State: AC+VfDwV216IO2r4rkxaoLQJaYtqXy/PVI9FyRUrEuTGc/ewgyZ+QLCE +Zh9Cz4kRoaMBigmckRo3SC60q0wpX3V3UVwnzI= X-Received: by 2002:a05:6a20:8f09:b0:101:1951:d491 with SMTP id b9-20020a056a208f0900b001011951d491mr166183pzk.6.1685996152742; Mon, 05 Jun 2023 13:15:52 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 13:15:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 02/52] tcg/riscv: Remove TARGET_LONG_BITS, TCG_TYPE_TL Date: Mon, 5 Jun 2023 13:14:58 -0700 Message-Id: <20230605201548.1596865-3-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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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 All uses replaced with TCGContext.addr_type. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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;