From nobody Tue Feb 10 07:23:58 2026 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=1669964288; cv=none; d=zohomail.com; s=zohoarc; b=jBEiDaENlC8H2XdvEFiB7Z6wd2OKfTDnNwGH/XCAWh1byZRv58kHFSU1MjbcIiSHOdijqEX9PKEjiStaQtSVVhRS76dZ6fuC9AMKBqCc1WODaYTqehLtXxzWPO8CBbYEJI93Q46nXxbVv5g1JWcRXp8t/TFxgkQbGNF3KoxytyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669964288; 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=tv/8rjnBa1lQCKggJRD9/FDpkd6opAc1OcPOojf8ueg=; b=gA9DlqCoyRkdyMzZrbplHgLzBxRUgWvUoSUii1vZMz4vUom09FeNXZl7A+kdYy/kQYAi2eD3sSqYkRpg7V4oNjLn47BzxcJHPT21dA1qG33C3yOAIDRZJrkDsuTmULhngiUmAxnPlpO1vVwjjesIy85gpmD1zDBa3fjsR4OQg34= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1669964288702923.460789289103; Thu, 1 Dec 2022 22:58:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0zuA-0007aO-A8; Fri, 02 Dec 2022 01:52:14 -0500 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 1p0zu5-0007Z1-Ms for qemu-devel@nongnu.org; Fri, 02 Dec 2022 01:52:09 -0500 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 1p0zu3-0003ez-Ua for qemu-devel@nongnu.org; Fri, 02 Dec 2022 01:52:09 -0500 Received: by mail-pf1-x435.google.com with SMTP id q12so4065485pfn.10 for ; Thu, 01 Dec 2022 22:52:06 -0800 (PST) Received: from stoup.. ([2602:47:d48a:1201:e3cc:2e37:17d4:f1d5]) by smtp.gmail.com with ESMTPSA id q61-20020a17090a17c300b00218d894fac3sm6056649pja.3.2022.12.01.22.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 22:52:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=tv/8rjnBa1lQCKggJRD9/FDpkd6opAc1OcPOojf8ueg=; b=s/9SlTRAiHj+FLgJerGqkfrwBk63xbvPcrjzMGtdD1S12LzVZOwzOnCIYyQg4AC7On n+1ylS/y7XIehRF4Kw0JMQItLPFKlAl8oG1vjHf0g4WbnnAIW/i7XiKrnMP+Wpl9SsX2 b9Gp3SP5nJJ6VkHoDfXaFkvuaBNu0s+JMbMVQugc6AsHjtez8DpcfW19H5e7AZxgYilR zjHgy+7zA6wxXfrlJ55Gf9TjwGgMYvOzf6rzcj1hPmK1LzZ/rmENeXHEQ0nDZeWYHmng X9LlJYBNXvyIXOo7VvvNZonix+RiwhW/FzxvWKNUC/ZkuEaqSnvx7QKmcxxf+/88uoK3 IcEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tv/8rjnBa1lQCKggJRD9/FDpkd6opAc1OcPOojf8ueg=; b=5RY6UQ2gsmyoVu9n4R/z2CJoQF3iN/CX0uqx2FZvouK3cz1+QgIeNq7Cx9YG0MOw4s WnW56J9nonX77qjku9q9suI3HA/gxROIPqaZgovFlBE9o/LnVqPDiyvxa1T/xE6BOpug ari54IuaWuKikiJj1M0TEvzE7keU+GR60YUxfGVsxVR2WU7O1L7MJPBYt6QPu4qY6Lcz VYOvVqjSb8VXampEUlAw6fmXp5COHrYKlBAOjHbGRbABMYBXjz9N5wRJAXxKQY+NkybG 2qmHFIWmmEoQO7DFTfUinBuym13O0J60a/Ndo4G+SF9ZL01JO1MoZiv9R9FIMB8NZgpE Q55g== X-Gm-Message-State: ANoB5pk2cvbdyIazbB31bC8ULY9FjL6kDt9HvnG7Gy39DPG9DuVeOcUc dLlepxe3zdu25ZX1xDmDSP5Wz4IjWQ28r90L X-Google-Smtp-Source: AA0mqf6TJer94d44vMksMpCawa3bCb1kK25u5KIvOEjU5KLmIHRpwHanXFuzH3/yDJsXG6p8unv4KQ== X-Received: by 2002:a63:ec07:0:b0:470:90f1:6216 with SMTP id j7-20020a63ec07000000b0047090f16216mr62050623pgh.42.1669963924674; Thu, 01 Dec 2022 22:52:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: thuth@redhat.com, iii@linux.ibm.com Subject: [PATCH v3 03/13] tcg/s390x: Use LARL+AGHI for odd addresses Date: Thu, 1 Dec 2022 22:51:50 -0800 Message-Id: <20221202065200.224537-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221202065200.224537-1-richard.henderson@linaro.org> References: <20221202065200.224537-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::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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1669964289704100001 Content-Type: text/plain; charset="utf-8" Add one instead of dropping odd addresses to the constant pool. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich --- tcg/s390x/tcg-target.c.inc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 8a4bec0a28..34de5c5ebe 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -811,6 +811,7 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long sval) { tcg_target_ulong uval; + ptrdiff_t pc_off; =20 /* Try all 32-bit insns that can load it in one go. */ if (maybe_out_small_movi(s, type, ret, sval)) { @@ -839,14 +840,14 @@ static void tcg_out_movi(TCGContext *s, TCGType type, } } =20 - /* Try for PC-relative address load. For odd addresses, - attempt to use an offset from the start of the TB. */ - if ((sval & 1) =3D=3D 0) { - ptrdiff_t off =3D tcg_pcrel_diff(s, (void *)sval) >> 1; - if (off =3D=3D (int32_t)off) { - tcg_out_insn(s, RIL, LARL, ret, off); - return; + /* Try for PC-relative address load. For odd addresses, add one. */ + pc_off =3D tcg_pcrel_diff(s, (void *)sval) >> 1; + if (pc_off =3D=3D (int32_t)pc_off) { + tcg_out_insn(s, RIL, LARL, ret, pc_off); + if (sval & 1) { + tcg_out_insn(s, RI, AGHI, ret, 1); } + return; } =20 /* A 32-bit unsigned value can be loaded in 2 insns. And given --=20 2.34.1