From nobody Wed Nov 27 14:29:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1698522528; cv=none; d=zohomail.com; s=zohoarc; b=W0si/tgSGZfTJ2qAJj5IAbJgdsk5RV7dV841lQbP40GWRshKkFfYrw4dBkfUc5nFbuWXTt9yHCPaC9TvHVxB/WcIYnOB/KumE8i1zT7wkc+vcj0mr3xlOaXnH80lEsia7zZdURGn1JuAtEEvt4aLnMwTOgzvZTZ97cspJfZLXfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698522528; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eaS806fXDgpWYQcWW93tmIyE7x8YLTYsN4JgDu9oFC8=; b=HlM0C8jV+P/pcP23CmUJz2ArazS2StVP7maIOKzmyfmN8GVcRmeAh1epl8801JfK47hg6JJdvvVqxazFS2eoUySSijclry36XgL+fR2wincR4rrekcgxXp19jmXkfqE6Ue1mwhwADJuF38ukbV0n3hwlMteYoXvYleXULBZa8pM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169852252891284.38613828961047; Sat, 28 Oct 2023 12:48:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwpG0-0004uf-6A; Sat, 28 Oct 2023 15:46: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 1qwpFa-0004jg-TS for qemu-devel@nongnu.org; Sat, 28 Oct 2023 15:45:38 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwpFY-00047S-Hv for qemu-devel@nongnu.org; Sat, 28 Oct 2023 15:45:37 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2800f7c8125so1116322a91.1 for ; Sat, 28 Oct 2023 12:45:36 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id h9-20020a170902f7c900b001b8a3e2c241sm3600096plw.14.2023.10.28.12.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 12:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698522335; x=1699127135; 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=eaS806fXDgpWYQcWW93tmIyE7x8YLTYsN4JgDu9oFC8=; b=rVgYZSBt9Pf8H91V09NR2pblM28ZYPRm5NL8J7nvng+Xw9L0PyoB/kK8MfwZzkd7I1 NglQeXllnGLqagki+JcqFUhntBCKPNNLc/sC9pg1aqJ1tyGFn83LwR9pUJyBmpwxqZsY cAhZpT4J8XOgFyVZcVQ6IJ2Jc5N6/dw59MT3vjtjIqZ/VyTpo5U8uuRcvbAkbIXDoIqD iiuEtIk4IF1Y/nmTOBHKrbq7MLG+6YvGEFqAaql4L5Y8SMw9nl09acr9QyveIVMo1qKx CAYbHQoogNNnqcQZ5vqWdU5TPs8Bhm5M0E3TepghXUGYVHF032mQcWpcocZ9rppmG4a8 BQlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698522335; x=1699127135; 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=eaS806fXDgpWYQcWW93tmIyE7x8YLTYsN4JgDu9oFC8=; b=cN3zVdqvO/iydAw5wV8wAWtASPOoemFUfl1qskKpYGBgpdPra5Z47Ojaer/wKDXqmA ljzQreFpVT6CXPE6HH/QPkzHpb5xT9bFIe3Je3bJyyNh2CAUijreCFJ20zxjMGocTsPV ecKBPyjQDNfN52XdlouUVxkqxAGQsjRTjMuXQgqRmePBeBa0CLvEmsQd0f/JJMxpCRr2 H8/g02FZ9qDJ+DQIVUtPWMb76oFJnE58uRIRLtyrVOY+rDU121d7Tr9lGzmC8V/Mqm2g buYp3gIDO6LZR9/ksS1+609ZHXsedpNXwGn7POB/jDXo0XH060KuEsnqV6BAfXUVSnLd T1QA== X-Gm-Message-State: AOJu0YySU/DA74FxfvxYj951muUVcFAe38rnuj9K5PU2ZDScEFM1KJbE xId0MatX+d6+R1sb1a09Wx7DQPtJDZUWJMH7V/E= X-Google-Smtp-Source: AGHT+IEwNoz8OpQ4Qn4EhH7d9WlqsfZ5iaZQKgOMWXwhAe7n6quAYDBYRCvHNGULUMPdaRPKk4OfFA== X-Received: by 2002:a17:90b:2405:b0:280:204e:9121 with SMTP id nr5-20020a17090b240500b00280204e9121mr3687604pjb.23.1698522335114; Sat, 28 Oct 2023 12:45:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, pbonzini@redhat.com Subject: [PATCH v2 12/35] tcg/i386: Pass x86 condition codes to tcg_out_cmov Date: Sat, 28 Oct 2023 12:44:59 -0700 Message-Id: <20231028194522.245170-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231028194522.245170-1-richard.henderson@linaro.org> References: <20231028194522.245170-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698522530461100003 Content-Type: text/plain; charset="utf-8" Hoist the tcg_cond_to_jcc index outside the function. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 eeb23d3fca..8b1baa8206 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1669,14 +1669,14 @@ static void tcg_out_setcond2(TCGContext *s, const T= CGArg *args, } #endif =20 -static void tcg_out_cmov(TCGContext *s, TCGCond cond, int rexw, +static void tcg_out_cmov(TCGContext *s, int jcc, int rexw, TCGReg dest, TCGReg v1) { if (have_cmov) { - tcg_out_modrm(s, OPC_CMOVCC | tcg_cond_to_jcc[cond] | rexw, dest, = v1); + tcg_out_modrm(s, OPC_CMOVCC | jcc | rexw, dest, v1); } else { TCGLabel *over =3D gen_new_label(); - tcg_out_jxx(s, tcg_cond_to_jcc[tcg_invert_cond(cond)], over, 1); + tcg_out_jxx(s, jcc ^ 1, over, 1); tcg_out_mov(s, TCG_TYPE_I32, dest, v1); tcg_out_label(s, over); } @@ -1687,7 +1687,7 @@ static void tcg_out_movcond(TCGContext *s, int rexw, = TCGCond cond, TCGReg v1) { tcg_out_cmp(s, c1, c2, const_c2, rexw); - tcg_out_cmov(s, cond, rexw, dest, v1); + tcg_out_cmov(s, tcg_cond_to_jcc[cond], rexw, dest, v1); } =20 static void tcg_out_ctz(TCGContext *s, int rexw, TCGReg dest, TCGReg arg1, @@ -1699,12 +1699,12 @@ static void tcg_out_ctz(TCGContext *s, int rexw, TC= GReg dest, TCGReg arg1, tcg_debug_assert(arg2 =3D=3D (rexw ? 64 : 32)); } else { tcg_debug_assert(dest !=3D arg2); - tcg_out_cmov(s, TCG_COND_LTU, rexw, dest, arg2); + tcg_out_cmov(s, JCC_JB, rexw, dest, arg2); } } else { tcg_debug_assert(dest !=3D arg2); tcg_out_modrm(s, OPC_BSF + rexw, dest, arg1); - tcg_out_cmov(s, TCG_COND_EQ, rexw, dest, arg2); + tcg_out_cmov(s, JCC_JE, rexw, dest, arg2); } } =20 @@ -1717,7 +1717,7 @@ static void tcg_out_clz(TCGContext *s, int rexw, TCGR= eg dest, TCGReg arg1, tcg_debug_assert(arg2 =3D=3D (rexw ? 64 : 32)); } else { tcg_debug_assert(dest !=3D arg2); - tcg_out_cmov(s, TCG_COND_LTU, rexw, dest, arg2); + tcg_out_cmov(s, JCC_JB, rexw, dest, arg2); } } else { tcg_debug_assert(!const_a2); @@ -1730,7 +1730,7 @@ static void tcg_out_clz(TCGContext *s, int rexw, TCGR= eg dest, TCGReg arg1, =20 /* Since we have destroyed the flags from BSR, we have to re-test.= */ tcg_out_cmp(s, arg1, 0, 1, rexw); - tcg_out_cmov(s, TCG_COND_EQ, rexw, dest, arg2); + tcg_out_cmov(s, JCC_JE, rexw, dest, arg2); } } =20 --=20 2.34.1