From patchwork Tue Aug 8 03:11:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 711554 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp1915294rwb; Mon, 7 Aug 2023 20:14:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzZnCgkZ1ZdDnzntLoIcEtJbnSxwyxCi9ACI3IQk2v5p2B3ZQjyHrh5RjmrPqJVyOxcYsw X-Received: by 2002:a05:622a:345:b0:403:c9c9:e4ea with SMTP id r5-20020a05622a034500b00403c9c9e4eamr15569415qtw.38.1691464448303; Mon, 07 Aug 2023 20:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691464448; cv=none; d=google.com; s=arc-20160816; b=Fwz0vEvpuauBTTXy5y0PR2ej8kaNqaok7+yzKofoGX6H74INFzEaIqfcrHwxDdgEh8 a5a2tPsEQ/PBru4QI+fDwr+gH5nhg//A0VY5JHAiLSfpX8EzofyY1OFHL/tP8cPkfLJ4 sxhA3SZpgjljy6VYIAe6uM1/4+YVru+So4ew4t2UXpYr2hA0DeUDEjel/ZKtYp00fc77 10Z/hOr2KrYUbsQDiQo9xUX3Fkj2Bjsm8ObYF4rLet7UU2kFL8777Ep0qPnuEcxOs9WZ zUsc3DqHyu3OJaCOfmDLbTFA0QgGy+NE+GsLq+WNp3vR70iFSsUPNnwDADYdhf8ebx4y 5SsQ== 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=h47eic5iqOAhfWM944hqigKUjin3wD6PihSMVViXfj4=; fh=hqs26moy805PsHbwd88lUczy2QdlfF59ojSMxj/DeWg=; b=D36dyizXBHLQm79KORR7wVQStvkX9MgjSjUc+hks9o47cJTqxcf2rw5DJ3/SsbhpBe w09TTQFT/KCeoFa7HcH3kkDKHEUtC4F+BmWpSUpu2b2cxdx2RX/ZLyPcSRgpyaVe8YBm sBY2bLVWM0hCHzPRFBZVblOYW7n1iuxkBhHaH4U2ZZz+fBB2Ts+ylvZVgBtzm+OAWs2H G3Hs4Il9bVITksbl77TCPST2d0YmsvpfKEiDOy3ttMovreDMOq1katcXpKcV4jdHuCol X31zkDTxrWCGhaKc9Pr1jYacDVHrfCXrIpQAEYGeEbgSZsVnuIFxdYdEt4G8Tp9ouv1i c58A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YX/AgPjY"; 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 h17-20020ac85851000000b00403fbb9a8a5si5913216qth.269.2023.08.07.20.14.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Aug 2023 20:14:08 -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="YX/AgPjY"; 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 1qTD8d-0000R1-92; Mon, 07 Aug 2023 23:12:03 -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 1qTD8b-0000GJ-5w for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:01 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTD8S-0000Ae-De for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:00 -0400 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3a74d759bfcso3888587b6e.1 for ; Mon, 07 Aug 2023 20:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691464310; x=1692069110; 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=h47eic5iqOAhfWM944hqigKUjin3wD6PihSMVViXfj4=; b=YX/AgPjYoKdPsJWZeDnQWP/3HpiHcPSPsqV0UpE4gi11KCPV2fV+EWNnqkbS4TaWq0 V9uC7i9ATSDrLgg42Yd3IWllu1zq9zTV12zLSZpDjmWbUkioklZb4ESlfTOcbn4qC5N+ AFXolAWevzAJtOAwvsBmzO/zXCpOPyIrAh0ETQ2oxzxNy87VnjRmdgYYo+W1lToamcsy lDCNdzaUWnpCUft1B0zmDcev0zF2uum3k4QipAJsS+y1EYuKVXtrg7DovHF1gL/6PUVL yJNXAclzNDUKrcQTytsEK0v+MOuhemjU3J52BB7YDA1d/QSA86NwG+M222b1ySepiDoj n+Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691464311; x=1692069111; 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=h47eic5iqOAhfWM944hqigKUjin3wD6PihSMVViXfj4=; b=daGLkcPLnP/9f9ybIgCQgB2rvAw39vf9UOBh3/N2jyDYSSp2mXmaIcBSE+wfn1QUN0 c8b74anzcCDanv2J68hPmO4hvMi02RpziaLIdCREJf7Gd1NEM2LioIq7OZ3T/s1Bs0kR oqeEPlSZTvLDDBipcA6CsgbZtjzbJdbWQGfFNkwFNxnrxOUx43nODGbgNQTZ0q4/RUzZ VdxnUJXO9xHeST9XytGySlE+o4w2sbSZxp/eSmLuxpH4sRou81gIj1DhMzYnn4euvzzf inw6uSDbqzMnQPXLbRTB/17CZJoX7VjwXjG1PjimIoK7riGDIlajzsXpbCQfp4RwgXYm YnrA== X-Gm-Message-State: AOJu0YxfYsjRJJ+Jc86ocGPQga8fx9HeEI+qyX3v557NfZ8hKd0d4j4x rUgTGUkFuhlcIbNtdUKxdvbZWranUdRmuXei6vA= X-Received: by 2002:a05:6808:23d2:b0:3a3:f7b8:576f with SMTP id bq18-20020a05680823d200b003a3f7b8576fmr14401720oib.19.1691464310780; Mon, 07 Aug 2023 20:11:50 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:e306:567a:e0a1:341]) by smtp.gmail.com with ESMTPSA id g64-20020a636b43000000b0055bf96b11d9sm5639087pgc.89.2023.08.07.20.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 20:11:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH 07/24] target/ppc: Use tcg_gen_negsetcond_* Date: Mon, 7 Aug 2023 20:11:26 -0700 Message-Id: <20230808031143.50925-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230808031143.50925-1-richard.henderson@linaro.org> References: <20230808031143.50925-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, SUSPICIOUS_RECIPS=2.51 autolearn=no 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: Daniel Henrique Barboza Reviewed-by: Nicholas Piggin Tested-by: Nicholas Piggin --- target/ppc/translate/fixedpoint-impl.c.inc | 6 ++++-- target/ppc/translate/vmx-impl.c.inc | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/ppc/translate/fixedpoint-impl.c.inc b/target/ppc/translate/fixedpoint-impl.c.inc index f47f1a50e8..4ce02fd3a4 100644 --- a/target/ppc/translate/fixedpoint-impl.c.inc +++ b/target/ppc/translate/fixedpoint-impl.c.inc @@ -342,12 +342,14 @@ static bool do_set_bool_cond(DisasContext *ctx, arg_X_bi *a, bool neg, bool rev) uint32_t mask = 0x08 >> (a->bi & 0x03); TCGCond cond = rev ? TCG_COND_EQ : TCG_COND_NE; TCGv temp = tcg_temp_new(); + TCGv zero = tcg_constant_tl(0); tcg_gen_extu_i32_tl(temp, cpu_crf[a->bi >> 2]); tcg_gen_andi_tl(temp, temp, mask); - tcg_gen_setcondi_tl(cond, cpu_gpr[a->rt], temp, 0); if (neg) { - tcg_gen_neg_tl(cpu_gpr[a->rt], cpu_gpr[a->rt]); + tcg_gen_negsetcond_tl(cond, cpu_gpr[a->rt], temp, zero); + } else { + tcg_gen_setcond_tl(cond, cpu_gpr[a->rt], temp, zero); } return true; } diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc index c8712dd7d8..6d7669aabd 100644 --- a/target/ppc/translate/vmx-impl.c.inc +++ b/target/ppc/translate/vmx-impl.c.inc @@ -1341,8 +1341,7 @@ static bool trans_VCMPEQUQ(DisasContext *ctx, arg_VC *a) tcg_gen_xor_i64(t1, t0, t1); tcg_gen_or_i64(t1, t1, t2); - tcg_gen_setcondi_i64(TCG_COND_EQ, t1, t1, 0); - tcg_gen_neg_i64(t1, t1); + tcg_gen_negsetcond_i64(TCG_COND_EQ, t1, t1, tcg_constant_i64(0)); set_avr64(a->vrt, t1, true); set_avr64(a->vrt, t1, false); @@ -1365,15 +1364,14 @@ static bool do_vcmpgtq(DisasContext *ctx, arg_VC *a, bool sign) get_avr64(t0, a->vra, false); get_avr64(t1, a->vrb, false); - tcg_gen_setcond_i64(TCG_COND_GTU, t2, t0, t1); + tcg_gen_negsetcond_i64(TCG_COND_GTU, t2, t0, t1); get_avr64(t0, a->vra, true); get_avr64(t1, a->vrb, true); tcg_gen_movcond_i64(TCG_COND_EQ, t2, t0, t1, t2, tcg_constant_i64(0)); - tcg_gen_setcond_i64(sign ? TCG_COND_GT : TCG_COND_GTU, t1, t0, t1); + tcg_gen_negsetcond_i64(sign ? TCG_COND_GT : TCG_COND_GTU, t1, t0, t1); tcg_gen_or_i64(t1, t1, t2); - tcg_gen_neg_i64(t1, t1); set_avr64(a->vrt, t1, true); set_avr64(a->vrt, t1, false);