From patchwork Thu Oct 20 09:32:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 59155 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 490D23982424 for ; Thu, 20 Oct 2022 09:38:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 490D23982424 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258709; bh=6wbI116fbWtKYgCF2FM653s6bDcsXaHpo2sAzKe4sRM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=NmY7yjvLyW4c1T3uMHEANhcgUcNy18be92JIUybBS3VYbAhqjMFsyCCWN48LxwTQV 0RcAFxGOEU2iau2SFo98o6j39SxHCXDhXnWL9zILBCSVz/s3P4A2V5V2KjYmvPxCu+ 711qRJ1uH8bXilK1KqsKZkGkml8oc2vL4ce4W6sE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 24B2338376A6 for ; Thu, 20 Oct 2022 09:37:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 24B2338376A6 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 54F88300089; Thu, 20 Oct 2022 09:37:06 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Subject: [PATCH 24/40] sim/mips: Fix enum type-related issues on cp1.c Date: Thu, 20 Oct 2022 09:32:29 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tsukasa OI via Gdb-patches From: Tsukasa OI Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Clang generates a warning if there is an enum value with a mismatching type without an explicit cast ("-Wenum-conversion"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). This commit adds explicit casts and change a type on sim/mips/cp1.c. --- sim/mips/cp1.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c index 196173c0227..56a40c00623 100644 --- a/sim/mips/cp1.c +++ b/sim/mips/cp1.c @@ -1178,7 +1178,7 @@ inner_rsqrt(uint64_t op1, uint32_t res; sim_fpu_32to (&wop1, op1); status |= sim_fpu_sqrt (&ans, &wop1); - status |= sim_fpu_round_32 (&ans, status, round); + status |= sim_fpu_round_32 (&ans, (sim_fpu_round) status, (sim_fpu_denorm) round); wop1 = ans; op_status = sim_fpu_inv (&ans, &wop1); op_status |= sim_fpu_round_32 (&ans, round, denorm); @@ -1216,7 +1216,7 @@ fp_inv_sqrt(sim_cpu *cpu, FP_formats fmt) { sim_fpu_round round = rounding_mode (GETRM()); - sim_fpu_round denorm = denorm_mode (cpu); + sim_fpu_denorm denorm = denorm_mode (cpu); sim_fpu_status status = 0; uint64_t result = 0; @@ -1903,8 +1903,8 @@ convert_ps (sim_cpu *cpu, result = (((uint64_t)res_u) << 32) | (uint64_t)res_l; break; case fmt_ps: - status_u |= sim_fpu_round_32 (&wop_u, 0, round); - status_l |= sim_fpu_round_32 (&wop_l, 0, round); + status_u |= sim_fpu_round_32 (&wop_u, 0, (sim_fpu_denorm) round); + status_l |= sim_fpu_round_32 (&wop_l, 0, (sim_fpu_denorm) round); sim_fpu_to32 (&res_u, &wop_u); sim_fpu_to32 (&res_l, &wop_l); result = FP_PS_cat(res_u, res_l);