From patchwork Wed Jun 5 21:57:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 801655 Delivered-To: patch@linaro.org Received: by 2002:a5d:5610:0:b0:35b:5a80:51b4 with SMTP id l16csp48407wrv; Wed, 5 Jun 2024 14:59:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVVbEav2cWG53ObpkKKubS1U+IxCIWkpfwXYyLCJUPn7pUj04R9lr/SPTeR1nI+htUOwsZzLaQU+nj9wuLdGs3x X-Google-Smtp-Source: AGHT+IHfSktsdJXTV6uVX9r+2u+tbGEe0Z9SIG8XzjCstsjcNfZ7hKpcVVHT3M+VZOu6aqMh+Fbt X-Received: by 2002:a05:620a:389c:b0:794:850c:8bcd with SMTP id af79cd13be357-79523fc1e75mr342248585a.58.1717624769042; Wed, 05 Jun 2024 14:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717624769; cv=none; d=google.com; s=arc-20160816; b=IAvdKmBo4TUqh6MYPRvYu9MVFqoPBhz11gs/ejiIA1p73UrNWuldpONiEfIlKqxCsS ByrmkusMm1emx9HQJO5x9Bnl/kawcIAU4fUL2A9Zo4GH8wm/sB2Ypx7aSSjv8wx/FrH+ Jqz7fORg2EZs/3iwjwhRbvIpFQyrmw5AxMxirc9EpLTN/klagSWj9DoFrg4KKuV3znSs Wh4jXv3kvBoFK7pcc9Jaz6CcLa41WM6oawjRlgGGDUwaij8QCB+vS4bho0EZYOhynKUK 5/z2Vu/vhqo/hElhP1Rsw43NyT1jljlza/Mq977rLJ8dRcvTS7HF2fSMkhyDLsXFp7PU qD0w== 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=sQiUj0T/PhZH9aPIOQew7TG39LwQbDZ+11m+rsBXajM=; fh=2xkb1hkZON85aQlY8H6YQD8NjCAJw799l8+ye3ZWOCA=; b=RgOspTKIAUSBLU3MyYVcWnZ1oeAva1+0YOuAslg3zubaLzKXcQ6PsjxDbRzzn6MkN8 +OxsNcPnWz8BLokCWp7VVkqQkdNqp/W4IK0bm8mXcMAAcrZtp6Lu/RVANUlxivs6Xwtx oZAl68/vMxREcBQQzdazelyf5/gvX8ngMMVUOSFi9t1M2ldlKkrcgIjHen4wZQZfDDv7 fJc/JO8Kc0K55peuoKI+TrpxbQ7Ush5fScQkkYiR7sozHZW58d5BbORmHCVw4NMErfA8 7uKrvCjdlSqjF2ZmFHID9jjJndM+UNadpwfboArcuOXRtmIwR3nsvEKf2lYFvP2HwmH1 p0/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oMrCbql9; 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 af79cd13be357-7952f91167csi57177485a.154.2024.06.05.14.59.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2024 14:59:29 -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=oMrCbql9; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEydh-0001jT-1Y; Wed, 05 Jun 2024 17:57:49 -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 1sEydf-0001iN-Pe for qemu-devel@nongnu.org; Wed, 05 Jun 2024 17:57:47 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEyde-0003qA-8W for qemu-devel@nongnu.org; Wed, 05 Jun 2024 17:57:47 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-70257104b4dso253716b3a.1 for ; Wed, 05 Jun 2024 14:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717624665; x=1718229465; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sQiUj0T/PhZH9aPIOQew7TG39LwQbDZ+11m+rsBXajM=; b=oMrCbql95Zslbf7bsPALssQkGmWWNudO74PCupFeVJOMZhupvAXWfYhLX0mgVbTKsS f17w3JTNwypsXjbzOzqy6dZ9Xs7DzIoBUpicK8KGZUaH0z5zfmO86YlecM+XhJYQLpbs 3oDE7h7ze2CAIeGNs8F1SrsAFoQqOGdfm02VQdULHfDD0yZpi4inZUYtic2CoH2qLGa5 EjJTLzHzOcOuNyYpAomSTO1pXFWdYNXFGjH+RNdCjTjUEdAhOII+R6wrB9Qs4gJdo/Hx xEJGFWX/tYu32ma0ih1/3LyZMsPsAx6S58Oh239pJqg4oqa5n4c8DYyCgzIvrtcUDBW5 DClQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717624665; x=1718229465; 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:message-id:reply-to; bh=sQiUj0T/PhZH9aPIOQew7TG39LwQbDZ+11m+rsBXajM=; b=WYGKNeXgqNo7EPpGqA9qeWA480uOangs0AOTKx9QyGblsQ10L4LUV6XFUvETodiQf5 z+Oht7dluI1Wj+4ir69IJfEGWamg69yGBDpuFCg4q6k2X1sm+pRmdqOx3oOBkh8A6r8V giGRJYv0ktgWmIisLESKec+HQRQkCVxyeZqdN6hk7OJ6hHJaiHFL096C4g1TVJmY+jrt 2NO/DhTgPUaNiZxuoe2egRWWIIMCY6slW0FFImzyWR9lHU/PXIW/GvdEbb77GEdkzZaG gcwnrLzy2oGzIgamDZkvqh5dy00e1UC8UaVHDzQTledzd1u3iNjG1KX40wOhe4LSJNFM znaA== X-Gm-Message-State: AOJu0YxqwHVPlISZtvmQlFZjPrA8JzgY7Pv5fuJ+oBlKY/E0PMlFwnnJ FjtSXsGF32CcmKY7zpBm0AnXh5pdBY93yaEe2TZM4JUGnXL8Q2abcNzQfp8cCCtYauQgAHO5tvH h X-Received: by 2002:a05:6a21:3996:b0:1af:cd4a:1e1d with SMTP id adf61e73a8af0-1b2b70ff62dmr5062678637.40.1717624664972; Wed, 05 Jun 2024 14:57:44 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70242b2ff9dsm9091509b3a.212.2024.06.05.14.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:57:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PATCH v2 04/10] target/s390x: Use gen_psw_addr_disp in pc_to_link_info Date: Wed, 5 Jun 2024 14:57:33 -0700 Message-Id: <20240605215739.4758-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605215739.4758-1-richard.henderson@linaro.org> References: <20240605215739.4758-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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=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 This is slightly more complicated than a straight displacement for 31 and 24-bit modes. Dont bother with a cant-happen assert. Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 14162769a9..2d611da8af 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -174,17 +174,19 @@ 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); } static TCGv_i64 psw_addr;