From patchwork Tue Dec 5 13:12:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 81414 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 C7A613858423 for ; Tue, 5 Dec 2023 13:13:00 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id CF8093858C2A for ; Tue, 5 Dec 2023 13:12:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF8093858C2A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF8093858C2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701781968; cv=none; b=G+K7UekwCi4ZgAJ5tR3oMiSa5mrXOcIp/JujmlHoMXXB97BxnWTOJi1hd6OrkQ6I6UHDEvg2xC2Vx0jd/cjZw8U+6pMgZKIXZS/PyRzDoFESKxDkWEJRxgiAQ4/YNL/QzZcI19/FWgFfA1M2FzO7duRd7j0lWjwTipU/GKzCBAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701781968; c=relaxed/simple; bh=QxzSN+tPbkF8CZpmd7V4ROML6rgNMeomxR/WVryWUiw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=EgprpXHGLxpwxRfRiGCM9+x78Qyse5DMlUYY1YcP/QtWZsILDCNuVm2o5HL7Y31TSwJTlmvQpD3WdbgKAwctGCbB09iGmjvfqQGpyLUp/srbSOhrXV1nvmfjZsoR78FXWe71rUasxmUGvriQPs9/qAZBF+Sw/kITpjIVHkep5B0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 80FF533BE3B; Tue, 5 Dec 2023 13:12:46 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed] sim: mips: fix sim_fpu usage Date: Tue, 5 Dec 2023 06:12:44 -0700 Message-ID: <20231205131244.4216-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Fix some of the sim_fpu calls to use the right types. While I'm not familiar with the MIPS ISA in these cases, these look like simple oversights due to the name/type mismatches. This at least fixes compiling with -Wenum-conversion. --- 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 1af0c7ae76d1..aa8b05a836c5 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, round, denorm); 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, round, denorm); + status_l |= sim_fpu_round_32 (&wop_l, round, denorm); sim_fpu_to32 (&res_u, &wop_u); sim_fpu_to32 (&res_l, &wop_l); result = FP_PS_cat(res_u, res_l);