From patchwork Wed Aug 23 20:23:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 716111 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1002546wrp; Wed, 23 Aug 2023 13:26:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEANmdKUOwEMWCp2jm/iSZX4uJDcqSI42695KOkPvDMzju5Xs6bJfSF08qep0jHqrN7ezTl X-Received: by 2002:a05:620a:305:b0:76d:1223:10e8 with SMTP id s5-20020a05620a030500b0076d122310e8mr14379984qkm.46.1692822391206; Wed, 23 Aug 2023 13:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692822391; cv=none; d=google.com; s=arc-20160816; b=eu9MPCMWfylIU4FYTyUIPatItoJnEdy5qbX+G3BUhZSc5Xhn8jwD+aWEKx8hf7r8qF LcdlqHmPhfCUuI5WJ4zmEMajAOy5iFVdUMf39MX4YDKQEh+F8WFwu4ZACTiZWp0HGLW5 gYbbbbNMJP9Rg6q5AMWCklwR8hF2BYc91oQHDg1iaByJuZKIHzBQq4DoXtK/MpaCyCfS SYvttdelOMnyzNygKUqIaWwomcpFxsmh96o78aTbMcy19OwvAeHk7CMrGJ6BA3zzrC8k K7Xk+UoJyuXf+T03OwEUES3ZgiqAjVCgfIbPfPDqCpN2F0gyrQVrIokgRWN/TLCowqys 1rKw== 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=ZrRdZQsCRn1Wwa7rMBULMSKKjtejp0k93c02stP4yQw=; fh=hqFW2tULe/VYZL5cutrFBQv2fOj+hfBo4XY3KgwhGJw=; b=jqijThho+trSa48JAShjlCP5EkxnekSMjvQUXrXLUkwXHPlTpvvUU6N7LKWYmoERsP KsGJY4EM0yl8A8RSbfJsQ8X6BTKhZu4cBlbzFL+GBDeSI2BaecphdChnUILq+yf734g0 vcCzlTEe0xMBTP7KWd2Zgh4NRIO0pMR9F5vVKmqiG651Vef9W7qsUSetrhMvgpv8idTV 07irMtYX9LQW+KmPv6lc11oCSoWbU8+Jps0Nk8yy1TOIdLc/rKwCeNjUk86bYhq1BLFl qzmAJBuQoQ2wuZKRRyVSDTg7Rg5xUHfwGE9A7M1n4ITH+5qLkKUhwK5bwZfnTR+Vxqj7 PxfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ICBhFU/j"; 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 x29-20020a05620a0b5d00b00768064b6b5bsi500693qkg.755.2023.08.23.13.26.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 13:26:31 -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="ICBhFU/j"; 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 1qYuOe-00008r-7i; Wed, 23 Aug 2023 16:24:08 -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-0008RE-8F for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOW-0005Wu-Rt for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1bdb7b0c8afso37596335ad.3 for ; Wed, 23 Aug 2023 13:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822238; x=1693427038; 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=ZrRdZQsCRn1Wwa7rMBULMSKKjtejp0k93c02stP4yQw=; b=ICBhFU/jmx8oy3yv4d7pZJ95QTqltuUzHO/Vf7VNmzrijl6sLXCTnWqAw0Hvssu0DF H43OweOF47gb7+DyBxx4PmqdQTGQtB8fUXu/t8f6Eq4volxcgktZwOLQq59FR8MULxUo xc8XKoDMZ0KweRDUqCn/8tNZAS5WG1NiSSc3FmUmT33FIl6/F7lXr3fjTKj4HzlG8+oj zefn53n00NlG5JSjgFCiRDzOukJ2HucF57PTP1HHeJyDRk5NH8PVfjvDAqBpDqfLT9CA mfQwMGN+pQNBOQNpvd4i2KdB7FGHsZJlykTtM1B7StMGCwopmB8iLdmV01360AmmTYyu +yzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822238; x=1693427038; 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=ZrRdZQsCRn1Wwa7rMBULMSKKjtejp0k93c02stP4yQw=; b=lGKXdXexJiZ8V+UZo7sOjz1skC3ACmilt6pt2SA7DxBlikqrmmOeqM3K/rkjjHY0LA b+IqI9GvWIPEUXlMPUefEyuL/0NpQN6gE7W2QNw7I4PnAs1bOUsgfFsXBtZZiY9dRAz2 v8cln6mW0Qhhv1/byBMsOBb3Uujfdb7NkBKhXN+ByZKLoU2is/UrOYAZh4exC6HMRQzI MvdiBqLSEx4m1GNxoscF44uqsC11LM0ddTiK+X8xy3x1iuG9bwaaU/wSoJ4BEVieTNz6 vHm16BSZrBNkEKSDDhOLYpjY5XsPRqk28/4WPXCsc3gTBDKX/HOxrHqs41GnIqdm808p U94w== X-Gm-Message-State: AOJu0Yx+fqaIDEuF3tPUi7lx7D79CQj+g7t4aGOXq4xSXi4FrvRq3owa exVHszd/Q9usouww/hfehIB9MIn7myYG97la0Jg= X-Received: by 2002:a17:902:ee4d:b0:1b8:ae24:c207 with SMTP id 13-20020a170902ee4d00b001b8ae24c207mr10375307plo.68.1692822238387; Wed, 23 Aug 2023 13:23:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 33/48] tcg/i386: Merge tcg_out_setcond{32,64} Date: Wed, 23 Aug 2023 13:23:11 -0700 Message-Id: <20230823202326.1353645-34-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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 Pass a rexw parameter instead of duplicating the functions. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- 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 33f66ba204..010432d3a9 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1527,23 +1527,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) { @@ -2568,8 +2561,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]); @@ -2721,9 +2714,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;