From patchwork Wed May 31 04:02:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 687241 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1062179wru; Tue, 30 May 2023 21:07:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7O1SZYibmPJyimnkxqpzsOuygEbyHsz9JTI8dVu6PCnt7Ao08V9qzgVOPQwf8qesHNjLjY X-Received: by 2002:a05:620a:450e:b0:75b:23a1:8e66 with SMTP id t14-20020a05620a450e00b0075b23a18e66mr5333711qkp.55.1685506067937; Tue, 30 May 2023 21:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685506067; cv=none; d=google.com; s=arc-20160816; b=xJ7cPQacD0QgyeMq/4VaL0ppICSXK1nk/I9imY8zC4cSjEthNpmCjhqNEoexgEcFgR rVX4dKmKhTWZEwYInlaWq4YzZWZ0vwi1we1bzqSHJow2i/BKa36ZO1u+i+vdOtuysuOb fFjDYbtd7ZwjZ7Fo6pdf2+LW4UcnFco2IZkjld5EUKVWGsm51K/P8ThwPhW3Nvsl1ukE LGZTFbYuSI7Yb7E1G5eIy1dHYmslClLQM4Yklnri4H/v2uiZpDX+FmeVf5foojKbZ63K O9qjjm5Z/b8OOudMt999hwpRQLlXOU0ZwXea2YYqzf/s7pg93qdRUqjMuX2Hl4vyvJb8 jAWA== 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=HuKPUxDGV5EbEHS0l7HHEyBvt46JE0G0h+SE5I0Z/rY=; b=hPV5YbPQuzhqGakjOqFMiVPd+/BUwIo7JbcZqW8wbI+LsEJcnuE+BuAVRV1KcwmomF OrLldKISMyVoJOvXgb2jwA8TC3ah92C8KRD0m8ZAEea6dcpuDGbb4U52cAJbp7W4hhA5 bDQw/giJQXvojZ6mkhF/UJVSyWHwgEzfR2oBjCWaQIRmrCxXENSBGpXYXotY4YxUD7/i XoFTWGDoolZLLvrQfczr7PKaeAAbTOlztEkLb4kdjHoejX2iaHFqNH+ZrdeFZ5HTJtax o3qbOVTbYlXLjaCfxq7WxRDAfCA7SXD56EQDPCEUMGjPnb8SvWzwRfKoCQ+wTjtqrJPs Z7pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OJMEILMN; 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 g28-20020a05620a109c00b007587e72f024si1991939qkk.660.2023.05.30.21.07.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 May 2023 21:07: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=OJMEILMN; 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 1q4D3t-00076l-W7; Wed, 31 May 2023 00:03: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 1q4D3j-0006pv-PU for qemu-devel@nongnu.org; Wed, 31 May 2023 00:03:41 -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 1q4D3h-00069W-3M for qemu-devel@nongnu.org; Wed, 31 May 2023 00:03:38 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-64d3e5e5980so6121226b3a.2 for ; Tue, 30 May 2023 21:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685505815; x=1688097815; 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=HuKPUxDGV5EbEHS0l7HHEyBvt46JE0G0h+SE5I0Z/rY=; b=OJMEILMNeoDqC0ANsGp2Q+1pyQjN38TWq354sGEbX+ZJKbEWNyCeeTGxB5HOhiSiYS XWPIcDa3Jb+b2lgN0OLz5F6DBkfcpO4WkEuceyR39z73WuZrve/+7Tn3azQwgIjf9r3x gnViGJjexC9iE4m7xDA1YEp4Q+edVKpP2Nu/l3hvymSA7g55EHYZcLM23Lc9g9BajaDH jsVIxFQHMasDQxjf9hO/VA6mrDZ7HeNL2i8OxpYaAVe4isgOjl+THUCXBhLkOKYVPiGJ 6bBDTs4xYxLA7yzLhbx9NJXbLXuRTbnVty+ErxUXjlT3NMnfLQ4Z4I2O2oZ4JEPXJObz M9cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685505815; x=1688097815; 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=HuKPUxDGV5EbEHS0l7HHEyBvt46JE0G0h+SE5I0Z/rY=; b=GT/0w0kbD2hfG+5dRa6XuEWKiz/bDyvgIkzgT+CZ8+HCvEVyuXd9q0dJLSI6mq3xHY XLRhMNvp1eA6Z/M28Oi5DGWq45xGDnBatURrFt9Xo9h+uIHbt2TVH/k/1cF58S/eNOiP p6Ox0wl6+oiwAy143mKwHy35oIs5rS4UUCgDHXBO5fq0AqbLnls+V4mGy3chmxUshg7e ecqwzrSMXd1BzcaGjmS8LuwruWhjZiPiaEKmUWq7EOD/2BC6n0gXlhUWgUrPJ/j7yer3 zuKBGKnXcfBo1CtY+zxcyFPeQfrqua83O+P9tXdtVHuPxV2s79yuCNeeMygZ3ETUSIKi 9t9g== X-Gm-Message-State: AC+VfDz0F5erECnMQfTdQRU2TDIzYxYAl5CMoxzTXNAms3zmxf1TIP6S lOu+azaqUd6EmZCtsGKsXv1hbcJYgUjXYgNHGzQ= X-Received: by 2002:a05:6a00:1988:b0:63d:2d99:2e7c with SMTP id d8-20020a056a00198800b0063d2d992e7cmr5068377pfl.0.1685505815140; Tue, 30 May 2023 21:03:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 21:03:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 05/48] tcg: Move TCG_TYPE_TL from tcg.h to tcg-op.h Date: Tue, 30 May 2023 21:02:47 -0700 Message-Id: <20230531040330.8950-6-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::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 Removes the only use of TARGET_LONG_BITS from tcg.h, which is to be target independent. Move the symbol to a define in tcg-op.h, which will continue to be target dependent. Rather than complicate matters for the use in tb_gen_code(), expand the definition there. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 8 ++++++++ include/tcg/tcg.h | 7 ------- accel/tcg/translate-all.c | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 35c5700183..844c666374 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -722,6 +722,14 @@ static inline void tcg_gen_concat32_i64(TCGv_i64 ret, TCGv_i64 lo, TCGv_i64 hi) #error must include QEMU headers #endif +#if TARGET_LONG_BITS == 32 +# define TCG_TYPE_TL TCG_TYPE_I32 +#elif TARGET_LONG_BITS == 64 +# define TCG_TYPE_TL TCG_TYPE_I64 +#else +# error +#endif + #if TARGET_INSN_START_WORDS == 1 static inline void tcg_gen_insn_start(target_ulong pc) { diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 072c35f7f5..0da17f1b4f 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -292,13 +292,6 @@ typedef enum TCGType { #else TCG_TYPE_PTR = TCG_TYPE_I64, #endif - - /* An alias for the size of the target "long", aka register. */ -#if TARGET_LONG_BITS == 64 - TCG_TYPE_TL = TCG_TYPE_I64, -#else - TCG_TYPE_TL = TCG_TYPE_I32, -#endif } TCGType; /** diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c87648b99e..97f116312a 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -356,7 +356,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb_set_page_addr0(tb, phys_pc); tb_set_page_addr1(tb, -1); tcg_ctx->gen_tb = tb; - tcg_ctx->addr_type = TCG_TYPE_TL; + tcg_ctx->addr_type = TARGET_LONG_BITS == 32 ? TCG_TYPE_I32 : TCG_TYPE_I64; #ifdef CONFIG_SOFTMMU tcg_ctx->page_bits = TARGET_PAGE_BITS; tcg_ctx->page_mask = TARGET_PAGE_MASK;