From patchwork Fri Aug 18 22:13:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 714698 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp749118wrs; Fri, 18 Aug 2023 15:15:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQAVfztDVUGBku5B6gMX2fBBLhucH7G0HFE42t/vxPvYKJb9ojxTnFP4IAmPTBksWiIFGE X-Received: by 2002:a05:620a:2901:b0:76d:307c:5bae with SMTP id m1-20020a05620a290100b0076d307c5baemr706315qkp.38.1692396935691; Fri, 18 Aug 2023 15:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692396935; cv=none; d=google.com; s=arc-20160816; b=ZPdZ032MuYIieJjnmhJNhwZWlCQfZZFIPxrp/fJJAPWG4BwIJObj7vqwi7rFLmq/LL n2iH9s3oJK2xie8TKpak23PZuqNWr5UntR1zAPfLutdwEZMxCTn6Ny6nFf9GEhxFBpON X4/JYB0Na8tcuX6RiBEZPXoEuL6jqCl+/f8zrgvzk/ibSqdOex35jv8L0XWF29tptWd/ YuBSkV415Cxf4Kd4GpOct38o7HnI6dvEx0qQt4o0k5g8llnRytgqn7anXx5ys5xgWWee vgxEukoLL/GR9V1oryGIZDJQLB5+EnA4F8JVO8McowIFmf6d5D83ebwnc+cr0Lr8FNfn xcmA== 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=BXTuJLuVUV/PuBzgJU7K0Vdmip6KJacvGUEEE2MhUro=; fh=KWxatPq5T0zjAQbO8imgNr7LdNnasOmtM7C6s9x57WQ=; b=JkbmUnPcRYk/e6hnb6Gruvn9uSCGvhAYz0zp4VgaMuNs8r3MLW04/v2ZMeC6dleDnq yI5VFs8IxmITEva8Yruw2zAfCPpJEwFGDzzT+FDwxrhdQwQfNx03SuZ0bVP747iFgEub IwsnDvn9RKVBL1QehLcO2j+FYp1QtuXeC96G1iSTgDrRQAjVBbi61pGHHnklXBimUVYS VfhTIfZLfZYsyuBw5wOWHAqPCgMt/7j7Ur/9jKdpvozUAUaexPknFEnBoIIroiB+KLzG QIBkGgbuCR36gpkllBRQBTgh1Ieb60WS1wk1xx6+KNGwBpwDTvYM6P+IARCqwxWg8Slv 8fNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vyU6D4DD; 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 r7-20020a05620a298700b00762dfc825e1si1788395qkp.342.2023.08.18.15.15.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Aug 2023 15:15:35 -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=vyU6D4DD; 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 1qX7iv-0004yL-Kk; Fri, 18 Aug 2023 18:13:41 -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 1qX7is-0004vh-NM for qemu-devel@nongnu.org; Fri, 18 Aug 2023 18:13:38 -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 1qX7iq-0004N4-F5 for qemu-devel@nongnu.org; Fri, 18 Aug 2023 18:13:38 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bddac1b7bfso10102095ad.0 for ; Fri, 18 Aug 2023 15:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692396815; x=1693001615; 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=BXTuJLuVUV/PuBzgJU7K0Vdmip6KJacvGUEEE2MhUro=; b=vyU6D4DDXPVY5AA3mGiOHNYOz4/IpqvlvI9gVCDXaXTFDwEZOGDM7HIb4gRS3qNzPd 7+okSyqVkqypK9oVhLM8Jo+gK19I7UdKYOzCHrOKqjxnCsiuwl9P9AJALg5hbWoueKW1 mufcJ6dulFMkU278dzYqNbCqeBcDFjAiXXmkc64sFWT7hThusymDCZzISVDQ73sAir3l aH7XN/KJ1N2H/8USau1MQEsSXsqFopN1YTwn6LNt4IGjZA7zIg9SiA9SlnhuNTQjHpad wEyB/skJoRySRvjpiydJOosNYrWK362BMEZtXyNdHkrhffLx6dkrVscqpXo7MjMvzo13 gUFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692396815; x=1693001615; 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=BXTuJLuVUV/PuBzgJU7K0Vdmip6KJacvGUEEE2MhUro=; b=BSJgT7ZUlSyizCK16W90qxJCrfwMTE56aaT6jxHP9YIVjfYMeXDDlWJQk/ZqAUBhL+ 5mpIL+FD6lUkntJ9ho8WVx8LDVd0arENl2L2+KvGM6kSR35082z2Ml6xW/sWTAFmQRLJ DoudIZ6taB60pOwTRfD/0CXXoqHxHHir907zkVXLZThxlQ/KnVU6z9gtmGRWKIG0JfT/ TWJDfqS6zfDAi3txRhkfDV/9SqCyOvl8AGKHJmmLr69w2HXKce30X9IFIso77VkZxbdB 7s36E7HT9f9zWf9u/leO0bB0xiYit2Yz9FEbn3Kt4OMwJiegfhWHMcoMJeiALr/6EkrK 6NGA== X-Gm-Message-State: AOJu0YzBICe3Qws2wQR8OZukIlYVQ+1osrOAEa9AO+BG9Wt7ZsQqxKcF RsIehHI+xEyypK77wR9IHAz0dIbPzia7v7m054U= X-Received: by 2002:a17:902:cec9:b0:1bb:85cd:9190 with SMTP id d9-20020a170902cec900b001bb85cd9190mr671773plg.18.1692396815075; Fri, 18 Aug 2023 15:13:35 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:cf24:6daf:2b9e:7972]) by smtp.gmail.com with ESMTPSA id y7-20020a17090322c700b001bdb85291casm2231417plg.208.2023.08.18.15.13.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 15:13:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Daniel Henrique Barboza Subject: [PATCH v2 07/23] target/ppc: Use tcg_gen_negsetcond_* Date: Fri, 18 Aug 2023 15:13:11 -0700 Message-Id: <20230818221327.150194-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230818221327.150194-1-richard.henderson@linaro.org> References: <20230818221327.150194-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 Tested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- 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);