From patchwork Thu Apr 25 00:00:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791767 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1118253wrq; Wed, 24 Apr 2024 17:08:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXo5SdQYAVClgfl9k4+86lSTEmCsokdT+WZyX7F6Y3S8PKKawp8yaano0Besyxu/0G/f9W8PGcZifHT8KBywIYC X-Google-Smtp-Source: AGHT+IFAk6KWJP/JOJqTJQkYsIqOy4rPSH/bXA+tlg1kg1zYbW+UHWlles4KHbCak+CyRDcHCLOT X-Received: by 2002:a05:620a:221b:b0:790:888e:4d4d with SMTP id m27-20020a05620a221b00b00790888e4d4dmr4326012qkh.39.1714003699164; Wed, 24 Apr 2024 17:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714003699; cv=none; d=google.com; s=arc-20160816; b=Bf9ZEKFxIcoBX/E5YpOj7m9gX47XEHFtgrb5MJriTwqZhpLOX5yqKZoUPH3ZqnAOUS qvzgc8SOuSu/++iaT6SLeIxUAtzURiqDmcfjR9YxUGOoA5tq4GYfm8uQarkwTPKMh1d2 79WYTOxpQwrmkWi1OTmbm/K4jWTKS/yxl9n+B4oiCZO/nyQ1ILWMrwjICra1UvUhuDVA UgZVzpnAZqCd47su4RT6pm9UWemXhEqrIuu4siEwMdDX98VejMMfs+Xkx8qDagpAMF+a EXiOgokaBFl6XY7YoOe+G8IdVIppCl/nWiqm35BieEGXCBR4O/rYbaku88RbN2U0XjGE 0ysw== 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:to:from :dkim-signature; bh=4k0GmsyyHp6l3HUJNBVWsFzARFivg/eO6L4ms+jh8b8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=lov9oMh8shllXOuR8bHxz+jmBwIyn3QZG5IabiviaxaFWo+T0XVIHWD2z+kykg7Kq7 nXr5lbfMwYD8lxMFIOSKCU0v7QWzEx3KQnIFuqRCCF4rRCiXiMJzab2V+kmtLn4Ubxln O+y5F7ACNC2SU6tSZUq0HrZp0i7m27ofDVQJ48dkmDgjk1f29S5vOFA15ZNWkuoAN0rY 4chSoA4PE25xzyVPXw4zUuLKcr9VmVWp3olOdO5FICsuFnACfgmHC1Fb0vlexc1tlMNe QbwWiCO8Rk7Nga+0H6l+mVyn//FKbqWjMgMZ8B2kBkKL2ghb0eo358hubOpx53wqQVR1 n7nA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j4XeJnoD; 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 yf16-20020a05620a3bd000b0078ee017ea1asi15917303qkn.245.2024.04.24.17.08.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 17:08:19 -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=j4XeJnoD; 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 1rzmYH-0008QE-J4; Wed, 24 Apr 2024 20:01: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 1rzmXp-0008GN-HS for qemu-devel@nongnu.org; Wed, 24 Apr 2024 20:00:59 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzmXl-0006H2-4x for qemu-devel@nongnu.org; Wed, 24 Apr 2024 20:00:55 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1e5c7d087e1so3726065ad.0 for ; Wed, 24 Apr 2024 17:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714003251; x=1714608051; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=4k0GmsyyHp6l3HUJNBVWsFzARFivg/eO6L4ms+jh8b8=; b=j4XeJnoD6M1UWKM7m0qL3RCEe3oci08ZtWbD4LjBc4nE8ygTkFyJv14+Ze5ZWwVdXs cYS+sfL4dOJlLpELCUYAbdkL1YcckahcJe0NPRQIGB6mQFQ4Q9fK2+6fl91XwiLg/X5a mOZUJslemo4s5zSdv18WV2prDICGvDZjtSsmumgSmxOirvcbKYem/NzYdXQNZvo4XfTB nKK4t/Ve0sI6lFdQxvm5DYhomwpp5ZcnkZRSjipyZhbcVRv5tCL1v3pQYsQqqnLg2iRm zZl+TuWigG2ovqcCtfvkROasAW3kktX3cH0MZ5IBRbFLr7Nya00snmUVOjvWWZYJx/ti 32ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714003251; x=1714608051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4k0GmsyyHp6l3HUJNBVWsFzARFivg/eO6L4ms+jh8b8=; b=o6DkeLB5SIfUNwps3CFfAa8Geq03yKL6imbLQdc/j16GYZufbzSZv0KzkvpyYuvAaw QuAO0aTQkHDAOhAqPp0WdmYYLBt05b2dPXO50m9r27mg2JF4LW072n3IAKSgqgD75R3i xORmfXCS5zTbc51dVTEuujXveoOuBdX5AYiy35488f/t2r2vOaLy4DZGO+VfxHQ76Y6a Im7/qV/5sayERRnX43SmonuWfjXL8ZVBRmT0w4fnyZlC/NN6gAIaKw9GdxdnLbZGVKlI OFQaBtj77BFbOWniPFhhjY7THIvwjLgehTU/ilELzW0CQtMU2J5qctA5VN6w4gMmWKKl Lk3g== X-Gm-Message-State: AOJu0YzvwkVGOT2OJYFjdOhzvGRuxAi6f0MgqcRHqFfvyu2sEpPfIB9p SBG3iXNtHF3k8i7Wdv5P+YxsvEkwL/zRQ9SDmttwrCoZByVFLgRHY/DD4uHL6dmia75h5u+bFRH m X-Received: by 2002:a17:903:2b03:b0:1e0:e85b:b9ca with SMTP id mc3-20020a1709032b0300b001e0e85bb9camr5949473plb.21.1714003250919; Wed, 24 Apr 2024 17:00:50 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id t6-20020a170902e84600b001e604438791sm12465715plg.156.2024.04.24.17.00.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 17:00:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 26/45] target/hppa: Use TCG_COND_TST* in trans_ftest Date: Wed, 24 Apr 2024 17:00:04 -0700 Message-Id: <20240425000023.1002026-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425000023.1002026-1-richard.henderson@linaro.org> References: <20240425000023.1002026-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson --- target/hppa/translate.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4b9092b1cf..b1311e7688 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4309,6 +4309,8 @@ static bool trans_fcmp_d(DisasContext *ctx, arg_fclass2 *a) static bool trans_ftest(DisasContext *ctx, arg_ftest *a) { + TCGCond tc = TCG_COND_TSTNE; + uint32_t mask; TCGv_i64 t; nullify_over(ctx); @@ -4317,21 +4319,18 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) tcg_gen_ld32u_i64(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); if (a->y == 1) { - int mask; - bool inv = false; - switch (a->c) { case 0: /* simple */ mask = R_FPSR_C_MASK; break; case 2: /* rej */ - inv = true; + tc = TCG_COND_TSTEQ; /* fallthru */ case 1: /* acc */ mask = R_FPSR_C_MASK | R_FPSR_CQ_MASK; break; case 6: /* rej8 */ - inv = true; + tc = TCG_COND_TSTEQ; /* fallthru */ case 5: /* acc8 */ mask = R_FPSR_C_MASK | R_FPSR_CQ0_6_MASK; @@ -4349,21 +4348,12 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) gen_illegal(ctx); return true; } - if (inv) { - TCGv_i64 c = tcg_constant_i64(mask); - tcg_gen_or_i64(t, t, c); - ctx->null_cond = cond_make_tt(TCG_COND_EQ, t, c); - } else { - tcg_gen_andi_i64(t, t, mask); - ctx->null_cond = cond_make_ti(TCG_COND_EQ, t, 0); - } } else { unsigned cbit = (a->y ^ 1) - 1; - - tcg_gen_extract_i64(t, t, R_FPSR_CA0_SHIFT - cbit, 1); - ctx->null_cond = cond_make_ti(TCG_COND_NE, t, 0); + mask = R_FPSR_CA0_MASK >> cbit; } + ctx->null_cond = cond_make_ti(tc, t, mask); return nullify_end(ctx); }