From patchwork Thu Oct 6 03:44:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 612884 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1210063pvb; Wed, 5 Oct 2022 21:08:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7n66/QPVOH6xxv1R+NudT/aAE1P86duWEX+uyzA8a1PxynTlXn4kXnl9LXGj1Vl36x9h24 X-Received: by 2002:a05:6214:c4e:b0:4b1:aa37:f4c1 with SMTP id r14-20020a0562140c4e00b004b1aa37f4c1mr2259469qvj.107.1665029298245; Wed, 05 Oct 2022 21:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665029298; cv=none; d=google.com; s=arc-20160816; b=TCgOQSmv68kjJ6WTBGnjkO+Ng7TRHh9KPzKJmg6e/hrGohW4Uuh8Moe5vyBT/9uhh9 oyBAkIVDx6KY6wB282IrvwuyHjF4CSBEumJGp0kngW213wN3e2X69pfKor5AiFhrjQnZ ZCm8Ad+gpFtZX1afV9Xz53w1eUa2m6kMiz/ILi987GhIp8/xfJ3xEddUuyhSSZbxD/yY JaY6y0Saaf3OJVV4eg0RLTJ0MQlUHL1B2o1vDLjfJfwgTRXCJUJjFSjWcN2HwdNen8WU LZTJyaiXC/HkfzSOgfCpGvyT9lNVQFJ6YokU2wZjwJCc39cM3xDJ4a/xDed6fPjrPxSx Ja4g== 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=LsDZbHydcTU+7tcU++exijoc1WAx3468SMsmfORvMzo=; b=pqvsQg19XERfmsL+leCJXCrpn0m5B+3OFT75yrFf/BKhZQcTHvGO9bZQ57EonQi/ud dGdHy2gP0MDGLsQtD1BLK9bzLRxIwbO90snM48I3lzbUKmYjs3rq0PrXQvrP86Pttc9A jWCpjydLyag5iwNHtJDdd5GUHD5G78dUAOtiHFl/kpQvjhKzB1pg+qck69tgJYNXDaPj Aj/EH6WtaZX9qjTDx+Im9/gfmdf1XnyIzV4fMQhI3XQb5cKiXxa857DA6jGOE2kv6bhb Fo38Uog2CPOyqCpiV4TIgDaWahRk2OAUO6OmMMNKRiyqWpVh5KpFtpeYYV3erHHOusZT woZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N5PA4meb; 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 h4-20020a05620a284400b006b97a3ec632si7234089qkp.95.2022.10.05.21.08.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Oct 2022 21:08:18 -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=N5PA4meb; 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]:36670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogIBF-00082Q-OX for patch@linaro.org; Thu, 06 Oct 2022 00:08:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogHoI-0004AA-JL for qemu-devel@nongnu.org; Wed, 05 Oct 2022 23:44:36 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:45971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogHoG-0003t7-8E for qemu-devel@nongnu.org; Wed, 05 Oct 2022 23:44:34 -0400 Received: by mail-pg1-x535.google.com with SMTP id r18so722662pgr.12 for ; Wed, 05 Oct 2022 20:44:31 -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=LsDZbHydcTU+7tcU++exijoc1WAx3468SMsmfORvMzo=; b=N5PA4meb6IAY6JLvfOuFcrjTjEjaDGdIvVfxmUQnXcLcAtXhUzV3GGqyI6iCCS8Zwy ZfJ6kQI/QsA9g5jQRUvuziucWhpjKEKja22ezo+1NXoPyg12cZbAiz/Nqr9YUElVqrko vUt/HSrSCSLKhkrMEixSRCNds52dM2zkAfSPSSVmOKZ40Tl5aWY7Vr4Ott96yaSYk/b4 iRec1KxZXwTZ1rxmk1oytdsAV2KvOQsSEt8rnCNqyzhL5J+ZkBngx8PKucH0HUIaIkwI ig7lFlnAk/cybZlN5zepeaMHYIFAemyctmtLQKUrDTShTuvKYbWlrvg/plkrU5qmVlUt Y4Cg== 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=LsDZbHydcTU+7tcU++exijoc1WAx3468SMsmfORvMzo=; b=UksBpskrHdBmqbCtIZVIu3/VaHdMVgnFqLzpNu8Qq7EZWE2HBFWk1WPvUHpiVGGcm/ nZQHCz+1DLmZ1ZMwpyxDK2FWuAEyKh6jVHsThaf815wmixYi6V9tT5RdgT4BQ7S2buGN vFrNGyZSGBEkKN5SPUTg5J8CqtkW+RQKxlr6FFaSGdWW/6Y5dkOjuyy379qRvJO2ebgJ iWEH9qWOk9aT/zuIw9Tat3xLPoucxiAo2njit+kbTaKZNJuPD3m0Xlbs8bHCDzMccp/v tXCJ//5iZQk5576DctKauawZ7mcwBWPpLEHsvNWy1LUVXRG7YS1vC2K9gSdHkM9mc09+ zFeg== X-Gm-Message-State: ACrzQf25IdpCVQJyQLXt3ev0rK/gdNroPKwdohEIZtr9NhjP3sTxcTli 9+7Wyx5Pw6qdDmF7gPKvBaqE7a8rZxwacA== X-Received: by 2002:a63:1508:0:b0:438:eb90:52d1 with SMTP id v8-20020a631508000000b00438eb9052d1mr2724115pgl.252.1665027870856; Wed, 05 Oct 2022 20:44:30 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 20:44:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH 08/26] target/s390x: Use gen_psw_addr_disp in pc_to_link_info Date: Wed, 5 Oct 2022 20:44:03 -0700 Message-Id: <20221006034421.1179141-9-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::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is slightly more complicated that a straight displacement for 31 and 24-bit modes. Dont bother with a cant-happen assert. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 7c98a72ddd..4c3ea958d7 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -176,17 +176,20 @@ static void gen_psw_addr_disp(DisasContext *s, TCGv_i64 dest, int64_t disp) static void pc_to_link_info(TCGv_i64 out, DisasContext *s) { - uint64_t pc = s->pc_tmp; + TCGv_i64 tmp; - if (s->base.tb->flags & FLAG_MASK_32) { - if (s->base.tb->flags & FLAG_MASK_64) { - tcg_gen_movi_i64(out, pc); - return; - } - pc |= 0x80000000; + if (s->base.tb->flags & FLAG_MASK_64) { + gen_psw_addr_disp(s, out, s->ilen); + return; } - assert(!(s->base.tb->flags & FLAG_MASK_64)); - tcg_gen_deposit_i64(out, out, tcg_constant_i64(pc), 0, 32); + + tmp = tcg_temp_new_i64(); + gen_psw_addr_disp(s, tmp, s->ilen); + if (s->base.tb->flags & FLAG_MASK_32) { + tcg_gen_ori_i64(tmp, tmp, 0x80000000); + } + tcg_gen_deposit_i64(out, out, tmp, 0, 32); + tcg_temp_free_i64(tmp); } static TCGv_i64 psw_addr;