From nobody Sun Nov 16 07:22:24 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1599132186; cv=none; d=zohomail.com; s=zohoarc; b=m5BjcEmNZH1GFn/5cxdJKH+ipUxxO6czgVgexHr8VG3Xb0SGiuT/tH0Xakg7DZvhoU5RKyDdwZ6fZ7/6ZZoX6TfeUuyfO8d6BcWj9+6Fzkl1WMPQzizw/nGwbXIO89ipvyzPBpNtN8x243oNHaG5I84EeDqTjgPmAW1BABU3z4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599132186; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cMROPLcTcDLsqz8ZyHuI3PmBlKUI5qkazLVoDFSt+zE=; b=BhXwe+Of5PP07lvkCzDpKMwdg6zC/9PA3QxFrAUKyQ9Ld2uAfoRQliY7TXNLve0X9f6gQQsbJjFm41V4o1RUTbQ5CB2lxPWRDpDSZ5vTKO6MbNGrl8kXGKDcIZ3YRBcXSARSI9qKq0/cddF8CQ16xYaS1O6Hl1QTn878Tp2brqU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599132186811702.1109835999088; Thu, 3 Sep 2020 04:23:06 -0700 (PDT) Received: from localhost ([::1]:55912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDnKb-0004u2-PS for importer@patchew.org; Thu, 03 Sep 2020 07:23:05 -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) 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) 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-Google-Smtp-Source: ABdhPJzS2rPu1nqWNjT4Fo5FRInA6ZkmhMNohqh400p2NG7sw575nV29a8vKeIPMbX+5YckEn+fKmQ== X-Received: by 2002:a1c:105:: with SMTP id 5mr2076404wmb.83.1599132081691; Thu, 03 Sep 2020 04:21:21 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" 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=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=20Benn=C3=A9e?= , 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) One of the Travis builds was complaining about: qemu/include/tcg/tcg.h:437:12: error: =E2=80=98cond=E2=80=99 may be used = uninitialized in this function [-Werror=3Dmaybe-uninitialized] return (TCGCond)(c ^ 1); ../target/mips/translate.c:20031:13: note: =E2=80=98cond=E2=80=99 was dec= lared 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=C3=A9e Reviewed-by: Richard Henderson --- target/mips/translate.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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(CPUMIPSStat= e *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 =3D 0; + TCGCond cond =3D TCG_COND_ALWAYS; TCGv t0 =3D tcg_temp_new(); TCGv t1 =3D tcg_temp_new(); =20 @@ -20046,7 +20045,6 @@ static void gen_compute_imm_branch(DisasContext *ct= x, uint32_t opc, /* Treat as NOP */ goto out; } else { - bcond_compute =3D 1; cond =3D TCG_COND_EQ; } break; @@ -20065,7 +20063,6 @@ static void gen_compute_imm_branch(DisasContext *ct= x, 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 =3D 1; if (opc =3D=3D NM_BBEQZC) { cond =3D TCG_COND_EQ; } else { @@ -20080,7 +20077,6 @@ static void gen_compute_imm_branch(DisasContext *ct= x, uint32_t opc, } else if (rt =3D=3D 0 && imm !=3D 0) { /* Unconditional branch */ } else { - bcond_compute =3D 1; cond =3D TCG_COND_NE; } break; @@ -20088,24 +20084,20 @@ static void gen_compute_imm_branch(DisasContext *= ctx, uint32_t opc, if (rt =3D=3D 0 && imm =3D=3D 0) { /* Unconditional branch */ } else { - bcond_compute =3D 1; cond =3D TCG_COND_GE; } break; case NM_BLTIC: - bcond_compute =3D 1; cond =3D TCG_COND_LT; break; case NM_BGEIUC: if (rt =3D=3D 0 && imm =3D=3D 0) { /* Unconditional branch */ } else { - bcond_compute =3D 1; cond =3D TCG_COND_GEU; } break; case NM_BLTIUC: - bcond_compute =3D 1; cond =3D TCG_COND_LTU; break; default: @@ -20118,7 +20110,7 @@ static void gen_compute_imm_branch(DisasContext *ct= x, uint32_t opc, clear_branch_hflags(ctx); ctx->base.is_jmp =3D DISAS_NORETURN; =20 - if (bcond_compute =3D=3D 0) { + if (cond =3D=3D TCG_COND_ALWAYS) { /* Uncoditional compact branch */ gen_goto_tb(ctx, 0, ctx->btarget); } else { --=20 2.20.1