From nobody Tue Feb 10 23:13:36 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=1662465690; cv=none; d=zohomail.com; s=zohoarc; b=Bl+9qvbf5TA1wOKT5CpH98lUF4Ug6boVWdbooeR6HI3Eu7h1E/gYGhBqS9ckEcf9eiOwnb/zjfDN4CQgfNwSS7BgMkxeIzFMQSd1vZKMa7e3Ty7wb2FZ51klqLOcUZiT3EBakHXhCk0JdtBGnVUBpVnzaSdwlshnQsZvK7bEAak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662465690; 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=/5fBWGcV8KP0yYWYzeZW+deZNVZGvo9JuykELaazvaY=; b=OS4b0N8Xr6F2DnoeN+0OmNkQpX8ap9m5ByvV92LP5W5izZcUz9upRtOqewQKYI7/23a/9TeU30y8ahzAeOqvTZz2HpY2b4KtbpdhoCxiwkZMIp1G6AkF1/57ESFpl/SyGWGHfJ5HWCHmPB12qSXHQrMGj43brxMV3Im14XblnAs= 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 1662465690012825.7131565064159; Tue, 6 Sep 2022 05:01:30 -0700 (PDT) Received: from localhost ([::1]:53740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVXGi-0000WQ-Sx for importer@patchew.org; Tue, 06 Sep 2022 08:01:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVVeX-0003Fo-K9 for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:17:57 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:37870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVVeU-0005Bj-Nl for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:17:57 -0400 Received: by mail-wr1-x42b.google.com with SMTP id bq9so1787697wrb.4 for ; Tue, 06 Sep 2022 03:17:54 -0700 (PDT) Received: from localhost.localdomain ([2a02:8084:a5c0:5a80:ba98:3a71:8524:e0b1]) by smtp.gmail.com with ESMTPSA id y16-20020a05600c365000b003a62bc1735asm14094361wmq.9.2022.09.06.03.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:17:52 -0700 (PDT) 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; bh=/5fBWGcV8KP0yYWYzeZW+deZNVZGvo9JuykELaazvaY=; b=v/WboH7nf7YgTog6IrOBVtOYE62pxS/CyMkZrAqDIbNgFuXqogDjumtOUJL//DLgY9 o9Ny1g1ie23aRIKcnHH1RgvhAJkG9NRQCx/cAfZ2T+w5m0iywroVlmTZp5ekTkU8dPhR QZUensN4+VyWG5YuGQu1n56VLpQMP9rC24x+871XlPZd0B5JdzM8nXQp1/pPjFP/jrgJ fUu3tQJBIru8kCUMTSJG0kYKpVUDMWWECH0rbgdpawlzIW3Ijymo/t0MnJcEMQ7HEEgr tLVTheVSHQNpf9NwY/O45d/Ok/C63yGI7peVRFMmM8nxJA2zMTk115wjAk5uBKdRuaZ8 k+DA== 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; bh=/5fBWGcV8KP0yYWYzeZW+deZNVZGvo9JuykELaazvaY=; b=7bHQpc3PhkvKh2h3xuhT0lbHxa+T3YnItRdG19fMv9dLY4QQiSb65Zwh+6uEPnNjCw 791nyr+AxkNe6YCU13XPVhVVKhmjmQHxucdsy6t66gxc+MoPcU/qvZHTS27ElUK5KWuN hvACo3qUem5yWs0bzYe5HOVnUFpYUDXy1wub7ibSV70WubGodM3n4vFS00hWs+AkBRQ8 IC/Qbl+AcJOMX4Wd/uYCVkBrbicgZGL+ZbwRGaVR7ZjzugxY1S7znt25V1AF/aAEtwXH ywLqvhXIh0aaYXqjjPqilFcLZngptVKHhCInExnZzd77GqWVVQdStEcotd47E5z1R/Hc 43kA== X-Gm-Message-State: ACgBeo2vtvKhNq5TNX/8lRRpEVDPSg7acEYUZvyg6CFamPSQWpDKN+bx X+UD9F+x1m/mX5kekRBDE+w9flFgv6Hpi1Kl X-Google-Smtp-Source: AA6agR5YiYKa/vse6s7nwHTcHnvQKEktagq70tJaxFP6zh8xbsYU+ujaEfZ6MlaU7lHNhC/pUfV5QA== X-Received: by 2002:a5d:4707:0:b0:226:f89a:ca3e with SMTP id y7-20020a5d4707000000b00226f89aca3emr13875130wrq.454.1662459473308; Tue, 06 Sep 2022 03:17:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH v1 05/26] target/s390x: Change help_goto_direct to work on displacements Date: Tue, 6 Sep 2022 11:17:26 +0100 Message-Id: <20220906101747.344559-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906101747.344559-1-richard.henderson@linaro.org> References: <20220906101747.344559-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=2a00:1450:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1662465691866100001 Content-Type: text/plain; charset="utf-8" In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index f8cfddc181..b6e4005670 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1145,8 +1145,10 @@ struct DisasInsn { /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* Miscellaneous helpers, used by several operations. */ =20 -static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest) +static DisasJumpType help_goto_direct(DisasContext *s, int64_t disp) { + uint64_t dest =3D s->base.pc_next + disp; + if (dest =3D=3D s->pc_tmp) { per_branch(s, true); return DISAS_NEXT; @@ -1169,7 +1171,8 @@ static DisasJumpType help_branch(DisasContext *s, Dis= asCompare *c, bool is_imm, int imm, TCGv_i64 cdest) { DisasJumpType ret; - uint64_t dest =3D s->base.pc_next + (int64_t)imm * 2; + int64_t disp =3D (int64_t)imm * 2; + uint64_t dest =3D s->base.pc_next + disp; TCGLabel *lab; =20 /* Take care of the special cases first. */ @@ -1185,7 +1188,7 @@ static DisasJumpType help_branch(DisasContext *s, Dis= asCompare *c, goto egress; } if (c->cond =3D=3D TCG_COND_ALWAYS) { - ret =3D help_goto_direct(s, dest); + ret =3D help_goto_direct(s, disp); goto egress; } } else { @@ -1558,7 +1561,7 @@ static DisasJumpType op_bal(DisasContext *s, DisasOps= *o) static DisasJumpType op_basi(DisasContext *s, DisasOps *o) { pc_to_link_info(o->out, s, s->pc_tmp); - return help_goto_direct(s, s->base.pc_next + (int64_t)get_field(s, i2)= * 2); + return help_goto_direct(s, (int64_t)get_field(s, i2) * 2); } =20 static DisasJumpType op_bc(DisasContext *s, DisasOps *o) --=20 2.34.1