From patchwork Thu Feb 4 01:44:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376182 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp912393ejt; Wed, 3 Feb 2021 18:18:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7rOeylmQIxLdwVR/VnWYvhOQ82ccJQ7Lm3UrI7h7O3ZyeAoFA1maouvbjMnBAPg2lxN4I X-Received: by 2002:a25:8748:: with SMTP id e8mr8086366ybn.120.1612405138520; Wed, 03 Feb 2021 18:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405138; cv=none; d=google.com; s=arc-20160816; b=dBwFwfTVbzUH7UM/Y5hz6HXXfzpbsUIEZilYSY9LF+XRNC7MyXN1mjS0RzeDjfdffe 3W6A5ocKt+3DuXoBeB1LNPTscwjO0cFVTsChFq2tglVwsQp2eYXUWMGzRcT4rBMHfOPl HYuZRw/eddfcD4dNRdOjSLzygIDbGoyToLvbQtADMY1qw5uw9W4wFyt3O9jvE7XNbJJd /ywqXcFpC/GxuqsoMKjg/heNo4gC5HqdL4ojqbppA25/satlWULpr3aZl/ty8slc26Rk 2Pok6Nen7JHEq2l6Bf6t/mZtyDlWjLZcZRbRSWRjQ3UmR7QEVeKV9x8KZt38ST+dsc4h Ayww== 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=fkXespGLacfat/Oc2ATzIf/ZqfIgEJ0vqqLFj00td/k=; b=Jxoy5XbvG0ydNiCTLze7cmr1Iypiok8hHkKPMfMMauPsADpf30Gm+2kWh1NKUx31XZ D5ZYV8tWlLWIcCeYy91sDtx115iQAozwmtcqa9TAqP4E08KqMR3KJL/f65ucelzU7Zn0 HPGjmytBKqn7UbOWEw/phT8ezSnX1BtPHTWoX8dyPQ+Bpuf8U008EXTw31NzqchgIotH gHFkK0/YZY7tRbOyxW1RYoyX0JcCcCmHVa3+iRLb6VIw/F9H/5mB+8fo8B9GyOeE7mcE SGCDx3RSLW5MYdaQ09giNxEONmXmjEdxKcZvFrcZFyY9DDzz+SERfpVQwC24Si0rguMH 6FNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r6PYrn0O; 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 x129si4120321ybg.408.2021.02.03.18.18.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:18:58 -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=r6PYrn0O; 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]:37218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UET-0001st-SY for patch@linaro.org; Wed, 03 Feb 2021 21:18:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjV-0005lV-1D for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:57 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:43360) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7TjS-00044d-K1 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:56 -0500 Received: by mail-pf1-x431.google.com with SMTP id q131so1057881pfq.10 for ; Wed, 03 Feb 2021 17:46:54 -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=fkXespGLacfat/Oc2ATzIf/ZqfIgEJ0vqqLFj00td/k=; b=r6PYrn0ObFOVP9x9l/TTdhUh+ugROYzSwwYIrTiIG9RgyWimodhIkxi9o13hyFfyYj 4iNAsz1Vrdfn2SUPwBKHh8sVG8v41ioLWTAuo3NgNRdM4DVZseJoFzgDeqxBl7s/ddCp ypTmoSCg2yvUdhoHrLe8QKUPC0neeYzcwXM1+no7t8KlHr77+ZY+mbHGPkRZT0zQpwkM qoQfrsXX6xqfmmcYpQLvX31KgFj3mPtJlL19UtvElvD8lalpLfLtb4pD1uwGuYI9Sv5z yua84T0A2l+3dM30WG9EFx0dZj3xTLsnqsbEbVzud9WPJOGCHgErXcAVWxCZuWloh/5u N1eA== 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=fkXespGLacfat/Oc2ATzIf/ZqfIgEJ0vqqLFj00td/k=; b=X2F5mGOMRkDMQUPyExoiADoFmQGcvT0rcV/2vODYHzsg3NhitWWHf6ePb8Da0aa8cp 7yiIsEY+Cr+PbkBs7nIEJaoCSrZgabO28BKzNCyQeN5GQtmAi06pJQ+1j+8XKFeumMLH Ktd6lbPc5GVKbLq1x2HI3NIqhOhbbwMN9Dfm3uTfu0fUH1mGXgtR1vwg9Wa3U2aiGRUi aNTWHZCAiBuMH/w/Dj3xUo0nUyurO+DVpjpl4QZMfCM+ZshB2j38ZIUYJEoKZE0Td+WO eP5TKaveYXnDE6nRyyEBe/cYj8ZgHI2/bpGAycDBDmCaXTgUxfzFlJco+LAcXH/RyVlT InJQ== X-Gm-Message-State: AOAM532750lEhz3qD5aQm1CQQmkXaoxxhzTNYbLklvJjLfsGm5qxkZ4O sG1f4oIMMl0I90pVIKyUaHMGVf7hhWOrMKLe X-Received: by 2002:a63:c1d:: with SMTP id b29mr6621757pgl.9.1612403213294; Wed, 03 Feb 2021 17:46:53 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 57/93] tcg/tci: Reduce qemu_ld/st TCGMemOpIdx operand to 32-bits Date: Wed, 3 Feb 2021 15:44:33 -1000 Message-Id: <20210204014509.882821-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We are currently using the "natural" size routine, which uses 64-bits on a 64-bit host. The TCGMemOpIdx operand has 11 bits, so we can safely reduce to 32-bits. Signed-off-by: Richard Henderson --- tcg/tci.c | 8 ++++---- tcg/tci/tcg-target.c.inc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index e10ccfc344..ddc138359b 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -855,7 +855,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_ld_i32: t0 = *tb_ptr++; taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { case MO_UB: tmp32 = qemu_ld_ub; @@ -892,7 +892,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t1 = *tb_ptr++; } taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SSIZE)) { case MO_UB: tmp64 = qemu_ld_ub; @@ -941,7 +941,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_st_i32: t0 = tci_read_rval(regs, &tb_ptr); taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SIZE)) { case MO_UB: qemu_st_b(t0); @@ -965,7 +965,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_qemu_st_i64: tmp64 = tci_read_r64(regs, &tb_ptr); taddr = tci_read_ulong(regs, &tb_ptr); - oi = tci_read_i(&tb_ptr); + oi = tci_read_i32(&tb_ptr); switch (get_memop(oi) & (MO_BSWAP | MO_SIZE)) { case MO_UB: qemu_st_b(tmp64); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 640407b4a8..6c187a25cc 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -550,7 +550,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { tcg_out_r(s, *args++); } - tcg_out_i(s, *args++); + tcg_out32(s, *args++); break; case INDEX_op_qemu_ld_i64: @@ -563,7 +563,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { tcg_out_r(s, *args++); } - tcg_out_i(s, *args++); + tcg_out32(s, *args++); break; case INDEX_op_mb: