From nobody Wed Nov 27 19:34:06 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=1697834954; cv=none; d=zohomail.com; s=zohoarc; b=M82m1x0XtAjkKT6pqqTNDxODvzA8zV+Comf8DhB/0rrsj1jsZea+TPO6ORX28te5q1ERK3rL/nlDJ6W+/NYqNpXVcjefvjDo5hRQJftnpmXSJQ4NJEI5XDAldf9vp56XIJAQPQcfaueW5wQyfAeFy8NwZsHjdeHtkUsRdRCWBac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697834954; 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=Bjm4am++QtRrdDOjyV6ZJHM+umovDVM2bFLkEqCxtAk=; b=DwWnEeZ7UTOmyu/9AKmVvE15OBikKnFny+/yLuQpsZIDAoJjUfq+czOS11/KHlhE09TMxToTNzDkwmiLwpc/EuoDrX92ndrOC9xbszSmbfKTQxnDNjToYO5xBQxH/52+vpK24GaSP2GGDhD9Nir+qrSKiDBRyGP5j52+SehYvLI= 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 1697834954307685.864565471679; Fri, 20 Oct 2023 13:49:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtwM5-0007zb-Sc; Fri, 20 Oct 2023 16:44: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 1qtwLj-0007l6-5n for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:08 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLd-0008CM-7V for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:01 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b26a3163acso1100580b3a.2 for ; Fri, 20 Oct 2023 13:43:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834634; x=1698439434; 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=Bjm4am++QtRrdDOjyV6ZJHM+umovDVM2bFLkEqCxtAk=; b=pzji8I/dj8/xU9X3fl+0d+zcblcAexYgpsEEEtnrUzLBLR/wQGgJqUQ70gxDhjP9Nu cQLujwi6o8MFyOZ4Mk9nUPGZ8mWOHCpcVRyUyhYCJMzww6LsE3wi458Ya7Tpu0Di4XOQ MG7EZtGDQxD3A5ptqOmTmXB5UdmeP1xwAx5QC2nvvGTRX0DqD3SA1uehRtG1tYFKvndJ 5/xwd2Dy6bb2Fw2ZbX1lAyqHkSiv/RDGC8xEmMUmRaIzZFeO1PVq86wfbd1vtQLsUwh3 8+a5gf+3Y1quAYQi+t19H8ifd0c3aFD+2PYx0voBdHVIwo6rKuzRI8M6p6qOhcVd2w8n urGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834634; x=1698439434; 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=Bjm4am++QtRrdDOjyV6ZJHM+umovDVM2bFLkEqCxtAk=; b=Rccx6pqw6l9KiglkRKbHu1JsxkPICuB9QZhN8ex7h8zBOwv/nsD4DTICu54DHS0bFH NK8ltAWT48zlLuHTjEtaz6jubpYp+A/pg2lXkr3dECw/2vZKDvxdhxXkCqrnpTFu/ANp iBPOhMOJnq/k6KtzC0et/PGQ0n1rmeVTlz2E8wio4iJQIy+NvT1SQJiiBRymtYlPulOx OVyqjs6j44bZo5szbrZEqs7aUYfRX1nevO2BjECZ0rfGfLUma60vXa52eXDup8VQiC5l 3SUIaQAPKowlXPA9wDWht0oHZGXUaoCfrCAn9TZMH6YfSzqhoyckgB3co++wAoEXlw9C m4nw== X-Gm-Message-State: AOJu0Yzfr3Q1XRG04tZf4N1OmWZdF/SeOSxOjcHLVNPEaNs/0vV+MGY6 sQyn4ldS0kdplEYmiwtgfzeb0xm/H3/x+swVFVY= X-Google-Smtp-Source: AGHT+IEMNARZVyv/tJlZTmt0KAFfIkY1al8oV+YgvBUyp06NqT2DQfZm3voslnWtCksiQPr7SUQf6A== X-Received: by 2002:a05:6a00:15c2:b0:693:3be8:feba with SMTP id o2-20020a056a0015c200b006933be8febamr2895362pfu.19.1697834634035; Fri, 20 Oct 2023 13:43:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 24/65] target/hppa: Pass d to do_log_cond Date: Fri, 20 Oct 2023 13:42:50 -0700 Message-Id: <20231020204331.139847-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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: 1697834954766100001 Content-Type: text/plain; charset="utf-8" Hoist the resolution of d up one level above do_log_cond. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 48 ++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d480bac03d..d629f5f7f8 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -970,9 +970,11 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsign= ed cf, bool d, * how cases c=3D{2,3} are treated. */ =20 -static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) +static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, + TCGv_reg res) { - bool d =3D false; + TCGCond tc; + bool ext_uns; =20 switch (cf) { case 0: /* never */ @@ -988,17 +990,29 @@ static DisasCond do_log_cond(DisasContext *ctx, unsig= ned cf, TCGv_reg res) return cond_make_t(); =20 case 2: /* =3D=3D */ - return cond_make_0(TCG_COND_EQ, res); + tc =3D TCG_COND_EQ; + ext_uns =3D true; + break; case 3: /* <> */ - return cond_make_0(TCG_COND_NE, res); + tc =3D TCG_COND_NE; + ext_uns =3D true; + break; case 4: /* < */ - return cond_make_0(TCG_COND_LT, res); + tc =3D TCG_COND_LT; + ext_uns =3D false; + break; case 5: /* >=3D */ - return cond_make_0(TCG_COND_GE, res); + tc =3D TCG_COND_GE; + ext_uns =3D false; + break; case 6: /* <=3D */ - return cond_make_0(TCG_COND_LE, res); + tc =3D TCG_COND_LE; + ext_uns =3D false; + break; case 7: /* > */ - return cond_make_0(TCG_COND_GT, res); + tc =3D TCG_COND_GT; + ext_uns =3D false; + break; =20 case 14: /* OD */ case 15: /* EV */ @@ -1007,6 +1021,18 @@ static DisasCond do_log_cond(DisasContext *ctx, unsi= gned cf, TCGv_reg res) default: g_assert_not_reached(); } + + if (cond_need_ext(ctx, d)) { + TCGv_reg tmp =3D tcg_temp_new(); + + if (ext_uns) { + tcg_gen_ext32u_reg(tmp, res); + } else { + tcg_gen_ext32s_reg(tmp, res); + } + return cond_make_0_tmp(tc, tmp); + } + return cond_make_0(tc, res); } =20 /* Similar, but for shift/extract/deposit conditions. */ @@ -1014,6 +1040,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsig= ned cf, TCGv_reg res) static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg re= s) { unsigned c, f; + bool d =3D false; =20 /* Convert the compressed condition codes to standard. 0-2 are the same as logicals (nv,<,<=3D), while 3 is OD. @@ -1024,7 +1051,7 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsig= ned orig, TCGv_reg res) } f =3D (orig & 4) / 4; =20 - return do_log_cond(ctx, c * 2 + f, res); + return do_log_cond(ctx, c * 2 + f, d, res); } =20 /* Similar, but for unit conditions. */ @@ -1368,6 +1395,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TC= Gv_reg in1, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg dest =3D dest_gpr(ctx, rt); + bool d =3D false; =20 /* Perform the operation, and writeback. */ fn(dest, in1, in2); @@ -1376,7 +1404,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TC= Gv_reg in1, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (cf) { - ctx->null_cond =3D do_log_cond(ctx, cf, dest); + ctx->null_cond =3D do_log_cond(ctx, cf, d, dest); } } =20 --=20 2.34.1