From patchwork Thu Oct 26 00:14:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738200 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp553565wrq; Wed, 25 Oct 2023 17:21:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDM/lkPH/3JJ6RguJ9KttuCEWegbIZrEwCR/yvgT+LcMTwspg9VeRkZJ6gspFJGNOpV/wo X-Received: by 2002:a5d:58ee:0:b0:32d:9850:9e01 with SMTP id f14-20020a5d58ee000000b0032d98509e01mr12262792wrd.61.1698279696391; Wed, 25 Oct 2023 17:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698279696; cv=none; d=google.com; s=arc-20160816; b=vf4VkBSaU429b6lCQear4gmG2UhioS2nmZuqDssNskJjOxaH/lAfSK32ljroYBVxhd zSHLD9GWrzN53FSEoUERsF6Hmuq+VQ0BDfxT2jpqccDcm1h0/RSLkDO+CXKygmG8xZwo PenJT56/5RfvggT1AE52t7L44XciIAgjcq6aDOXtuAhaLf9q7ZAW+aSZVAGR0LAyTFIu OJ9L5SpgWtrI+zWDQz8KPYETVlxFeOpM7aCFfJf7Rg6AcSHU4I0IvyWQlFY/amo5PiSE hua4u+TZvRkrRCk7vYFLa42IJz9QuI8TzfFGYylIChcF6dU1dC4JKVsBRQlVczkGIkRy Bomg== 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:to:from :dkim-signature; bh=yWPKPMahOrl8l7/yORUc/X3LHhh1SjBoxvyFki6O+l8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=sZsBMhsnuWt69fxnCZU4l0Y6lDEif0tdYS+b0yrF2lsowikPA0OHwPQKsWz8UmfyUD zXmNXgHZxurRD19dRM3gniyvaGykdnZkO8bcHXSzlLTUOEcuG0UoZWx1N3Z1nSaLdCzF ZQtl15RIk7XdbYQib4q8yhew9wBxfD5o15y1CmtbWd9Y/PglpfRzKzj8BBrRyxBRJIgB AcldJwYt9Yv7e07sFSUVRSCe9TIxEOCxry7KchWlU4HwS4q6oF9mlHqx5MmzFcpGUBPi Uzf7K4UqXFo0ulYWDg7bF0c1xuvWnlR0CHYLovwvj5B5y5IRITdyKCmWTyWUi0jJ4Y+Z wooA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rp5scrnv; 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 e5-20020a056000120500b003217d807846si8726631wrx.345.2023.10.25.17.21.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:21:36 -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=rp5scrnv; 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 1qvo2v-0007Gl-W4; Wed, 25 Oct 2023 20:16:22 -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 1qvo2u-0007BY-5s for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:20 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2q-0004vd-JS for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:19 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1c9a1762b43so2237045ad.1 for ; Wed, 25 Oct 2023 17:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279375; x=1698884175; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yWPKPMahOrl8l7/yORUc/X3LHhh1SjBoxvyFki6O+l8=; b=rp5scrnva0wnBpfE54E7mnovJYkQtj5TUhcE/c62IUeD5r8kRAXuX6/jTpwPnHzUQ1 /j52ckagLJLqXkSQv2T2qQAFFXSRvD8HS9XVUBJOarhmBJ6UdQ6heb9GIsz4jkdUs1di kEjuqEXGqhjFv3arOrmdTimPQYGZykEk1TPvkMvWIRLz1M+7sTnJutAm2fzKuOQ/6vaK QxzF2MGxttj4XhaLrqz52Ea238ZvGVZnB7SyvsYcRKZzUZC86lEs/bY+EpFGH+/00WGx UjeAtm1QJ9/lW/gJvode++uF2eDVb81mfinsIXnQ+tKSB4jggCnSqa7s/60fNr9PCvn1 xlJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279375; x=1698884175; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yWPKPMahOrl8l7/yORUc/X3LHhh1SjBoxvyFki6O+l8=; b=JmUt1RIJVOS5p9NfqB2/6OTA7Snq26Ek0LRHL4IDqwlqwD7ZAo1SLqLgVRRrhI08As SRG9ksJzPUMHcDfzNJyDuqjzyo5ZPenqn1WHR1iUnkluAVT+q4xb7Fs7/RJpQvYAoPc4 VZJWaJW0nR1Q4nPKdYWlQ29VGpWle6jH4lFEDMZ8yL/F6AJ9u/eJBjJNMzFi3m2+Tuzg yzM/ZIAhO8Ow/aHc2saVWj251VknpYzkh2zZHRYK2B0R869u++4V92X+edxFHQi/bljU lDBY6Q21vh8m65TO4+lDJq1uzTSHg25CqwwP/yi9V7vBr9+wZoafVt4XhyGHkaZeT4fM eLog== X-Gm-Message-State: AOJu0YxNQzdwJ8LL4DGCXfytaJjkBHTtIiHeAOZC6H59A3+6T/7w5gFQ vbB3KzBxP+xP5Ja0/MvWdpk088f6tTW09pesh+w= X-Received: by 2002:a17:903:23cd:b0:1ca:7086:60ec with SMTP id o13-20020a17090323cd00b001ca708660ecmr15608347plh.65.1698279375378; Wed, 25 Oct 2023 17:16:15 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.16.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:16:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 19/29] tcg/sparc64: Pass TCGCond to tcg_out_cmp Date: Wed, 25 Oct 2023 17:14:17 -0700 Message-Id: <20231026001542.1141412-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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 Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 13ad92b9b6..e958e3c242 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -645,7 +645,8 @@ static void tcg_out_bpcc(TCGContext *s, int scond, int flags, TCGLabel *l) tcg_out_bpcc0(s, scond, flags, off19); } -static void tcg_out_cmp(TCGContext *s, TCGReg c1, int32_t c2, int c2const) +static void tcg_out_cmp(TCGContext *s, TCGCond cond, + TCGReg c1, int32_t c2, int c2const) { tcg_out_arithc(s, TCG_REG_G0, c1, c2, c2const, ARITH_SUBCC); } @@ -653,7 +654,7 @@ static void tcg_out_cmp(TCGContext *s, TCGReg c1, int32_t c2, int c2const) static void tcg_out_brcond_i32(TCGContext *s, TCGCond cond, TCGReg arg1, int32_t arg2, int const_arg2, TCGLabel *l) { - tcg_out_cmp(s, arg1, arg2, const_arg2); + tcg_out_cmp(s, cond, arg1, arg2, const_arg2); tcg_out_bpcc(s, tcg_cond_to_bcond[cond], BPCC_ICC | BPCC_PT, l); tcg_out_nop(s); } @@ -670,7 +671,7 @@ static void tcg_out_movcond_i32(TCGContext *s, TCGCond cond, TCGReg ret, TCGReg c1, int32_t c2, int c2const, int32_t v1, int v1const) { - tcg_out_cmp(s, c1, c2, c2const); + tcg_out_cmp(s, cond, c1, c2, c2const); tcg_out_movcc(s, cond, MOVCC_ICC, ret, v1, v1const); } @@ -690,7 +691,7 @@ static void tcg_out_brcond_i64(TCGContext *s, TCGCond cond, TCGReg arg1, tcg_out32(s, INSN_OP(0) | INSN_OP2(3) | BPR_PT | INSN_RS1(arg1) | INSN_COND(rcond) | off16); } else { - tcg_out_cmp(s, arg1, arg2, const_arg2); + tcg_out_cmp(s, cond, arg1, arg2, const_arg2); tcg_out_bpcc(s, tcg_cond_to_bcond[cond], BPCC_XCC | BPCC_PT, l); } tcg_out_nop(s); @@ -714,7 +715,7 @@ static void tcg_out_movcond_i64(TCGContext *s, TCGCond cond, TCGReg ret, if (c2 == 0 && rcond && (!v1const || check_fit_i32(v1, 10))) { tcg_out_movr(s, rcond, ret, c1, v1, v1const); } else { - tcg_out_cmp(s, c1, c2, c2const); + tcg_out_cmp(s, cond, c1, c2, c2const); tcg_out_movcc(s, cond, MOVCC_XCC, ret, v1, v1const); } } @@ -758,13 +759,13 @@ static void tcg_out_setcond_i32(TCGContext *s, TCGCond cond, TCGReg ret, /* FALLTHRU */ default: - tcg_out_cmp(s, c1, c2, c2const); + tcg_out_cmp(s, cond, c1, c2, c2const); tcg_out_movi_s13(s, ret, 0); tcg_out_movcc(s, cond, MOVCC_ICC, ret, neg ? -1 : 1, 1); return; } - tcg_out_cmp(s, c1, c2, c2const); + tcg_out_cmp(s, cond, c1, c2, c2const); if (cond == TCG_COND_LTU) { if (neg) { /* 0 - 0 - C = -C = (C ? -1 : 0) */ @@ -798,7 +799,7 @@ static void tcg_out_setcond_i64(TCGContext *s, TCGCond cond, TCGReg ret, c2 = c1, c2const = 0, c1 = TCG_REG_G0; /* FALLTHRU */ case TCG_COND_LTU: - tcg_out_cmp(s, c1, c2, c2const); + tcg_out_cmp(s, cond, c1, c2, c2const); tcg_out_arith(s, ret, TCG_REG_G0, TCG_REG_G0, ARITH_ADDXC); return; default: @@ -813,7 +814,7 @@ static void tcg_out_setcond_i64(TCGContext *s, TCGCond cond, TCGReg ret, tcg_out_movi_s13(s, ret, 0); tcg_out_movr(s, rcond, ret, c1, neg ? -1 : 1, 1); } else { - tcg_out_cmp(s, c1, c2, c2const); + tcg_out_cmp(s, cond, c1, c2, c2const); tcg_out_movi_s13(s, ret, 0); tcg_out_movcc(s, cond, MOVCC_XCC, ret, neg ? -1 : 1, 1); } @@ -1101,7 +1102,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, tcg_out_movi_s32(s, TCG_REG_T3, compare_mask); tcg_out_arith(s, TCG_REG_T3, addr_reg, TCG_REG_T3, ARITH_AND); } - tcg_out_cmp(s, TCG_REG_T2, TCG_REG_T3, 0); + tcg_out_cmp(s, TCG_COND_NE, TCG_REG_T2, TCG_REG_T3, 0); ldst = new_ldst_label(s); ldst->is_ld = is_ld;