From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1E0DA39450CE; Fri, 28 Aug 2020 14:31:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E0DA39450CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598625098; bh=MSAIEc75g385LMcGGTZf05x7w9sMa0wfXZWedrGhFVc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ROyvHZd/0EMJi/AI+1uuE+M0cuTVZlfQqgL8gcnM5OYCasm7DXKB2bcyZuCaKlsrH RRcw7jDjPEkYd4zgXIKCfKXlg9TCoV6xwkSsM8P22WCXV5NQ4JHBYCyW/h+BO3hLDP +BLR9pIULY7iVNdnGCcrs3nQ93hOiNTIbyU5ry24= From: "chfast at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96793] __builtin_floor produces wrong result when rounding direction is FE_DOWNWARD Date: Fri, 28 Aug 2020 14:31:37 +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.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chfast at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ubizjak at gmail dot com X-Bugzilla-Target-Milestone: 8.5 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 14:31:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96793 --- Comment #16 from Pawe=C5=82 Bylica --- I have checked the glibc implementation of floorf(). Source here: https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dsysdeps/ieee754/flt-= 32/s_floorf.c;h=3Dda6c6dfa8ae86129e74dffff2e4391fac3a3c2ec;hb=3DHEAD - It has variant for SSE 4.1 using ROUNDSS 9 - all good here. - Otherwise it either uses __builtin_floorf() (so bug here), - or generic implementation based on bit manipulations (so should be roundi= ng direction independent).=