From nobody Mon Nov 25 05:40:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1717624778; cv=none; d=zohomail.com; s=zohoarc; b=U0DFL7qNSGp5bAGwuWwK9zm3TtHIRiNznFaahqW5xAeqKvTQrkwRAHcSwmP0/kI9v6spdcplHXd1hWUP0NbFAWTeSOd8nplskrsPNGIn9/p3cy5ZSNgMbT7z4Vcjuf34RbL3Pz2uf5iPdgKFsfRKyVrvkXfsykA+5x2JD32b7qE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717624778; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WqJiYcxvLTtBfrkGq1JS6zQ0ORon0JfeSUXl0F2Pjw0=; b=j8IlxjfdOQRqnF/JUi9OY7BrKcJZqDeZipKx++LgY9aKIWBP6aEWi0pvY+PR0cTYGc5CnTirJLlzdLuP+ty+NFOu6TzMfMVKqrwawiWMqdIzdWKGv/5ZCCNMCA/RInt7e32qLK0f+WLMq7nyNmfUTzGWCwpJhj2nQNEprAPN77o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717624778513797.4039694525136; Wed, 5 Jun 2024 14:59:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEydj-0001la-Ot; Wed, 05 Jun 2024 17:57:51 -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 1sEydh-0001kE-St for qemu-devel@nongnu.org; Wed, 05 Jun 2024 17:57:49 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEydg-0003r6-9c for qemu-devel@nongnu.org; Wed, 05 Jun 2024 17:57:49 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-7024791a950so993844b3a.0 for ; Wed, 05 Jun 2024 14:57:47 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70242b2ff9dsm9091509b3a.212.2024.06.05.14.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717624667; x=1718229467; 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=WqJiYcxvLTtBfrkGq1JS6zQ0ORon0JfeSUXl0F2Pjw0=; b=IJjguOA+wV76QeGHf1bPQswLwsRlKjCgXnCZGMcpbUmDxjkVDekFZvkEUynDcRt6Ah O1GXkEf+cOt0FoWvEEDD7a7e0pW+1otDUEqYdzCTZbv7VKdYKBrHKI3er3Ub/MqpANqQ nIOTPd7jpKss7OsMmwe+l1hR77QkoU40Q9yF8JSCeYegmNc72P6j1UUsgdg9P80pgyG7 bUeN8zyO6ynkQSA17QGm7zhfnVncgfJ9Cz0B2J5vmo3+RaGF/TeXqmQrbyYsfYYoy2x/ n4o+NRcPpUcMPlP6nc0FcOzuUIZq1Puzvv03QIVXOVLVLmFjXC+C4cXrt/nkrscqkta7 aXjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717624667; x=1718229467; 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=WqJiYcxvLTtBfrkGq1JS6zQ0ORon0JfeSUXl0F2Pjw0=; b=sUyyonhCfI1i+wA4Hb97yUyWYj5MsbzwfwKCNkE5zTgrPbAe7v7PdRpibH08I6TPCw R/CYJBbxRczA3aKbVkGI1XtplzVs85GmFWUOD6ngm7s1W5C7Ed5N9v42dMgvB9rTfpOM mIOImaC8Q8E/9EHOCl5aRQWz68vYPcgxg+68q7t7pzQOAd8/kpK9hMbNy23CCs74f61X dxg+1RjIHa24oBS5bAkpeP/OLV92XVK7txyJL9DlX6OPnvVQRJ6Ndxj7luPVhvcAD6f5 djoGBjdmgZzFjyuYdEr93e8QDO6UfDsP/cuNoEbBJ8rRbnWzGlkcIN0XYj6Mfa027NPV P/TA== X-Gm-Message-State: AOJu0YxdvwfP4iOjPLDU0EaQeS/kaH8dIoOwqNGKLLYq82cwu6cjipLJ Y8VmhxOFOrHR7WGPUsy0RCHSoEyBSLYN98EjOsV1nIL31c+QZ+Qh+6KjzX4OYa+HCzYgeNLOjO+ J X-Google-Smtp-Source: AGHT+IEU/n0+Cd/+x13+8albmCF6ZvlsR+3nUdVjH2KEtjQ+w4jU7vlY46HSJ9HQRvLGLho1kzN+vA== X-Received: by 2002:a05:6a00:6611:b0:702:454a:f543 with SMTP id d2e1a72fcca58-703f83ce2f4mr1043707b3a.0.1717624666963; Wed, 05 Jun 2024 14:57:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH v2 06/10] target/s390x: Use deposit in save_link_info Date: Wed, 5 Jun 2024 14:57:35 -0700 Message-Id: <20240605215739.4758-7-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1717624779596100003 Content-Type: text/plain; charset="utf-8" Replace manual masking and oring with deposits. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 2654c85a8e..0f0688424f 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1418,24 +1418,32 @@ static DisasJumpType op_bas(DisasContext *s, DisasO= ps *o) =20 static void save_link_info(DisasContext *s, DisasOps *o) { - TCGv_i64 t; + TCGv_i64 t1, t2; =20 if (s->base.tb->flags & (FLAG_MASK_32 | FLAG_MASK_64)) { pc_to_link_info(o->out, s); return; } + gen_op_calc_cc(s); - t =3D tcg_temp_new_i64(); - tcg_gen_andi_i64(o->out, o->out, 0xffffffff00000000ull); - gen_psw_addr_disp(s, t, s->ilen); - tcg_gen_or_i64(o->out, o->out, t); - tcg_gen_ori_i64(o->out, o->out, (s->ilen / 2) << 30); - tcg_gen_shri_i64(t, psw_mask, 16); - tcg_gen_andi_i64(t, t, 0x0f000000); - tcg_gen_or_i64(o->out, o->out, t); - tcg_gen_extu_i32_i64(t, cc_op); - tcg_gen_shli_i64(t, t, 28); - tcg_gen_or_i64(o->out, o->out, t); + t1 =3D tcg_temp_new_i64(); + t2 =3D tcg_temp_new_i64(); + + /* Shift program mask into place, garbage outside of [27:24]. */ + tcg_gen_shri_i64(t1, psw_mask, 16); + /* Deposit pc to replace garbage bits below program mask. */ + gen_psw_addr_disp(s, t2, s->ilen); + tcg_gen_deposit_i64(t1, t1, t2, 0, 24); + /* + * Deposit cc to replace garbage bits above program mask. + * Note that cc is in [0-3], thus [63:30] are set to zero. + */ + tcg_gen_extu_i32_i64(t2, cc_op); + tcg_gen_deposit_i64(t1, t1, t2, 28, 64 - 28); + /* Install ilen. */ + tcg_gen_ori_i64(t1, t1, (s->ilen / 2) << 30); + + tcg_gen_deposit_i64(o->out, o->out, t1, 0, 32); } =20 static DisasJumpType op_bal(DisasContext *s, DisasOps *o) --=20 2.34.1