From nobody Wed Nov 27 20:33:27 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=1697666526; cv=none; d=zohomail.com; s=zohoarc; b=ah9Qe78LHbKEkjYwyWflh5WjjFlpCUvdoNsg1q8VULAHCII+YMjJSryQXXsaWSMf0H2VAWXQ9WB8x++bOVnY34qVCNvckGsfntpHm5NEu8is2DTJeqJ5Mgb+LGThUCUULiDyOlg9LcjGX0HKOUi8i0ooNHIgNTyYUX1KupXgarg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697666526; 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=J7IvWHKNslLXyxg2gDsUoAZIYZRNssROan/QZtA5zx8=; b=DRTzL/MH49m2h8yiFmZw8FM4PXbV0J8CRJn95pw8Hxf77wqA72rsbfqRgms9Hr++L+tljZU+C4mhDmM8pA8sWW99YNCqCsETT9FofzNwS44iNVx+Mm/decy3Xi6B85TTs7NsZ1M93qdUKautGJNkSOnfhXTAQHMZv7C2Rsifz9o= 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 1697666526677611.617300713082; Wed, 18 Oct 2023 15:02:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtESn-0001zy-1v; Wed, 18 Oct 2023 17:52:25 -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 1qtESQ-00019q-BD for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESO-0004Rf-53 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:01 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso5473239a12.3 for ; Wed, 18 Oct 2023 14:51:59 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665919; x=1698270719; 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=J7IvWHKNslLXyxg2gDsUoAZIYZRNssROan/QZtA5zx8=; b=C5MnWHZoTGAv0Z3nTmEM8dpenBbjFupjo4DxWkzPdQar78cyjTymNq8VglYO23Dkfu sTnfQIEE6oWz+nawwK+NSxTpJ8xwWNXh+YCfD/nId+VVwNnG8FiZGg35JfwTBWXlNoco yMVl853X8qiU6ykwCpnBysL5g9zBTWNQufWwsND+VZpQhAGgIC/nhWoG5+EQh1TrquWj IJd/7HqekQ/mteeHxpqxwkTP9AgTJBIFS/4IL3EOse20Z7eFVHR+6TPGhaAKdhFTVnGs PR+DQdqqdggWoWXlBIWccSRwJYFKbXIum71949tFF99k4M0+rF6aWhN2toxCwf4MAz9h QHqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665919; x=1698270719; 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=J7IvWHKNslLXyxg2gDsUoAZIYZRNssROan/QZtA5zx8=; b=WO4TrnPht+d7KRi64U17dZ2qMbuSS//+/dWQkBvgkzy93uKmFNOcHHzgGXxM33wEYa L9B/MEEqYpQVsXvzGRRD8o5u/XN/IYJCOkoRwbez7O46mWt13Olt5om9OEPcSy7n9COw GHqwmkzRKmBq+n/EBa8H52oLdXC0N7eWyWVwTuWjgtrqS8P+BFePRcwvjoiJDNM2QpP3 l5aPATzaUABfOaxbaEqxjRqBivraY+942tib4kGTLx9W8k0IvOfGtw8x9KdK/ZnXtkFr NalTc4cyK5ZgaZx8xYYzVBrE3dYPmhTopEhP3acWri9GaXpkSRjB3JUakcVbvmTA4pTv I+2A== X-Gm-Message-State: AOJu0YzDckaNj1eoIPYTUq/fQzc63+xfcC99ZRbS2B5yVp97GyieR3K3 DzhQMSSbin268cU8zABU8nYaCUEMEV1GZduqO1o= X-Google-Smtp-Source: AGHT+IH3qtik9S79chgKlomdD8n790b7kf8E/DYGA19itm2Yjfbp1pfn8ZzI3uxz4j+4AMNb7clmqA== X-Received: by 2002:a05:6a20:42a0:b0:16b:c9f2:b632 with SMTP id o32-20020a056a2042a000b0016bc9f2b632mr456356pzj.62.1697665918873; Wed, 18 Oct 2023 14:51:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 26/61] target/hppa: Pass d to do_unit_cond Date: Wed, 18 Oct 2023 14:51:00 -0700 Message-Id: <20231018215135.1561375-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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=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: 1697666528841100003 Content-Type: text/plain; charset="utf-8" Hoist the resolution of d up one level above do_unit_cond. All computations are logical, and are simplified by using a mask of the correct width, after which the result may be compared with zero. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1a51ac4869..8bea28f0fd 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1056,11 +1056,12 @@ static DisasCond do_sed_cond(DisasContext *ctx, uns= igned orig, bool d, =20 /* Similar, but for unit conditions. */ =20 -static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, +static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) { DisasCond cond; TCGv_reg tmp, cb =3D NULL; + target_ureg d_repl =3D d ? 0x0000000100000001ull : 1; =20 if (cf & 8) { /* Since we want to test lots of carry-out bits all at once, do not @@ -1087,32 +1088,32 @@ static DisasCond do_unit_cond(unsigned cf, TCGv_reg= res, * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord */ tmp =3D tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, 0x01010101u); + tcg_gen_subi_reg(tmp, res, d_repl * 0x01010101u); tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, 0x80808080u); + tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80808080u); cond =3D cond_make_0(TCG_COND_NE, tmp); break; =20 case 3: /* SHZ / NHZ */ tmp =3D tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, 0x00010001u); + tcg_gen_subi_reg(tmp, res, d_repl * 0x00010001u); tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, 0x80008000u); + tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80008000u); cond =3D cond_make_0(TCG_COND_NE, tmp); break; =20 case 4: /* SDC / NDC */ - tcg_gen_andi_reg(cb, cb, 0x88888888u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x88888888u); cond =3D cond_make_0(TCG_COND_NE, cb); break; =20 case 6: /* SBC / NBC */ - tcg_gen_andi_reg(cb, cb, 0x80808080u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x80808080u); cond =3D cond_make_0(TCG_COND_NE, cb); break; =20 case 7: /* SHC / NHC */ - tcg_gen_andi_reg(cb, cb, 0x80008000u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x80008000u); cond =3D cond_make_0(TCG_COND_NE, cb); break; =20 @@ -1428,6 +1429,7 @@ static void do_unit(DisasContext *ctx, unsigned rt, T= CGv_reg in1, { TCGv_reg dest; DisasCond cond; + bool d =3D false; =20 if (cf =3D=3D 0) { dest =3D dest_gpr(ctx, rt); @@ -1438,7 +1440,7 @@ static void do_unit(DisasContext *ctx, unsigned rt, T= CGv_reg in1, dest =3D tcg_temp_new(); fn(dest, in1, in2); =20 - cond =3D do_unit_cond(cf, dest, in1, in2); + cond =3D do_unit_cond(cf, d, dest, in1, in2); =20 if (is_tc) { TCGv_reg tmp =3D tcg_temp_new(); --=20 2.34.1