From patchwork Thu Oct 6 03:44:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 612890 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1211580pvb; Wed, 5 Oct 2022 21:12:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Vibg2/50ajt5rSo8kk3VE/adRYKI6NA8Y4nNgRpd16g6/pxoHA6oGcvIGn25GN0vPLz7N X-Received: by 2002:ac8:5953:0:b0:35b:ab1a:ff09 with SMTP id 19-20020ac85953000000b0035bab1aff09mr2110665qtz.144.1665029570050; Wed, 05 Oct 2022 21:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665029570; cv=none; d=google.com; s=arc-20160816; b=s/awTanLyv2rPcWBcUAZHeu+Ai04jAAuFZLUbmfQVaGp2rwuunX8ssWTCaWkB33ioy AtSgzuA3OpDNKHF50qqIvBlMHbRNWaEn2ryLwQA/4qMQd3ky6GhZ8998hyTVQ1YN5NKv 9RZ6y8OxA5jFyhWLH1zq2a2vSKMEBcoiv1C3+F5/Nsaqtiak37Z6dwdVtbzEsC0qHNhD eZAyA1AnNKX9tVS8WqLjmsuEvokIXSG7aXvrfrHIie5dOm2y0+Qz4w5Jc3wWXX+CuwFW x0uXWchiZLFU8VBR7THRIXCSTA0jqUZpcFkskyuRedgp28sFn69DlMOCZEyj1yyG5n6y qX1A== 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=B458Afawec85XoXWpbjPbqxmo9p/Fje9hPN8wU9nu7E=; b=ZQ5JpJkx96kGUfZcJHG+jxurD8lVV+v/i0JZ3lgehmRlxbbTjjj2MHL1pU/ZlXLq4t eGBH6zqSz9dR98e21bnCoF6Sf5agutc7OfBTLes2iunpRBe6YpuH7j4GPV7iEycBNHvn 6X+K/IHToQqiWQbVIOZWHi4jo+oFkrR8ox6gLJBtqOle8vNEkdpcYpVvhRI5W6IggAGR TXXExBPnJa4nM57wfbJzi5uGpfEMstPvNyETbEie3LchG9n52B56ZHFAaQl85NXxQJcr YE1sHC6cbg9dw/jQF4naCEW6iMuk32WiDRijIVpliul5kTiRIkU5o9dWO79tQb5QBxrv QgtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j8UnLD2a; 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 b2-20020ac801c2000000b0035cd697a618si6486616qtg.88.2022.10.05.21.12.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Oct 2022 21:12:50 -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=@linaro.org header.s=google header.b=j8UnLD2a; 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]:54816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogIFd-0008L9-Jh for patch@linaro.org; Thu, 06 Oct 2022 00:12:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogHoS-0004Kk-QR for qemu-devel@nongnu.org; Wed, 05 Oct 2022 23:44:46 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:50933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogHoO-0003rF-3P for qemu-devel@nongnu.org; Wed, 05 Oct 2022 23:44:43 -0400 Received: by mail-pj1-x102d.google.com with SMTP id lx7so727387pjb.0 for ; Wed, 05 Oct 2022 20:44:39 -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=B458Afawec85XoXWpbjPbqxmo9p/Fje9hPN8wU9nu7E=; b=j8UnLD2aVRlrEkxlkaMaU211PTf5s3ds+jS7j8X389F0FyZzqGsoKWWxIaBQ/4WIsp bbj8xkGX1VESzx1PO6nU1jjgoTDEAvydnpHRjowoq+YMxRsDZdRvUgXqWKdBRejb2hD2 hdTJvu1Ho5MEuMgA/vqSJgkn6oZWtg5Kg3OFcsDRUzqFUktQ/qHieMUD/wkrIT4vTSyw W1Slu3AbQ+QyZPZise6fJRDkw+TnUfxxeOAIpNKBisX8rPsCksqSfSauCFa++gyIjJjt Smy9Qx7qrCerC+8A8ej2vIl3CmWxc1s1Sj+9NexKfOv5nKme2B9ZwsoBXw2OHyiQRrrE dJ7A== 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=B458Afawec85XoXWpbjPbqxmo9p/Fje9hPN8wU9nu7E=; b=NOOaajNTJYXa6DtWPYeK+6jxZRkzv54d5Vm3VEZGZfiqthzMS2T6+gHRAZMQNtsJYH HHvty5FXkO/puiy4OEWt1K6HASTf0gEIS3O9iJN7bM8njk8rjilZTQ1emkaQ1Yhhj8rQ E5enBrOnqLEV3r35RFRb4WGh7kPBFCNuiw6W/reEd/W2dBDBgJBjUQXOnT/XLv0S6W1D GUkyYsHBURVqZdKJxsIAYZ5Q/y679p27p3jwH2lFM9xqvOV4DcfSb2vkXEYvtQhd6JY2 SKR8ksHtgefwM/PDGqCUm76wfZdW6MbduCLtiTDK0N+GZXidjQluL1pKFZ1MGKcwt84E dHHw== X-Gm-Message-State: ACrzQf2cE5l0t7zdr/39HOb4JSytZ8E3m37QNUnhCcOkbnUPKnk7SjDa xjUAG/NvrvqeelQ/E8jFDaP8S6HRIEIl9w== X-Received: by 2002:a17:90b:3846:b0:20a:e735:f84c with SMTP id nl6-20020a17090b384600b0020ae735f84cmr2977514pjb.183.1665027879393; Wed, 05 Oct 2022 20:44:39 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:9ad0:4307:7d39:bb61]) by smtp.gmail.com with ESMTPSA id y6-20020a17090ad0c600b00205f4f7a3b3sm1905086pjw.21.2022.10.05.20.44.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 20:44:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH 17/26] target/s390x: Introduce help_goto_indirect Date: Wed, 5 Oct 2022 20:44:12 -0700 Message-Id: <20221006034421.1179141-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221006034421.1179141-1-richard.henderson@linaro.org> References: <20221006034421.1179141-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add a small helper to handle unconditional indirect jumps. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich --- 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 fc6b04e23e..712f6d5795 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1189,6 +1189,13 @@ static DisasJumpType help_goto_direct(DisasContext *s, int64_t disp) } } +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) { @@ -1219,9 +1226,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; } } @@ -1545,9 +1550,7 @@ static DisasJumpType op_bas(DisasContext *s, DisasOps *o) { pc_to_link_info(o->out, s); 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; } @@ -1580,9 +1583,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; }