From patchwork Wed Feb 17 20:19:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 383869 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3121128jao; Wed, 17 Feb 2021 12:42:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiQZzkyeiNDQkjUBBD4HWxxfm563LifDSRTxT0BBZIpe8SIHfkTK7NSwrkkU5DQB1EY4d1 X-Received: by 2002:a25:3623:: with SMTP id d35mr1867500yba.180.1613594540389; Wed, 17 Feb 2021 12:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613594540; cv=none; d=google.com; s=arc-20160816; b=r8kobhsnK0mTtyWT+tvXoEbxRH2aTvbjHim2oQUol6MraWhqtT9kGaSmesxzaNml2g ZNb1Vv/k7KLSLW9jjsuInKukTUv3ZqJT/w66J5XOvCG3A7mq2taXW10Q+P11G/Mnd0vd kAjC5YFdvoalVIFeVKeadycib0c/Jy14qioC6phFHRzFOnmlgHC3y2CYBsc85rv6gp6L ZGhinwUMublBpNpe8sDKyPmP1KdgRNbGKwZaKsDihEWAn3XrpjaWFz8YGMAkk1lRDD2Z CkL0w4pOV/ySwyKdDh71zN47NbCrJIV7uPF/ee/P8De+CQMrs3yhuoXE+kbhSG6lOtNN faxg== 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=Cx+nFCxFv3Yh5ev57gtG/OnK3pXMi4fhwChTqjnm+qQ=; b=S2V0tukH+fa4uGK2xBzSk/4cy5JpNCbYexZND9gpIRzPpBpPIG5Q704iAIoo4sdiFf E2coSm39sEGy6rBaeiWfn36gl9HEov3kpAz/76eGjoAPPPg2IINRj3ClNqcUAmPbnMfu 7hOYCf0CHqp1CsJB+F6niLylKnh7IDE59humIcGAb44idBo5yBVn8pEDTRO6+CZRjklD ZYP4wSa1QqPsHZYB2ErGGm6+8mV7AoMjeF6Arvcb4d2+XfVDVMDUZBzdYnjAyCWVV/Yu 2QrGgvmXVQjLgFOkMglUWWF+m1QyznL5Is7gMUquBDuUKbtvwaaWlUd0InkKIUrJOcak 9bYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=D7nLrH2f; 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=fail (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 r11si3358363ybb.116.2021.02.17.12.42.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Feb 2021 12:42:20 -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=fail header.i=@linaro.org header.s=google header.b=D7nLrH2f; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCTeN-0002JY-P1 for patch@linaro.org; Wed, 17 Feb 2021 15:42:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCTLa-0008AK-Fe for qemu-devel@nongnu.org; Wed, 17 Feb 2021 15:22:54 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:39836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCTLX-0007Lt-N8 for qemu-devel@nongnu.org; Wed, 17 Feb 2021 15:22:54 -0500 Received: by mail-pl1-x62b.google.com with SMTP id k22so8037388pll.6 for ; Wed, 17 Feb 2021 12:22:51 -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=Cx+nFCxFv3Yh5ev57gtG/OnK3pXMi4fhwChTqjnm+qQ=; b=D7nLrH2fAEU/I1rluHhYO3MD7CIEtgOY2IB9/dUG8uIwRytDwHw8naY+5qrzNhrSQT MEEZ1oJAqfrQGyEYi5Luaj5ug0zE6tjTWOSQUL+Elw9dm9SGiBRtbFsA9JMZYtn91cXo XIauc362IvpAfu/Hf61V6Cmuvr1IRULvk7KvJ8vMGHPHRaJYQ/3PL0Bix1Ey/XN3uweE 4/G1mEHEpa5LGWhFMxbIA5owppiAMKbAcGx3mvxIzY155T4VK1pd3SmH17gMJ/clFCUb 6XBQH5L5aNN4pUhQSXLwL39nkppHyozvO9Mqg1LRLcUphEfUFDPpP7X73K7OMHPgzM+3 3wWQ== 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=Cx+nFCxFv3Yh5ev57gtG/OnK3pXMi4fhwChTqjnm+qQ=; b=Ql0up6E6675g6zYKD+Y6aZED4/cjo4/TAAtOAllnpAMTdRZrnJKJBxJEAqBmG9viK1 zDLS6SnOnlMU4hCx5BgOQ2Ig7tyHFZnNT5zdMtqmtvEh2KpHA+t0o5pZfzK0pd/0PqnZ h3ipQ8GyA9vC0qHJ4jja9Y1bXSFDdCw6+H1XUE7RzlcU4I9dj9azcDoVfsB47XAMMxq8 sFLRDVxgH+q438gC/cqzLeXWBLrQBsQ6aYMU4o4EEqZKogMnvL3iojE8nvXPx4eJ8ZE4 UTIFYqjmEz/2CfTuC7Pxvk0kjpeL/tryOYJjCNusIjhFlgx7eZljdUo9B/MsO6xOgxag wCpw== X-Gm-Message-State: AOAM533Ng3RcvL57Ih9jCTAJtFYocW3Nvmp3IyIUk3cXLy71akAqvZc1 I5hsaeBwmCzFUzqk6+JR/B6IB86pWVlD3Q== X-Received: by 2002:a17:90b:33ca:: with SMTP id lk10mr542705pjb.186.1613593370208; Wed, 17 Feb 2021 12:22:50 -0800 (PST) Received: from localhost.localdomain (047-051-160-125.biz.spectrum.com. [47.51.160.125]) by smtp.gmail.com with ESMTPSA id 3sm3001576pjk.26.2021.02.17.12.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 12:22:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 27/71] tcg/tci: Reuse tci_args_l for exit_tb Date: Wed, 17 Feb 2021 12:19:52 -0800 Message-Id: <20210217202036.1724901-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210217202036.1724901-1-richard.henderson@linaro.org> References: <20210217202036.1724901-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: sw@weilnetz.de, alex.bennee@linaro.org, f4bug@amsat.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not emit a uint64_t, but a tcg_target_ulong, aka uintptr_t. This reduces the size of the constant on 32-bit hosts. The assert for label != NULL has to be removed because that is a valid value for exit_tb. Signed-off-by: Richard Henderson --- tcg/tci.c | 13 ++++--------- tcg/tci/tcg-target.c.inc | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 066e27b492..6fbbc48ecf 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -160,9 +160,7 @@ tci_read_ulong(const tcg_target_ulong *regs, const uint8_t **tb_ptr) static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) { - tcg_target_ulong label = tci_read_i(tb_ptr); - tci_assert(label != 0); - return label; + return tci_read_i(tb_ptr); } /* @@ -400,7 +398,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tcg_target_ulong regs[TCG_TARGET_NB_REGS]; long tcg_temps[CPU_TEMP_BUF_NLONGS]; uintptr_t sp_value = (uintptr_t)(tcg_temps + CPU_TEMP_BUF_NLONGS); - uintptr_t ret = 0; regs[TCG_AREG0] = (tcg_target_ulong)env; regs[TCG_REG_CALL_STACK] = sp_value; @@ -815,9 +812,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* QEMU specific operations. */ case INDEX_op_exit_tb: - ret = *(uint64_t *)tb_ptr; - goto exit; - break; + tci_args_l(&tb_ptr, &ptr); + return (uintptr_t)ptr; + case INDEX_op_goto_tb: /* Jump address is aligned */ tb_ptr = QEMU_ALIGN_PTR_UP(tb_ptr, 4); @@ -975,6 +972,4 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, } tci_assert(tb_ptr == old_code_ptr + op_size); } -exit: - return ret; } diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index c79f9c32d8..ff8040510f 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -401,7 +401,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, switch (opc) { case INDEX_op_exit_tb: - tcg_out64(s, args[0]); + tcg_out_i(s, args[0]); break; case INDEX_op_goto_tb: