From patchwork Mon May 13 07:46:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 796527 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp1884454wra; Mon, 13 May 2024 00:53:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX2ijq8A1zf18By7KSUJRgTDu/Opz44CygKKB9uPyFVnIz/iRY/gRbMOC4xeWYlF+aNzlyx1EgpEGRYsD9/ckT/ X-Google-Smtp-Source: AGHT+IFJR1W/4cOrKedv0KnbJTGaaYZuiclJDBgv/WyDRZ+j4ODVC+DIvC6e+bJTCVsjMyMvAK9e X-Received: by 2002:a05:6214:a0f:b0:6a0:7d7f:dfe6 with SMTP id 6a1803df08f44-6a168278614mr64884186d6.65.1715586813328; Mon, 13 May 2024 00:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715586813; cv=none; d=google.com; s=arc-20160816; b=fSZaATSq2282BrBo+ZHacvvc7625sD7Avej7Q4uTUNpZi3/qahPmvGXSXkw+7HoArj RexjKviPGxJnVC9Q+SBs9SN6CRJ4H0pFigewH3r8doc1+ldL6wdbRLBOGdPzZhbeg2cs mxBsEoT7HtceTCkww9EUCSEvHdyRxXGwpZOFgEmQ4teeKsRoq+V8RUgHJsj8R/oQixR7 pFj9CLWcgR4786yJGwMBB2KjtP+5ufMPZbZRMTBeyai6Pd3vh5Pjg7wjifoStwxZAlu/ 6d265UYxNQhP7qvbraZdFR+7CI1FSKa4K9+kASX/GsesvBYOecKtq89E0SNkqqZbEpez yc3A== 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:cc:to :from:dkim-signature; bh=Kyk3Oth1w710DgibqvngAchg1UuHlBEgrDks+71JwQE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=zCg9cxR78tkHvrFSDNivJ58nbMeFUXWDY2XtFzpnIi+Keb6nqxbEnlLLmx3ZQPMsKs wjsz9SC3aXRP3xenBbucV2h/GK1WtBnjBJKpuoZpDwd6yCYMPevotmDDdus84ENLRDS2 KT1tBDqu7dlHCIk3XQIg5R76my8agPsZUTY2171MTLVo8n44UDfVGzv9eSmb1bSspuSX pT8n57bYh8cgEcOTqHVW5j3705E9luqEGcw4QROsYUKSXLY/+KATwLpQtJKozwfoogMc SCPKcAkawuKpcufMWqjlXeqxd+MeRIH6l05OlMVBtAvvDx/NGUPfcfyCcehrQC3vNUCd hRWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RK9plY/n"; 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 6a1803df08f44-6a15f29a8fasi92187896d6.278.2024.05.13.00.53.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2024 00:53:33 -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="RK9plY/n"; 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 1s6QR1-0004m1-Iy; Mon, 13 May 2024 03:49:23 -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 1s6QPM-0002sB-QJ for qemu-devel@nongnu.org; Mon, 13 May 2024 03:47:41 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s6QPL-0001Ob-45 for qemu-devel@nongnu.org; Mon, 13 May 2024 03:47:40 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41ff5e3d86aso18015185e9.1 for ; Mon, 13 May 2024 00:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715586458; x=1716191258; 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=Kyk3Oth1w710DgibqvngAchg1UuHlBEgrDks+71JwQE=; b=RK9plY/nM/kWhP/m0z5VbueYFDbUrmHPR7CGQo+ZJTUh8bYM03qcEbEAFOf52bIlX9 hjyFtaQ3dgljDxyYf1kxqEu9ITVlAcU32W4ckC7HOCHF4SIBRTH4jar1fdjGVYDvDXlK uW+mL4uCX96Z5PoNVbbUCw9GyZ4BLptaXFtQr2VtnnLzHNcCzFoyJWxaF6NZtJZpQ2ah 8RPcnqvzfhH0/9xs9f9yNu6I87eIcT1C9koV9jWsXx5kFICXeoYMuDdwLXHD+r5ea4qh VDivRCd1VxwYbH2oC2jqBdLunO0WuWi+eSPSW6VcmFTUWyLssnTkBY3EbYaCIbu626se aNqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715586458; x=1716191258; 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=Kyk3Oth1w710DgibqvngAchg1UuHlBEgrDks+71JwQE=; b=llU/Lv+31bUFzCC24/F8fN/xkv+1b9nXYB/0QKkfFrL31Mv6i/g5kZaTS9azEA70r7 +Wsfxwfh48WwaQAze53nt3bFppGwLv7WyJ0FSnsxJ2vsiodeQJX9lR+Ueb1Z2jG7ON1W wPozjoTCcJr/egQ+6ZVPjBr/pjSaJ/C1z4iXMrJt5ePTWxpjCo0vJg18ovKuHlizI3ts a0AHD3QRBrDcudaV8esVbssZc0xEXnCoXBC/rgJSws3ErdadsCqrOMuwimxlLGMBz82q TyuTFNeZo2RvWAx3PTDdWvc73Q8YlMthySAdvpp0/0KAUFgoS323M1FdMz4EqieRcZb1 LcgA== X-Gm-Message-State: AOJu0YwaxTPtRRqkAtSv0hL6WPue4jg3yzymcApHrur4wYQU+wYuq+0D mWeBFThBx/4eGQn8nIs7b2S8VTrOPdSjN/cHpQOwsDL7rs4hGbiNNOscqzcymq23UVaAjEnEV7f NxwE= X-Received: by 2002:a05:600c:3508:b0:41b:f2ca:19cc with SMTP id 5b1f17b1804b1-41fead61b26mr68652765e9.34.1715586457858; Mon, 13 May 2024 00:47:37 -0700 (PDT) Received: from stoup.. (12.red-213-97-13.staticip.rima-tde.net. [213.97.13.12]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9318sm148204765e9.30.2024.05.13.00.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 00:47:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 26/45] target/hppa: Use TCG_COND_TST* in trans_ftest Date: Mon, 13 May 2024 09:46:58 +0200 Message-Id: <20240513074717.130949-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240513074717.130949-1-richard.henderson@linaro.org> References: <20240513074717.130949-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32e.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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Helge Deller --- 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 6d76599ea0..ef62cd7e94 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4310,6 +4310,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); @@ -4318,21 +4320,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; @@ -4350,21 +4349,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); }