From patchwork Tue Jan 5 17:19:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 356885 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp304926ejs; Tue, 5 Jan 2021 09:28:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuPaimSjiKeTrp8evCSdMpdE6yGVak+x4KOn7Zz5g3gSufuRTmsJTK4ttPy2AlqDLrTsDK X-Received: by 2002:a25:d24a:: with SMTP id j71mr664440ybg.13.1609867734859; Tue, 05 Jan 2021 09:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609867734; cv=none; d=google.com; s=arc-20160816; b=AQUqnVFWhJJgwTAivMPAnn7uk1s3JxJCRJ3xP+9J5vFHBlFJbS8jaFokG9fjxflb8B nPGK+NZqTGZgh0mHanu0/joBWfCVO4FT/Q+2q+ApfpDzFwc3GdEVvi4P/9FvCmLDvo9Y /nfobzGrxZXyabEZS/6VsJ994ixPn8eIQrBuU6jp00vSnrW5QEdsnnb06smNv/DK9Ivh ssfpSnzdMH0t/bK8ogbNHsUtlRChuXWkvkznXo9HpmNpv9s24cOXO96cLw1qtMKlkIrL nGoNk7xQZyGOyafnERmUOo6nDxNJF9KNHEJG8vrzpnr41aIBXuEkTDtwQ4Cd/CUV1JBf aONg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=NQliFXXfgB1CXPoiBmFHUeq1S6nzHe9RcOFk3sVmuPo=; b=J2g2ZY0ms3+6SvMJbTyZHIy2zEVZw4/GRxf8d6IwRkXHVbbOehlGAy4q2eqo7Jhc5p IMnasHVOQ2dgqFW6PGDkASExffpyNzuC0l+h8nAE0ls8vp5uEkUSfC2whjEpHFq1lirq qE+c0AgnnysnrefDaNSOuWB6sspj7yrDCtblrr9FXmueNtSHgbiJj1PGq23SUR3tKSRV W1QFtwdwaBydjzDE10NkkrBKUG3hGazaOowkT4NJcMDnfFosEVZppJpi9T5096rdvDwE T15HnK5hASyPWZhpom/gsnyloXFxGzCKVz2Zjuqc95/NMo3HupwdT9Xo/KqbT4JGnsNR MNlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tnKLdzXs; 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 p197si531469ybc.155.2021.01.05.09.28.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jan 2021 09:28:54 -0800 (PST) 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=tnKLdzXs; 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]:57740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwq8b-00060s-TJ for patch@linaro.org; Tue, 05 Jan 2021 12:28:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwq0U-0002Mq-2i for qemu-devel@nongnu.org; Tue, 05 Jan 2021 12:20:30 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:37010) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwq0J-0006Uq-SW for qemu-devel@nongnu.org; Tue, 05 Jan 2021 12:20:29 -0500 Received: by mail-pl1-x631.google.com with SMTP id be12so65188plb.4 for ; Tue, 05 Jan 2021 09:20:17 -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=NQliFXXfgB1CXPoiBmFHUeq1S6nzHe9RcOFk3sVmuPo=; b=tnKLdzXsiQb0QTB/dyNIZ3mBWJHqNzCm2AABhXgkKDHkVn/CmSSJR2NJVUkWUqYqJb 06F8aLwXszB0z3cIyBdBze26Qzewj1f+n4NzcT+9trXg//NxQrEMUZOkjLUknREV198E aQ40Ed5lwhPYbTnyQjPPAO3NZWaJb8NAg/0/wXiBHAT21R/Xksp8N1L7Ay0WAys/iWwi bXdH0CqROzNXk3MZbbAgE7OxygFtf3ibZYtlT0Y4DJxq+TH6nuV3KJB5g22ZuTlAJX+R 9VPSln6eJnu4cL9OlPkCMCprR8JwwOjgs9W2K/8YBRta4pQ9/cMAOxZIJW9MlPu+Pzhx lLCA== 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=NQliFXXfgB1CXPoiBmFHUeq1S6nzHe9RcOFk3sVmuPo=; b=ZY7cKqvC89JrvVe8KXo9i9H4bVqI8SYLbH3NtkudZg8LsjGTh420tuemo53bLcwtV2 hfHnqe8zgppgIzm98DgZCg8ZB8j3KOV0MglSOCm1k97QEWyvBA6KDjRXoIrrumcD1rfl ul0Wz7DqhOjjNyPKcGmlrylEof0POQd7KouCouSUQ6PkY3FiwvWdsarcC7JKudGyVK4H 83jbaIgqHN+HNzx3EVuUUJXA5FdUCFWPWEXKDDzMxHAztdiBNCYaWUnXvCtq7h/KQ498 iDqzBPt0X9MhViVXeplL7/wQNYvOvs2GGE6ur1Ie2UKfocLdSMAKF9nZcfgPZfSuqz0j kAxA== X-Gm-Message-State: AOAM5323IIYXCFzWUgU/B2Myo6eZc5vjmKOi3Up/lzox8vfuUbysRiZ6 TUMSdDQ1BkCd4chhkugzBTJlH/hg2Cp7gw== X-Received: by 2002:a17:90a:db96:: with SMTP id h22mr261292pjv.204.1609867216496; Tue, 05 Jan 2021 09:20: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 u12sm2010pfh.98.2021.01.05.09.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 09:20:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 11/43] tcg: Adjust tcg_out_label for const Date: Tue, 5 Jan 2021 07:19:18 -1000 Message-Id: <20210105171950.415486-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210105171950.415486-1-richard.henderson@linaro.org> References: <20210105171950.415486-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: Joelle van Dyne , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Simplify the arguments to always use s->code_ptr instead of take it as an argument. That makes it easy to ensure that the value_ptr is always the rx version. Reviewed-by: Joelle van Dyne Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 6 +++--- tcg/i386/tcg-target.c.inc | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tcg.c b/tcg/tcg.c index a34d2e5bb7..898c4bd1b6 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -302,11 +302,11 @@ static void tcg_out_reloc(TCGContext *s, tcg_insn_unit *code_ptr, int type, QSIMPLEQ_INSERT_TAIL(&l->relocs, r, next); } -static void tcg_out_label(TCGContext *s, TCGLabel *l, tcg_insn_unit *ptr) +static void tcg_out_label(TCGContext *s, TCGLabel *l) { tcg_debug_assert(!l->has_value); l->has_value = 1; - l->u.value_ptr = tcg_splitwx_to_rx(ptr); + l->u.value_ptr = tcg_splitwx_to_rx(s->code_ptr); } TCGLabel *gen_new_label(void) @@ -4329,7 +4329,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) break; case INDEX_op_set_label: tcg_reg_alloc_bb_end(s, s->reserved_regs); - tcg_out_label(s, arg_label(op->args[0]), s->code_ptr); + tcg_out_label(s, arg_label(op->args[0])); break; case INDEX_op_call: tcg_reg_alloc_call(s, op); diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 9e4053f4e7..197e3006c8 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1461,7 +1461,7 @@ static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, default: tcg_abort(); } - tcg_out_label(s, label_next, s->code_ptr); + tcg_out_label(s, label_next); } #endif @@ -1503,10 +1503,10 @@ static void tcg_out_setcond2(TCGContext *s, const TCGArg *args, tcg_out_movi(s, TCG_TYPE_I32, args[0], 0); tcg_out_jxx(s, JCC_JMP, label_over, 1); - tcg_out_label(s, label_true, s->code_ptr); + tcg_out_label(s, label_true); tcg_out_movi(s, TCG_TYPE_I32, args[0], 1); - tcg_out_label(s, label_over, s->code_ptr); + tcg_out_label(s, label_over); } else { /* When the destination does not overlap one of the arguments, clear the destination first, jump if cond false, and emit an @@ -1520,7 +1520,7 @@ static void tcg_out_setcond2(TCGContext *s, const TCGArg *args, tcg_out_brcond2(s, new_args, const_args+1, 1); tgen_arithi(s, ARITH_ADD, args[0], 1, 0); - tcg_out_label(s, label_over, s->code_ptr); + tcg_out_label(s, label_over); } } #endif @@ -1534,7 +1534,7 @@ static void tcg_out_cmov(TCGContext *s, TCGCond cond, int rexw, TCGLabel *over = gen_new_label(); tcg_out_jxx(s, tcg_cond_to_jcc[tcg_invert_cond(cond)], over, 1); tcg_out_mov(s, TCG_TYPE_I32, dest, v1); - tcg_out_label(s, over, s->code_ptr); + tcg_out_label(s, over); } }