Message ID | 20220906101747.344559-9-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp4427064mae; Tue, 6 Sep 2022 04:13:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR5dheB0EQf7tij0OyGKYWYNufqOhNp2c1Xky+QDPD/DBT/uSNjlvHVflqL9HTAyn2Vm/i9A X-Received: by 2002:ac8:5e0c:0:b0:342:fb4c:ffa2 with SMTP id h12-20020ac85e0c000000b00342fb4cffa2mr42560067qtx.618.1662462788588; Tue, 06 Sep 2022 04:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662462788; cv=none; d=google.com; s=arc-20160816; b=kWjJJKhL43jmI4XG413b6wNqHHG8nUFT9xKXqPMmTvCDJAq7Atgy+nFZe3GSH5/vBg rK8k1z3HdvTEnDUeyLEKNtPbei4z2HHiFHNGRxCfWSEyy0aAw6ASoDde+sSf7OByIRyF j52xwy7lFnHDxNlAlEIuCM52NkINWF6QLFNZxTYHbebt/HuhL3oHGsXX5cYiH778EnVZ +y7YqkwGnLUGxUUlzieUulrsG4cA2ogH5IG3JzBLyznvMKbZ3cFm3RSbI6wesqlgH74W UInot4JWml24jZNS/LvFO+mWb8Z2J5mxUbUayCflmM6pyYNu2OT/oljt7n1VeP/fro2g IvAw== 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=b/FY8f7QO9bChdWARwd82cKViS3WY9IA+Jnf9CLHDXUx4pRqBIZGgExvts7OByvmVk hnl7sltRS/AqmYE1z5Zf0ScjF9kpUCaUGfaDo7/my137ObtTi5ZZgVv9ftYoI1AL+MbB QK2qybcOYN+Z+sHiiWQhNt2Y0jfsUfYZJECrD59wIVyuR4cqsa6DcQvt8Tb15aAOtmEb RgMSKXVy3PxzDOHJ2oeGaOIncPS0w///hOgcz+0wy5PV7nWUNFnc88Pk9lQmsmavQlUg wxuSBqI+yUI44BwkBopUZZYNWDfMK1yHdgxe/2bawf4pgYpvT2+AOH9Su8FnPfNj1/FS g4Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fFPIr6sh; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g9-20020a0562140ac900b004aaa28c1e62si668651qvi.403.2022.09.06.04.13.08 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Sep 2022 04:13:08 -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=fFPIr6sh; 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]:59296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1oVWVw-00009E-6D for patch@linaro.org; Tue, 06 Sep 2022 07:13:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1oVVeh-0003Nz-J6 for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:18:09 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:41716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1oVVeX-0005Am-Ph for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:18:07 -0400 Received: by mail-wr1-x42a.google.com with SMTP id t14so7410003wrx.8 for <qemu-devel@nongnu.org>; Tue, 06 Sep 2022 03:17:57 -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=fFPIr6sh8d1QYYMkT/KaALOSqq+yXmkto0lyVXM199YguOhqGu7yFnIIYmKb49oQeP dCpQsq55fKP+QVCDju+asWAXGqT7sge6JgTpF6LwA7AHRIdLmzpC7QWQtEOkvbtUcFsp Y9UD2J6cQ9jSx0hSHcERwZVxkkpAqn7jKEGxtAzvaPTJg8UdLGCf9Vv0iwYsf4cHt7Pe 20q6oU2J6C2W2yIgAHSz01cS0KjmMbr/ybiXuCmsNFhzydixlmeR8HSRdTQqvO9CY3ld 5S9o2TGQVRCIIsfuEE8+56s6UVj60Nsg83E0LLqMgEXiUul+i5/Kw4D7WJUYMLzw5VVZ epkw== 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=zNGE1wT2vdXbp4Jj52VhoV8JHg0tYuOY+uCGlmX3+vJTDc07WWhOgR0dC1t20jOh3z Q7cTz+pCVE1DjgHoA8Xw10NUYTz3e0v8QkzqQKn0U/JqMinEGdCMfuy5fAtsl9/YQWfP ++Bgl/uFWlb+XQw1VLgp++DLpSbJuK4VPNHVxehYl+4L9kD/f1OJnT/oi42c5a3J8t3U EuRlY0LPdt54xeyYtMbKp+7/pWjxdXDxXHOd8lbpozorZFOaDwotLEn8hDhBxE3j6zvt pwjIBI5IadQxA7EUcmrP/UCet+HXZyMUgpVWYSzlvnqRHrm3Z4ebPTpue1i0ZX/g0aZB dZ0A== X-Gm-Message-State: ACgBeo2fprl/3WDNzlEatE3WfvUC1dx4J95Oh31tAJBGT40/7C3ii5YX Wr4Kjt40nnaBYGpBf0ZwGx1QAo2qtKH/roSl X-Received: by 2002:a05:6000:78b:b0:226:d10f:1c3 with SMTP id bu11-20020a056000078b00b00226d10f01c3mr25551902wrb.149.1662459476945; Tue, 06 Sep 2022 03:17:56 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:17:56 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH v1 08/26] target/s390x: Use gen_psw_addr_disp in pc_to_link_info Date: Tue, 6 Sep 2022 11:17:29 +0100 Message-Id: <20220906101747.344559-9-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: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42a.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
target/s390x: pc-relative translation
|
expand
|
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;
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 <richard.henderson@linaro.org> --- target/s390x/tcg/translate.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)