From nobody Mon Nov 25 10:19:14 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1716506176; cv=none; d=zohomail.com; s=zohoarc; b=n6SX6KoU1wArEF7Jf9w7CcNYJ0Rfp7iP0S6bYC+7kKFDRPCWenC8+G366H812xLg4ORHAAuSO5dXqjZbZTs9dhuemiByGwJQowhPFpchs6FwePRz+8ET/U/Pvy8G6jBTessthE0EvMDa/uw8MVgnPkj7/QvtsTKEqLj0/yfcFG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716506176; 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=I4d7XUcJzCAh2lNbuPfDveI1FIlIsOOzA/QEZslDQGY=; b=J06JQjq3Zh8bP83a04kkf8lHVW09w5oQvQc6UxE/np9rjmLTccop6fn0xyHh0vHOE7t3/Fx6RhecM6cQVhJdojnjaO6iUr8AjwTTUs0aB5aW0q3jwihRgLfiZqAeafBww1P12PPBECM1T3SA1qKF7XsFtl3xi64UqaSAHvsSV1w= 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 1716506176916185.75547867846024; Thu, 23 May 2024 16:16:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAHYE-0007Tm-U7; Thu, 23 May 2024 19:08:46 -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 1sAHY7-0007Np-P8; Thu, 23 May 2024 19:08:40 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAHY6-0005iN-2n; Thu, 23 May 2024 19:08:39 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6f4d6b7168eso3008381b3a.2; Thu, 23 May 2024 16:08:36 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-682227f1838sm87041a12.46.2024.05.23.16.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 16:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716505715; x=1717110515; 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=I4d7XUcJzCAh2lNbuPfDveI1FIlIsOOzA/QEZslDQGY=; b=Nuw/LqW5O+kzjF2yQnDhA5Fz74Ged37hGB7RcfhKDCsQGbVgRWZfuEonfcLQiTmO/3 1K3C+uMgnZPJmmp2h5KE89U9Fw+g5slHdxtidud/CYx1BgrmNtdLXUNna5xndr6Aptgm Lci3jjdx3q71rypjMa7Ad4ZgFbCwPKKxGqQICOHsfSJ1CWKZC289PjUINegrLyYJgUIe L4Da8Wyj+iyScufHdglXl2dkShqjEx+yu9KuiR0FXLuyID6PUyqNbcpmHdSWH6KcxKcp 0/3Hs9hmiUVIkhTZitqdrdzj42cY+YQtc4adJBx5svN+WHRzvctTF6Wk56nqtmf6iLl9 MB1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716505715; x=1717110515; 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=I4d7XUcJzCAh2lNbuPfDveI1FIlIsOOzA/QEZslDQGY=; b=lggjHPM3PsBvk/6jCbG6PTcdIst6iENgxQl8ThwxspEdoQHHa5zrzaDD1FcFrdTRiQ U9fy5alGORovQdN67TMR2DvUpeUWJ2uLMJteqAzRJh2e6V9gb8Z/D5Vym5ML+9oeh/vr O6fqqx6ThOWt+twUnSFWLZMAZIn8KsR3yB4QdriWsGNy5nUAnJ9Qbfi8yqzuKvH3WXR2 t3JeNOgyHYACD8A745siGuAP9oA1dSWk40hEDcAlSiUtVNzPtQQNbBnnJpK4/Msf48Lo JMHBEbYYfuwht4tBqnu2s6RlsqF0Dk6I3QN/6LE+6eQdtBuo0V3fXhqdQSWCVklj1HZg k0Bw== X-Forwarded-Encrypted: i=1; AJvYcCXo/fLyWMWd4XOkNKU6OBMOy3q0R54IyufQ/zktidSdqrSsrn5yrNuJ+XxeoxuhHoiwnsXBbMM/yhc5mcYy5kOkJrIN X-Gm-Message-State: AOJu0YxiNLNy2vSU9rSZp43wCvJiLFyJnomung4V2pbicPydJzcbDKyP PtKJkppZLmUr6obAW8AuqM0kat6fSMyrqn5Kwi7DRN+LXoIYJhpXM6UHrg== X-Google-Smtp-Source: AGHT+IE98Yc0aXhnbr/CUOsgUawmZN3GwmXreQ9lvFTiSuRkWkcufmpc8ESqD5XqC4vT3UqZvQ8tGQ== X-Received: by 2002:a05:6a20:96ce:b0:1af:a617:86ac with SMTP id adf61e73a8af0-1b212e57227mr751939637.53.1716505715572; Thu, 23 May 2024 16:08:35 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Chinmay Rath , Richard Henderson Subject: [PULL 12/72] target/ppc: Make divw[u] handler method decodetree compatible. Date: Fri, 24 May 2024 09:06:45 +1000 Message-ID: <20240523230747.45703-13-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240523230747.45703-1-npiggin@gmail.com> References: <20240523230747.45703-1-npiggin@gmail.com> 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::42f; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42f.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, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1716506177597100003 Content-Type: text/plain; charset="utf-8" From: Chinmay Rath The handler methods for divw[u] instructions internally use Rc(ctx->opcode), for extraction of Rc field of instructions, which poses a problem if we move the above said instructions to decodetree, as the ctx->opcode field is not popluated in decodetree. Hence, making it decodetree compatible, so that the mentioned insns can be safely move to decodetree specs. Reviewed-by: Richard Henderson Signed-off-by: Chinmay Rath Signed-off-by: Nicholas Piggin --- target/ppc/translate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index cb10e33ceb..277d96aa94 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -1737,8 +1737,9 @@ static inline void gen_op_arith_add(DisasContext *ctx= , TCGv ret, TCGv arg1, } } =20 -static inline void gen_op_arith_divw(DisasContext *ctx, TCGv ret, TCGv arg= 1, - TCGv arg2, int sign, int compute_ov) +static inline void gen_op_arith_divw(DisasContext *ctx, TCGv ret, + TCGv arg1, TCGv arg2, bool sign, + bool compute_ov, bool compute_rc0) { TCGv_i32 t0 =3D tcg_temp_new_i32(); TCGv_i32 t1 =3D tcg_temp_new_i32(); @@ -1772,7 +1773,7 @@ static inline void gen_op_arith_divw(DisasContext *ct= x, TCGv ret, TCGv arg1, tcg_gen_or_tl(cpu_so, cpu_so, cpu_ov); } =20 - if (unlikely(Rc(ctx->opcode) !=3D 0)) { + if (unlikely(compute_rc0)) { gen_set_Rc0(ctx, ret); } } @@ -1782,7 +1783,7 @@ static void glue(gen_, name)(DisasContext *ctx) = \ { = \ gen_op_arith_divw(ctx, cpu_gpr[rD(ctx->opcode)], = \ cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], = \ - sign, compute_ov); = \ + sign, compute_ov, Rc(ctx->opcode)); = \ } /* divwu divwu. divwuo divwuo. */ GEN_INT_ARITH_DIVW(divwu, 0x0E, 0, 0); --=20 2.43.0