From nobody Sat Jun 29 03:05:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1610051027; cv=none; d=zohomail.com; s=zohoarc; b=O0YGRtkeWcXVKrtUdvG61fATHQlXIQNlzjti6EZ1Mt/AGlL6l4HrpmH/Y1c7OKB1P+44p+FwHyMGPx/si1sOs+5XA6lIBx2oVJFtAx3rxyNbUSoJTVxN28Yqk+gzm6xajIzAgc7EHhAuwk4yUJeIx/9ns4qpmieLAdNi5qHce88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610051027; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yHpWBji5XIjin1o+94tFD6CTmKluj6DDVpJFH1M81zM=; b=BRJhiiJu8j4eC/XUDH1Julvxk22/svHwVJUBuk+qoY3SPFpGwDx6ykWF+0uisTLEcrGwjjaOztsw9f+Urga7vD5k3hkHbLykTTYg4MXp8ZVgb/+glFM64jvlr/sqx7I2/LJIfuSuP/rils5XHjDQnvAUXX7rXuScYotwxv9xVVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610051027322649.9826409872261; Thu, 7 Jan 2021 12:23:47 -0800 (PST) Received: from localhost ([::1]:39732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxbow-0001V6-56 for importer@patchew.org; Thu, 07 Jan 2021 15:23:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxbgw-00017M-96 for qemu-devel@nongnu.org; Thu, 07 Jan 2021 15:15:33 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:35542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxbgm-0001VB-9H for qemu-devel@nongnu.org; Thu, 07 Jan 2021 15:15:26 -0500 Received: by mail-pf1-x434.google.com with SMTP id c79so4568120pfc.2 for ; Thu, 07 Jan 2021 12:15:16 -0800 (PST) Received: from localhost.localdomain (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id v6sm6516265pfi.31.2021.01.07.12.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 12:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yHpWBji5XIjin1o+94tFD6CTmKluj6DDVpJFH1M81zM=; b=P5DOXmM1mnEfORNJDTYzyWWej81LEumEDrNnQv+1j/mEglTGQOoG3pmTerVB//E/go PkMoedUcksFx+j2igBCnlhD1obvMDbTXw/I4HevxqlQasPSCyTHP8oC++9GQKyzfRRYe goO6bhXdjnf2eFjUuZSAfXbHcgA0Ic6swPCHATyjLXvUbumOlsxjDLjVW2JriQ/Dmqy5 UC3iqs9X32OLzYD2t9CR4zSv859SkySDssTAPzwccmewH7M1fD6/VbrLSlRPCR1BraxT Q8HFaPUcIDr5rG48VO7zUNqo92TpD3oQShK2R5IfH80m6UW2JyQaniJZteFKfCCneA8Y 7zQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yHpWBji5XIjin1o+94tFD6CTmKluj6DDVpJFH1M81zM=; b=EC4qg5b5B7CT3ioPrYiSnY6aX6skUc7LAEYJ9drg3t/0GhG+d7RmDAPEpcME6FfJNR FXQ164sZJxmnVJ1zjvqtYbEPi+Nc4ZVg51MH0JH/AcInlshCcjWdprtx1jxTOu3auIvx moVwIb8HqWZNRIb/rwMDbNnfRwsvxjwS7JXsMNd0qpP7Qhgj+ixX3y7qnKsBWiJZcG+w SY8aD5FBeFOllOovo/IDYSMy9AuJtTN3DKHNTnV5o5+u1HiBOeeyRoMKcE7IGSWxu4VX SortWkVzMKy1hsv38+P7hORUc9FWFXIGxqwzk9n9PzevbQmFTMxcERbkmbCnoKC56eX6 JvdA== X-Gm-Message-State: AOAM531Rcss+qQuAIon2leaNtHSldygMQegBjx5g+8gyhKcs1srkFVV9 w0k/wIV68/rgOjt4MyrB/o+Qd8QjJsoWGQ== X-Google-Smtp-Source: ABdhPJyEFsmXi3fF9ZeTiSOzCO8qVSuvEVCH0oS/Unzxuqc532yvExpysJpKId6JSMdJeX4Gc6bniA== X-Received: by 2002:a63:f608:: with SMTP id m8mr3439872pgh.11.1610050515842; Thu, 07 Jan 2021 12:15:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 13/47] tcg: Adjust TCGLabel for const Date: Thu, 7 Jan 2021 10:14:14 -1000 Message-Id: <20210107201448.1152301-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210107201448.1152301-1-richard.henderson@linaro.org> References: <20210107201448.1152301-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Joelle van Dyne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Change TCGLabel.u.value_ptr to const, and initialize it with tcg_splitwx_to_rx. Propagate const through tcg/host/ only as far as needed to avoid errors from the value_ptr change. Reviewed-by: Joelle van Dyne Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- tcg/tcg.c | 2 +- tcg/aarch64/tcg-target.c.inc | 2 +- tcg/arm/tcg-target.c.inc | 2 +- tcg/mips/tcg-target.c.inc | 5 +++-- tcg/ppc/tcg-target.c.inc | 4 ++-- tcg/s390/tcg-target.c.inc | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index b769e868bc..e9af279738 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -261,7 +261,7 @@ struct TCGLabel { unsigned refs : 16; union { uintptr_t value; - tcg_insn_unit *value_ptr; + const tcg_insn_unit *value_ptr; } u; QSIMPLEQ_HEAD(, TCGRelocation) relocs; QSIMPLEQ_ENTRY(TCGLabel) next; diff --git a/tcg/tcg.c b/tcg/tcg.c index 7bf441979d..325e439cb7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -306,7 +306,7 @@ static void tcg_out_label(TCGContext *s, TCGLabel *l, t= cg_insn_unit *ptr) { tcg_debug_assert(!l->has_value); l->has_value =3D 1; - l->u.value_ptr =3D ptr; + l->u.value_ptr =3D tcg_splitwx_to_rx(ptr); } =20 TCGLabel *gen_new_label(void) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 76f8ae48ad..96dc9f4d0b 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -1306,7 +1306,7 @@ static void tcg_out_cmp(TCGContext *s, TCGType ext, T= CGReg a, } } =20 -static inline void tcg_out_goto(TCGContext *s, tcg_insn_unit *target) +static void tcg_out_goto(TCGContext *s, const tcg_insn_unit *target) { ptrdiff_t offset =3D target - s->code_ptr; tcg_debug_assert(offset =3D=3D sextract64(offset, 0, 26)); diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 1e32bf42b8..f8f485d807 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1019,7 +1019,7 @@ static inline void tcg_out_st8(TCGContext *s, int con= d, * with the code buffer limited to 16MB we wouldn't need the long case. * But we also use it for the tail-call to the qemu_ld/st helpers, which d= oes. */ -static void tcg_out_goto(TCGContext *s, int cond, tcg_insn_unit *addr) +static void tcg_out_goto(TCGContext *s, int cond, const tcg_insn_unit *add= r) { intptr_t addri =3D (intptr_t)addr; ptrdiff_t disp =3D tcg_pcrel_diff(s, addr); diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index f641105f9a..a3f838fa51 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -144,7 +144,8 @@ static tcg_insn_unit *bswap32_addr; static tcg_insn_unit *bswap32u_addr; static tcg_insn_unit *bswap64_addr; =20 -static inline uint32_t reloc_pc16_val(tcg_insn_unit *pc, tcg_insn_unit *ta= rget) +static inline uint32_t reloc_pc16_val(tcg_insn_unit *pc, + const tcg_insn_unit *target) { /* Let the compiler perform the right-shift as part of the arithmetic.= */ ptrdiff_t disp =3D target - (pc + 1); @@ -152,7 +153,7 @@ static inline uint32_t reloc_pc16_val(tcg_insn_unit *pc= , tcg_insn_unit *target) return disp & 0xffff; } =20 -static inline void reloc_pc16(tcg_insn_unit *pc, tcg_insn_unit *target) +static inline void reloc_pc16(tcg_insn_unit *pc, const tcg_insn_unit *targ= et) { *pc =3D deposit32(*pc, 0, 16, reloc_pc16_val(pc, target)); } diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 15d5c78798..d108f01fec 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -184,7 +184,7 @@ static inline bool in_range_b(tcg_target_long target) return target =3D=3D sextract64(target, 0, 26); } =20 -static uint32_t reloc_pc24_val(tcg_insn_unit *pc, tcg_insn_unit *target) +static uint32_t reloc_pc24_val(tcg_insn_unit *pc, const tcg_insn_unit *tar= get) { ptrdiff_t disp =3D tcg_ptr_byte_diff(target, pc); tcg_debug_assert(in_range_b(disp)); @@ -201,7 +201,7 @@ static bool reloc_pc24(tcg_insn_unit *pc, tcg_insn_unit= *target) return false; } =20 -static uint16_t reloc_pc14_val(tcg_insn_unit *pc, tcg_insn_unit *target) +static uint16_t reloc_pc14_val(tcg_insn_unit *pc, const tcg_insn_unit *tar= get) { ptrdiff_t disp =3D tcg_ptr_byte_diff(target, pc); tcg_debug_assert(disp =3D=3D (int16_t) disp); diff --git a/tcg/s390/tcg-target.c.inc b/tcg/s390/tcg-target.c.inc index ac99ccea73..1b5c4f0ab0 100644 --- a/tcg/s390/tcg-target.c.inc +++ b/tcg/s390/tcg-target.c.inc @@ -1302,7 +1302,7 @@ static void tgen_extract(TCGContext *s, TCGReg dest, = TCGReg src, tcg_out_risbg(s, dest, src, 64 - len, 63, 64 - ofs, 1); } =20 -static void tgen_gotoi(TCGContext *s, int cc, tcg_insn_unit *dest) +static void tgen_gotoi(TCGContext *s, int cc, const tcg_insn_unit *dest) { ptrdiff_t off =3D dest - s->code_ptr; if (off =3D=3D (int16_t)off) { --=20 2.25.1