From patchwork Tue Aug 8 03:11:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 711564 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp1916030rwb; Mon, 7 Aug 2023 20:16:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEp8VyOcIJIB4/fwO4T6+iWPRbMRGOg6Talytz6t//XXjAS8FD68YNnxWSissCRuWXJpVDQ X-Received: by 2002:a0c:a9ca:0:b0:63d:2b84:a3b0 with SMTP id c10-20020a0ca9ca000000b0063d2b84a3b0mr8409111qvb.49.1691464576748; Mon, 07 Aug 2023 20:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691464576; cv=none; d=google.com; s=arc-20160816; b=gYf6UcSTZE+qmptBHv1ddublQNnGCBcU/zBGulbgPcFa0dCeKBMtgyaf3Ul/OScZey qcD+pd22JWd9VVOXmXvqExVBaqcsuFtwF1YWX4sYGdBca+0GfaCudFRXkaEWV0VfAJFj Mn07S0cckzvaXmu7KFlUe53lbptYGUmMgK5Z+oDWIYxeLg+hNQUZZPiP6KMyxnFjPKyB xCXFwqOrlvfFhD/VHF9X2nG7q8KEjcnwW4H/iFACxxRIjo/QDTzStE1pcMOkSoI21aik K79UCbdFg2obSsJbyGY28bXd+EB3BovPQ4H+73yixyho7dWx9CvJwTVwpP6M9szMqHUs jY0A== 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=tmotEscJTq84Ab7ZtBPgGyq95MOlwaj6T0nGog5dLQg=; fh=hqs26moy805PsHbwd88lUczy2QdlfF59ojSMxj/DeWg=; b=aaP9vrTto53/LPtF8DoSMrC/bPe9eUxGib2zjvbxqRZIobNNEQHLDRFA52RomKaQV4 79tG+6aGcvyaqlapHeRu+eh6tvGy/BUv/+dYL9V+FNgymb9WkWPlV1ukoEx295bqGu7S 56qK6QlppJDq6kRouaR2EPKxgXIHu9KgsSfVb6BoinddX42Vps1R8Od3yoVr+GoGI85w IkCwXDhR0+VpgpfEKLh37ofj/D6S95469W9wdNRZxg0a4Ag4NfFqH+3sAA/GBXvJgJ3f 3h5exQCsjUpB7xPqzAVCRsBkX5BBOJ+3EqdR4m+hwD9+UgDiNlVng0ozE0bNUyz6kEfO eDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ei4t0Zwi; 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 q14-20020a0ce20e000000b0063c6c941797si5885461qvl.419.2023.08.07.20.16.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Aug 2023 20:16:16 -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=ei4t0Zwi; 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 1qTD9c-0004Ev-5C; Mon, 07 Aug 2023 23:13:04 -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 1qTD8u-0001fL-Vt for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:23 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTD8e-0000Kv-5U for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:20 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6bb07d274feso4244544a34.0 for ; Mon, 07 Aug 2023 20:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691464323; x=1692069123; 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=tmotEscJTq84Ab7ZtBPgGyq95MOlwaj6T0nGog5dLQg=; b=ei4t0ZwicPFQzScsHhMe8LIs28nac0bRAwtBskP7xnTQ+Qwjf7r4r3Uhd539TsP9yu XP/RUJiYVMgZihgX9pR9BA0UnKoB7mML4g3sieJiyD1gW9oc7rgqH1DGYJRujtcYpTs9 a1YPZ7o6KCzz2S0VPB2Yv9YtOWkaRe02sYOj/piIc6uOSHvji+/ENO/EFwLgVGEyIY5a WdyZ+KhOpn5YrFJ3HpV14c70yRo22Xck7COEn7fUAuDLLiGa9cRYBv+r6SATyJlZRVbF 9kTBDu4t5XCe1ehp6xrtGJ8K5KJ99cLdVCJ/o+7KGk5vWH9aRqPfsDi1paaElgS8uncf zzxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691464323; x=1692069123; 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=tmotEscJTq84Ab7ZtBPgGyq95MOlwaj6T0nGog5dLQg=; b=kAOpC0GL4ut+Lmcz7G52XYZKnSnEBmR1UOAf/P2tb8KZtIw56Pll+i4RWHyZ/DclzL gNgvRaZit1FlyE2IUEqC+5HI5Ml/EIvjqZHHZfIF4t7hGvASOhL9vtJApz46oUUnudTc UmTHEkN3vUCIyYfxwywsWQ/j0XTDtK3MvNbFUhYDNYRcysQMO4t8Xw1M+r9bItg2Sq9h gppq8qXakQG/NnsWg95ffu14K8sgUOJDdtLUqZ0W4TDWqC5doQ4NjukhOs74OZxG4BBM dkVRrD2BhuEBIbfLmUs1UGdIw/G2mmdWWrOCx0kEwBSaNYedxbiqc8n2mp7sZr5DurPW UY7A== X-Gm-Message-State: AOJu0Yw0nRdM2UfS5Zt9VDzZUoD5j5YhU+x8qa7UKMT4mtKw0YFne7wM 2sDTWYwR+l2tZo3il+BW3Wvk0pMDENdDEoKsEU8= X-Received: by 2002:a05:6358:2920:b0:134:c1eb:8744 with SMTP id y32-20020a056358292000b00134c1eb8744mr7904903rwb.9.1691464322492; Mon, 07 Aug 2023 20:12:02 -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.12.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 20:12:02 -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 20/24] tcg/i386: Add cf parameter to tcg_out_cmp Date: Mon, 7 Aug 2023 20:11:39 -0700 Message-Id: <20230808031143.50925-21-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::32b; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32b.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 Add the parameter to avoid TEST and pass along to tgen_arithi. All current users pass false. Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index b88fc14afd..56549ff2a0 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1418,15 +1418,15 @@ static void tcg_out_jxx(TCGContext *s, int opc, TCGLabel *l, bool small) } } -static void tcg_out_cmp(TCGContext *s, TCGArg arg1, TCGArg arg2, - int const_arg2, int rexw) +static void tcg_out_cmp(TCGContext *s, int rexw, TCGArg arg1, TCGArg arg2, + int const_arg2, bool cf) { if (const_arg2) { - if (arg2 == 0) { + if (arg2 == 0 && !cf) { /* test r, r */ tcg_out_modrm(s, OPC_TESTL + rexw, arg1, arg1); } else { - tgen_arithi(s, ARITH_CMP + rexw, arg1, arg2, 0); + tgen_arithi(s, ARITH_CMP + rexw, arg1, arg2, cf); } } else { tgen_arithr(s, ARITH_CMP + rexw, arg1, arg2); @@ -1437,7 +1437,7 @@ static void tcg_out_brcond(TCGContext *s, int rexw, TCGCond cond, TCGArg arg1, TCGArg arg2, int const_arg2, TCGLabel *label, bool small) { - tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); + tcg_out_cmp(s, rexw, arg1, arg2, const_arg2, false); tcg_out_jxx(s, tcg_cond_to_jcc[cond], label, small); } @@ -1528,7 +1528,7 @@ static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond, TCGArg dest, TCGArg arg1, TCGArg arg2, int const_arg2) { - tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); + tcg_out_cmp(s, rexw, arg1, arg2, const_arg2, false); tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest); tcg_out_ext8u(s, dest, dest); } @@ -1594,7 +1594,7 @@ static void tcg_out_movcond(TCGContext *s, int rexw, TCGCond cond, TCGReg dest, TCGReg c1, TCGArg c2, int const_c2, TCGReg v1) { - tcg_out_cmp(s, c1, c2, const_c2, rexw); + tcg_out_cmp(s, rexw, c1, c2, const_c2, false); tcg_out_cmov(s, cond, rexw, dest, v1); } @@ -1637,7 +1637,7 @@ static void tcg_out_clz(TCGContext *s, int rexw, TCGReg dest, TCGReg arg1, tgen_arithi(s, ARITH_XOR + rexw, dest, rexw ? 63 : 31, 0); /* Since we have destroyed the flags from BSR, we have to re-test. */ - tcg_out_cmp(s, arg1, 0, 1, rexw); + tcg_out_cmp(s, rexw, arg1, 0, 1, false); tcg_out_cmov(s, TCG_COND_EQ, rexw, dest, arg2); } }