From patchwork Wed Aug 23 20:23:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 716119 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1002830wrp; Wed, 23 Aug 2023 13:27:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGhDSw1EhHSeeZ8GEuTkTjORjvTFepClsTdzfbr2FefFHOEsTiUeAEagbdsQX2YrBZcjhf X-Received: by 2002:a05:620a:88e:b0:75d:4e8b:9d19 with SMTP id b14-20020a05620a088e00b0075d4e8b9d19mr13141726qka.26.1692822448362; Wed, 23 Aug 2023 13:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692822448; cv=none; d=google.com; s=arc-20160816; b=CEyga9aWYHTitd0ikWLnHvy7dBe4h7BSb6k1EwCrtWpnLs7tjyBXk0Q4+TIqTi49/L Xzb7FwxvDx7bv2rg8enKkG7CT/a/WBOAjSLaPbdWcvYjaxmvQT2cnQvF1/wMsAVf+T1x +QPGxt+N/CycTGULGeXW8jSLr+9UGIqMlpUon6EIRVBy3nC2CbJOwURNjlmW+i/IkEel HTAaiKzbRoDvubiINPMifKQ6Xmb0nbI1PmRIVYYHpfJwvKlqIaX8ObxTXrxYH44y7O5L yItoXJerWGMt6Rfny4CT0t1PNQb6Pnf5eDWNXhJpINtRp5mu21cya/a3VHHADM30nIQr MGkA== 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=DJzqm/AXxMu48VJQk8ECOD3idJCetIC9RQgTLF8lX/7iluUxwhw9JKjXftnDtfZwzA y8jMWaDX2dBoe6DB5aQrR0XVRWVqDBD5FTRpMqSIHauy/hp/rsCgqB6wI1h1x4GoMmgw o8BxjULCf2XAHvpPn4UxgtIiFkz+JaeS8yRRKjTQGAdRsGJFJdtj0b4Jh4VVoUxnYSqA d0i7pSFBM+UxWItDin+8e/vjNB2/TKeSGDuaWlSgpXq141Ffs3h/c32GaJcpYLVPX5av eRYC0NsBfiBXPS8b1estjrzZjBGqeasckYcMBMoy9L0N/PQJpxHA+BTrpjLWUilUGAt3 /eBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t5DJgLl8; 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 br32-20020a05620a462000b0076ebaa7a076si712680qkb.20.2023.08.23.13.27.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 13:27:28 -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=t5DJgLl8; 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 1qYuOm-0000YX-4o; Wed, 23 Aug 2023 16:24:16 -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 1qYuOb-0008RZ-F0 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOW-0005V8-Sj for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bbff6b2679so40186855ad.1 for ; Wed, 23 Aug 2023 13:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822228; x=1693427028; 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=t5DJgLl8yJjggY+2mtQX92tU1/SePkCJmuL5+9XwbDx5Ju52FGIu//KitavaL0jVHo 8nvaTNRqHMh8C2ZQBE0HoD6EAGnfBAdlSJQzwyTW55udFI7/wTuiVwoyLR2gf8BxwHV3 8CMz4IaKq/CBYWMa1RZeRZ17mux03Ukjs+xGnOe6UnrYlzRQSxFRTD/xCMDQhhHs4+xF yrAIcaomxjvBapoVzA74JMEbspJLFXafixUd4a1ayZgbSa5ZL21ypE80GeP4itad+e9k cKl+SQOqx8PyzZ5ZHPPSHnn9RX5vwuETJXrsiKUU2EuBzs9MVEMdWW4XC+odlMfulLyc wunQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822228; x=1693427028; 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=MnoOgU+0S3tS2jlOnzsid8akRtLfgLYTPrgMOfly/7yymfGcD7lmrgA0g35QN4l18x Mc4to/8DtbiXYrJ4oANUvniXsJrStzzDs4eIkjbp2uBpjVChrjf9nE6dyksLz+RoWzYM H2mx/vWJcx1CpSQY+Zk/wghCL6K9oPxb3/MDzoW1Kcjqhfzi6gXQAk3WzaPoIUOVL4hd 9iT9nrqMBWlptHirpbXC8j7qAId2k7pPFDJ/ITj+YDSdRJVGVS1+QRtusI9ArwfKrN2Z SBAQM60FJBUa3StHGLOikxwa6JPymWnT4BBT117Mi2ELupXf6tvmk0dGNFYUmaRIc3qG pf1Q== X-Gm-Message-State: AOJu0Yzirg6xaa/sEeX8wLQj0wN/w7hfug/qc2BHPQvLUHgq7jkKHoMS S/TqlFlu/XbQ+4Nwz/T7yEwzFO5RBd8857JEZrk= X-Received: by 2002:a17:902:e752:b0:1bb:32de:95c5 with SMTP id p18-20020a170902e75200b001bb32de95c5mr12792910plf.65.1692822228166; Wed, 23 Aug 2023 13:23:48 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id iz22-20020a170902ef9600b001b9da42cd7dsm11418641plb.279.2023.08.23.13.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Daniel Henrique Barboza Subject: [PULL 22/48] target/ppc: Use tcg_gen_negsetcond_* Date: Wed, 23 Aug 2023 13:23:00 -0700 Message-Id: <20230823202326.1353645-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230823202326.1353645-1-richard.henderson@linaro.org> References: <20230823202326.1353645-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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);