From patchwork Wed May 29 10:54:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 799837 Delivered-To: patch@linaro.org Received: by 2002:adf:e110:0:b0:35b:5a80:51b4 with SMTP id t16csp668113wrz; Wed, 29 May 2024 03:57:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXGi8xFR812TLw9jtHIFSruoLv2vZHGg8RYR+aTfvBJ+l2phlWhKo3sSspRfbNTOovAXvM0LJL5632a4yM5uJEq X-Google-Smtp-Source: AGHT+IGXAWxhSXgiHCX0DbY2UDj3XPRG9x845z6WQ1LX8WBhx0St0KSO/3T3DUTZgN2iT1jDQzxo X-Received: by 2002:a05:6214:4507:b0:6ad:6453:b12a with SMTP id 6a1803df08f44-6ad6453b5cbmr170727376d6.7.1716980234578; Wed, 29 May 2024 03:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716980234; cv=none; d=google.com; s=arc-20160816; b=Zou76f/YTdkbJ/ozCCH789qbBXvLP00hhNw9xPILSCeSr2SGazDUxOT7aFwrtOyNag YAy1UcvCe+/pZXdg11SwLuScOLjhI9TA2Ru5G1A47GMjU2mG3UD1u7mdLUVpjR6/8sey Uq4+xps8o1p2OiiA21/x4F3UiCKK1U7KZ5LFFzij75aRbbQvbNDHIhhB2wcia8xhvrQp kRPdNYh1qfJdAZaXLSBTj4VPOmFJvvrCtkokwZ0eduf8EodN+iWGQIbnFKAxJCce3Izy /fjQGcYzUpBhFYsx9svO6ONz7LnQYiLJ6a4D43604w84jzxI46ORuVVTMwq6NTU6Dtxv imWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=3GyYRSkELlfnbhEfugR7UfUM9SFCQGfkQTU4bDJyXro=; fh=OsWYFOW57sm9MQmCwZowHcNekTZ8P4tu1a+zbk+cdm8=; b=PoqRlk5EVFWZbZdwimswhje5rzfgeqvygc/I6f1CsSoNvzaGqjky6FhVlI/Oc3sBsr l9xMb0Q96VsR3Rd2OtjcE3vg8UXVWSOc9omwj14LPlS+OK35SR27dcO33BlpOMVOb1Zd fUmmWyBrKZrGv/7jtz7Wu0SE6bbLHwWG22POEvREA4B2AWiCnLlEzYQNXwc8ACEbO4rP qYJnNZSwD63IRb0tEQyUMm3VgUQS5bSAUZ4FY166wjEPhy0N8M0s8C8ZllJV9gdBZYO9 XV5VOd14hnGK+9U/wJDfKku75zi8MxrsAiBdOzxeGYMnJNyNbnN+aYgNmlvX3Q+3YyxJ m7oQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U0qvNpZp; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac162bbda8si124801386d6.527.2024.05.29.03.57.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 May 2024 03:57:14 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=U0qvNpZp; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxf-0004bn-Hd; Wed, 29 May 2024 06:55:15 -0400 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 1sCGxe-0004az-Dj for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxb-00038M-UF for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3GyYRSkELlfnbhEfugR7UfUM9SFCQGfkQTU4bDJyXro=; b=U0qvNpZp13C3Ni691ZmEE4/JkJu1tzGU6jM/CW+rW5/5//UnUMLAPN7UmokO8NkYgAiWG6 YobAgfWny06Mc6erxBrozeI/xoFshyzUhnyz3PvqubMlOzPHEiFYw+nW9r7jpCZfGxLt3S FxDIUP0qw4kdzd7anDv82SekGYPGEn0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-O06KanVNMzC8iu1JtWAb9Q-1; Wed, 29 May 2024 06:55:07 -0400 X-MC-Unique: O06KanVNMzC8iu1JtWAb9Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 487D429AA386; Wed, 29 May 2024 10:55:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0263105480A; Wed, 29 May 2024 10:55:05 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PULL 06/22] target/s390x: Introduce help_goto_indirect Date: Wed, 29 May 2024 12:54:38 +0200 Message-ID: <20240529105454.1149225-7-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Add a small helper to handle unconditional indirect jumps. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-7-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 07620948ae..7ae928c3b0 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1118,6 +1118,13 @@ static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest) } } +static DisasJumpType help_goto_indirect(DisasContext *s, TCGv_i64 dest) +{ + tcg_gen_mov_i64(psw_addr, dest); + per_branch(s, false); + return DISAS_PC_UPDATED; +} + static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, bool is_imm, int imm, TCGv_i64 cdest) { @@ -1148,9 +1155,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, goto egress; } if (c->cond == TCG_COND_ALWAYS) { - tcg_gen_mov_i64(psw_addr, cdest); - per_branch(s, false); - ret = DISAS_PC_UPDATED; + ret = help_goto_indirect(s, cdest); goto egress; } } @@ -1463,9 +1468,7 @@ static DisasJumpType op_bas(DisasContext *s, DisasOps *o) { pc_to_link_info(o->out, s, s->pc_tmp); if (o->in2) { - tcg_gen_mov_i64(psw_addr, o->in2); - per_branch(s, false); - return DISAS_PC_UPDATED; + return help_goto_indirect(s, o->in2); } else { return DISAS_NEXT; } @@ -1495,9 +1498,7 @@ static DisasJumpType op_bal(DisasContext *s, DisasOps *o) { save_link_info(s, o); if (o->in2) { - tcg_gen_mov_i64(psw_addr, o->in2); - per_branch(s, false); - return DISAS_PC_UPDATED; + return help_goto_indirect(s, o->in2); } else { return DISAS_NEXT; }