From patchwork Thu Sep 3 11:21:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 248992 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp349445ilg; Thu, 3 Sep 2020 04:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFsXma+P1MXE/0RoXm98gChfBhQQue8axRJWOCNdoJlST26vdpyEeElukRUqt8/D9nCbv8 X-Received: by 2002:a25:c68b:: with SMTP id k133mr2113654ybf.186.1599132122097; Thu, 03 Sep 2020 04:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599132122; cv=none; d=google.com; s=arc-20160816; b=wNYczVyvG/Yu+QHlT3Prjw1jS2cRKsjWb/ceOhaZsvJbjpsCCr7cRP3Wgq4UkXNCe2 4KXdxTiid/558q4fFWQUZHozf7av8KhOiX8LDdcbRUGf2Yjpxw8Nz0idy85yqxg+VWCH 8rgeUhh8hvtr9JP53/8b5SXAg6lVB1xqR3aTIEduWEg92sxKrEtiHigc/HYznxnCkDMD sFXpcHesgPdUtoV871d9oLKoMtHG8x8RqMubv9YDX0hiYkXXWcLzHCuu16kYDGGWVXrz 9sg/I/r9n8VgMlzzqQDv6XUBLhlw5lMN3l8rlGwfkc47teuaXjSBNPZlzoc6wrsRn3A1 6aAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=cMROPLcTcDLsqz8ZyHuI3PmBlKUI5qkazLVoDFSt+zE=; b=OYH7Am4AFBKpnYH4guBRnunknNx+gXAc1AygYELSV8H7yF2xJMKzQF4BXd3rr8mk5o JYq8ld5TPO72u54vUkeh1qMQ/iSmMbkSY+QPwSt8k4g8hEPeTBYfiI9i2x85kkUNSCOz +hNJC+CwtGO03wPWaV1WY20Y3mg8NUnaj0tOSoFfOsHjle+LGh7idHw93s+3vVd4eLOo MGI94rQxBWGs3yL5Cy987lX0jCWlX2GvaUphLNq9NEHPozvPFRDYLuBW4/oyfaC99h+J bN3lUG0rloLxUCYwpblZJMkz/O/MlR/5VTUzFMfkdLuoCzG1T3gSADsAsr3bl6+PIV+I L3Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=d79wSgjg; 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=fail (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 s133si2994739yba.495.2020.09.03.04.22.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 04:22:02 -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=fail header.i=@linaro.org header.s=google header.b=d79wSgjg; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDnJZ-0003eV-I9 for patch@linaro.org; Thu, 03 Sep 2020 07:22:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDnIz-0002l4-4Z for qemu-devel@nongnu.org; Thu, 03 Sep 2020 07:21:25 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:36413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDnIx-0007aL-2y for qemu-devel@nongnu.org; Thu, 03 Sep 2020 07:21:24 -0400 Received: by mail-wm1-x344.google.com with SMTP id z9so2509178wmk.1 for ; Thu, 03 Sep 2020 04:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cMROPLcTcDLsqz8ZyHuI3PmBlKUI5qkazLVoDFSt+zE=; b=d79wSgjguVjpuWwN2r//uARngSrrvXyXdYbHUNYzGcU6XL993iR2xOXCZf2TJ+w2SE F1k1N1xBkEGJ0xoHqyVSMeXVyKKmkmDUarqHJyBYy/UBcazuNnKenkugEMSvdwRSSGwx +sR4wYvyu3bCVvqa4ji2NNUR/9CV8fztKjq0FLRDU40Hq92piIjaoc3ZBM6IShJqOB6N hVJlx36qgB/Yfz8BCDXF5vdRwAb3Xfikz2f7aRBgyWYzVjFuJZaa81sJxPKy7aWFH7WS 0ZEJILBEkYcbnAksQLqTLj1+EbFpl97HbpyKrl7+/1r7XrRFTE+kIQdM1iobmkHUzTwu e9Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cMROPLcTcDLsqz8ZyHuI3PmBlKUI5qkazLVoDFSt+zE=; b=a4Mm0rn7UC0fqDANBLcjEEKdxqz1B6iUkHlTXJ2FdFpD9zIsH+TqaWwYKUbmTpqwU7 jfDNVx32P8eaguSymW8Wgc7eVK3WB8Tkb6BQwjKXrxUBkQY7SC1DIOpsKGLGsYWvtl/V f/JU3xrBe85cnpkirwlg0naMlGZhzzA8+0vq/HJ0sAos/SF24eDxB1mk/EuEDq8fjJNR i/8uYc7orsep5S0pgMtfvpcVW6lrzIHck5tdSgaWg8hZFiIkoI76TSbRBYcD8MwoyzMa ixUZHcO5OXWnMubZPMaBfNFpN5ZPbh2M5zZVLxc0Ct4TuQgWE73NgpkSOWrLmtiWemE4 IpNQ== X-Gm-Message-State: AOAM530plcsXxW2QM1gYju/K/tjsc+JK2faWc0nUncJ8jCkcce08/pXL eDQdb80LvJowInAY76bZZcPoJw== X-Received: by 2002:a1c:105:: with SMTP id 5mr2076404wmb.83.1599132081691; Thu, 03 Sep 2020 04:21:21 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c205sm3850668wmd.33.2020.09.03.04.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 04:21:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7253C1FF93; Thu, 3 Sep 2020 12:21:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 7/8] target/mips: simplify gen_compute_imm_branch logic Date: Thu, 3 Sep 2020 12:21:06 +0100 Message-Id: <20200903112107.27367-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200903112107.27367-1-alex.bennee@linaro.org> References: <20200903112107.27367-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Aleksandar Rikalo , berrange@redhat.com, stefanb@linux.vnet.ibm.com, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , richard.henderson@linaro.org, f4bug@amsat.org, Aleksandar Markovic , cota@braap.org, stefanha@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" One of the Travis builds was complaining about: qemu/include/tcg/tcg.h:437:12: error: ‘cond’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return (TCGCond)(c ^ 1); ../target/mips/translate.c:20031:13: note: ‘cond’ was declared here TCGCond cond; Rather than figure out exactly which one was causing the complaint I just defaulted to TCG_COND_ALWAYS and allowed that state to double up for the now defunct bcond_compute variable. Signed-off-by: Alex Bennée --- target/mips/translate.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/mips/translate.c b/target/mips/translate.c index 899b90ae0ff..398edf72898 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -20028,8 +20028,7 @@ static void gen_pool32axf_nanomips_insn(CPUMIPSState *env, DisasContext *ctx) static void gen_compute_imm_branch(DisasContext *ctx, uint32_t opc, int rt, int32_t imm, int32_t offset) { - TCGCond cond; - int bcond_compute = 0; + TCGCond cond = TCG_COND_ALWAYS; TCGv t0 = tcg_temp_new(); TCGv t1 = tcg_temp_new(); @@ -20046,7 +20045,6 @@ static void gen_compute_imm_branch(DisasContext *ctx, uint32_t opc, /* Treat as NOP */ goto out; } else { - bcond_compute = 1; cond = TCG_COND_EQ; } break; @@ -20065,7 +20063,6 @@ static void gen_compute_imm_branch(DisasContext *ctx, uint32_t opc, tcg_gen_shri_tl(t0, t0, imm); tcg_gen_andi_tl(t0, t0, 1); tcg_gen_movi_tl(t1, 0); - bcond_compute = 1; if (opc == NM_BBEQZC) { cond = TCG_COND_EQ; } else { @@ -20080,7 +20077,6 @@ static void gen_compute_imm_branch(DisasContext *ctx, uint32_t opc, } else if (rt == 0 && imm != 0) { /* Unconditional branch */ } else { - bcond_compute = 1; cond = TCG_COND_NE; } break; @@ -20088,24 +20084,20 @@ static void gen_compute_imm_branch(DisasContext *ctx, uint32_t opc, if (rt == 0 && imm == 0) { /* Unconditional branch */ } else { - bcond_compute = 1; cond = TCG_COND_GE; } break; case NM_BLTIC: - bcond_compute = 1; cond = TCG_COND_LT; break; case NM_BGEIUC: if (rt == 0 && imm == 0) { /* Unconditional branch */ } else { - bcond_compute = 1; cond = TCG_COND_GEU; } break; case NM_BLTIUC: - bcond_compute = 1; cond = TCG_COND_LTU; break; default: @@ -20118,7 +20110,7 @@ static void gen_compute_imm_branch(DisasContext *ctx, uint32_t opc, clear_branch_hflags(ctx); ctx->base.is_jmp = DISAS_NORETURN; - if (bcond_compute == 0) { + if (cond == TCG_COND_ALWAYS) { /* Uncoditional compact branch */ gen_goto_tb(ctx, 0, ctx->btarget); } else {