From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB72C3857C77; Mon, 19 Sep 2022 07:52:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB72C3857C77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663573947; bh=xCZNxa4T6kuoJs6HPu+jDY4tQsUDIypTSigiWX+cMaU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=h37iHcq81k7gY3NTPPqGlNzL3SM8N9T6YFf40vnIwkLwkkJ+sm+tOnpGcgT8UlCTZ GYuUb+yix/7giken+a+DloAJimkXBvWCWz/5XZHcvX2tM8OENFtDCy2F5tL6bGH54o mZ8P1gAC7HR/PSZXZOOBFyexd+DRlLNgyiDMDN+k= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99184] [avr] wrong double to 16-Bit and 32-Bit integers in libgcc/libf7 Date: Mon, 19 Sep 2022 07:52:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99184 --- Comment #3 from CVS Commits --- The releases/gcc-12 branch has been updated by Richard Biener : https://gcc.gnu.org/g:57896e8cddd2eb952145fa32ca25635fd63246b4 commit r12-8773-g57896e8cddd2eb952145fa32ca25635fd63246b4 Author: Georg-Johann Lay Date: Mon Sep 19 09:46:58 2022 +0200 Fix PR target/99184: Wrong cast from double to 16-bit and 32-bit ints this patch fixed PR target/99184 which incorrectly rounded during 64-bit (long) double to 16-bit and 32-bit integers. The patch just removes the respective roundings from libf7-asm.sx::to_integer and ::to_unsigned. Luckily, LibF7 does nowhere use respective functions internally, the only user is in libf7.c::f7_exp which reads f7_round (qq, qq); int16_t q =3D f7_get_s16 (qq); so that f7_get_s16() operates on an already rounded value, and therefore this code works unaltered with or without rounding in to_integer. PR target/99184 libgcc/config/avr/libf7/ * libf7-asm.sx (to_integer, to_unsigned): Don't round 16-bit and 32-bit integers. (cherry picked from commit 0b5b8ac5cb7fe92dd17ae8bd7de84640daa59e84)=