From patchwork Tue Aug 8 03:11:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 711560 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp1915654rwb; Mon, 7 Aug 2023 20:15:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9Pkeo2ha5rlF/d2cWegSk1NfZ4GenWNdP8M/fCGs+Xn65x/4TG+FzWqtdummjbvgFkcvf X-Received: by 2002:a05:622a:256:b0:40f:bec4:7179 with SMTP id c22-20020a05622a025600b0040fbec47179mr15287293qtx.2.1691464510490; Mon, 07 Aug 2023 20:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691464510; cv=none; d=google.com; s=arc-20160816; b=rDx3IxNkTCET+40mHzQa/GBAXWE4DNw/TrZAIxrN3C3Azth9dXcWWaUuzPN0g5HqJy LxpRvysD7JIhXAXeyM5eIsKzodsb67P4CZsnvN1X3ZADDLEz+TDs3IU7qFXZiBXFZFYn zJAF3YGhWq8NKItRfQBRPaJUq3EzIt4TwsfKxoIe/SxxchNb6RD4x+cYIdgNFmjt8iPO xZ+ueP8ua6b+QVLVzv1qB9ZEn28UanVdc3mRpr/SIocdJlUPnlEerJprI9TPwnRVqtix hzTwmgSpeC/8JT75LoFMdIiukQlP/HsrPd0WAQXJbnOiQnKwte9lj/qEmm17IJ97J5wx pPew== 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=5bAv2VkeF2nF/Nch+eWToS5kdoZdnIAW3FmjUUhtDDU=; fh=hqs26moy805PsHbwd88lUczy2QdlfF59ojSMxj/DeWg=; b=0787Ct/0RuJr3zaxE8t10oEl9lPfIHISB/5xiRmnN/+OS4cypbOB0ZaDRmhSwm6grz tNQeMgWXEd5ovId9Ynnxglgk/+RD3SNPrlPevJ1hIKg9l8OXfhf6Wd4l/5cY18oEa+hr 90bzKONCThZ9M0GDG6SqTXH/mQOX6dpqMt5ahAyfOWfSLWKmgT5DqnUgodbnehGCWg4G 5kqnjdduQryZ9xhEoHoTlAN/wReWEuXnQaBwCtu0OUfXoof+BT8F3DbNxy0MbNbpaGRo cvh4AOqdaAS0jx3KXasP518IIIC7a7bveb1EDzVqUjYZOA61ZOBRzDKN5TznqdNv6Ug+ 5mAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SUUPWgh+; 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 e17-20020ac85991000000b0040dfc5b0801si5720299qte.455.2023.08.07.20.15.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Aug 2023 20:15:10 -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=SUUPWgh+; 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 1qTD9U-0003gJ-2s; Mon, 07 Aug 2023 23:12:58 -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 1qTD8s-0001bW-K1 for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:20 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTD8c-0000JY-Cl for qemu-devel@nongnu.org; Mon, 07 Aug 2023 23:12:18 -0400 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bd0425ad4fso256892a34.2 for ; Mon, 07 Aug 2023 20:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691464321; x=1692069121; 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=5bAv2VkeF2nF/Nch+eWToS5kdoZdnIAW3FmjUUhtDDU=; b=SUUPWgh+XIMAPs7bvA4YCksr0dMjMZVJDkI9hzC6Ku7umWLcpE/uAZT4Tnq97H48lD TTj/Fy9BFJPnjcGwBwaG6sdZg/cSqnSb61KEDIV6rTSioQ6woN049qJkFFaP79jEDh8I kKSKLM2FETsJfq/xAOvMDMboIKQXPXs/YUs9JIPI1emJaE2cAYiajzKEBqIUjsV/PzqM j1fV3dRwxR3KT/gW6lZZ1m6OTt/iXkaTAj1rTla/FZoeKkmCdm50AOrfjDFE8VvpsJeD nt0bDeaFRSdMeDfFDzD/lTJy1EeChsJI47M0GzOJxxHV1p71WSpgsWHQJmqmtpxPZobn EYMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691464321; x=1692069121; 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=5bAv2VkeF2nF/Nch+eWToS5kdoZdnIAW3FmjUUhtDDU=; b=kNAlUs0IQcPF+hn/ns6OHOQzzkhdluYi7G4pkMeO7SZ9dBtekX0SV6DGCxmBIIImuk 6ugDE0w3kItAc3TVJIbrGBQ3J/dRzFhuoD1cnKfX+wm+czCYK0yogCxpBrmfe9XCRqe8 ED7oTheHI/cQ5sRdO91SOaCaRXek5WV08ycJkeyUwP8OHrA0tewgZzQAnQBpbhcWXqJZ P45iAVB++js+bYC4yAKcW7xa/ssz9egVZ0K63SPq/vZlDNMK0itgqCqlbw6wrpOgFeVl geIQ0tSRlR18AFaEZfOaTTWYIK7Id0EbnaFLzPk8OuaOik++JjR8s4ueqx4cVuIAypzK Pjeg== X-Gm-Message-State: AOJu0YygNExOluBlLQQ2fqrQPKpFG6B0rHGiqdcI8NuSE8Q4mPqzlS4Z iSKXEnPxgLwvXGZbHmVDVGaDHj8WjPYRNI2vOiA= X-Received: by 2002:a05:6358:7250:b0:134:e777:c78b with SMTP id i16-20020a056358725000b00134e777c78bmr9986135rwa.5.1691464320876; Mon, 07 Aug 2023 20:12:00 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 20:12:00 -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 18/24] tcg/i386: Merge tcg_out_setcond{32,64} Date: Mon, 7 Aug 2023 20:11:37 -0700 Message-Id: <20230808031143.50925-19-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::333; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x333.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 Pass a rexw parameter instead of duplicating the functions. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- tcg/i386/tcg-target.c.inc | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index b9673b55bd..ec3c7012d4 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1524,23 +1524,16 @@ static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, } #endif -static void tcg_out_setcond32(TCGContext *s, TCGCond cond, TCGArg dest, - TCGArg arg1, TCGArg arg2, int const_arg2) +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, 0); + tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest); tcg_out_ext8u(s, dest, dest); } -#if TCG_TARGET_REG_BITS == 64 -static void tcg_out_setcond64(TCGContext *s, TCGCond cond, TCGArg dest, - TCGArg arg1, TCGArg arg2, int const_arg2) -{ - tcg_out_cmp(s, arg1, arg2, const_arg2, P_REXW); - tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest); - tcg_out_ext8u(s, dest, dest); -} -#else +#if TCG_TARGET_REG_BITS == 32 static void tcg_out_setcond2(TCGContext *s, const TCGArg *args, const int *const_args) { @@ -2565,8 +2558,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_brcond(s, rexw, a2, a0, a1, const_args[1], arg_label(args[3]), 0); break; - case INDEX_op_setcond_i32: - tcg_out_setcond32(s, args[3], a0, a1, a2, const_a2); + OP_32_64(setcond): + tcg_out_setcond(s, rexw, args[3], a0, a1, a2, const_a2); break; case INDEX_op_movcond_i32: tcg_out_movcond32(s, args[5], a0, a1, a2, const_a2, args[3]); @@ -2718,9 +2711,6 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, } break; - case INDEX_op_setcond_i64: - tcg_out_setcond64(s, args[3], a0, a1, a2, const_a2); - break; case INDEX_op_movcond_i64: tcg_out_movcond64(s, args[5], a0, a1, a2, const_a2, args[3]); break;