From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DE4EF3858D32; Mon, 27 Feb 2023 08:17:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE4EF3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677485826; bh=ULOOFLRDQfdWdhNXT419/SNukL3qgK/e7ETtaL7FNYs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aQwfkJ6NGlRLr2J2Wzx77J3MFncgV/T5NYpjrv1l4SUFKTbpgusWMVuB2a3ERR+rU LwwqQUc0XQhMPzXcAbtfe5A/1JvUTzPYAjPWgpJBJ09aj3bnWshuSsW/0tWEYXD5YG el5ROHqTUzUcr3yJRyqsjdLix+bHn1aHdLztAtYg= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108922] fmod() 13x slowdown in gcc4.9 dropping "fprem" and calling fmod() Date: Mon, 27 Feb 2023 08:17:06 +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: 12.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: WAITING 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=3D108922 --- Comment #15 from Alexander Monakov --- That is the fancy-error-handling path that is reached under _LIB_VERSION != =3D _IEEE_. Before glibc-2.27, linking with -lieee would set _LIB_VERSION =3D _= IEEE_, and then glibc would use the fprem[1] instruction without any special-casin= g. musl libc does not implement errno setting for math functions, and always u= ses fprem directly; likewise for Apple libm: https://github.com/apple-oss-distributions/Libm/blob/17a5f9daa3f5679f7536b2= 6f133b40cc078753c3/Source/Intel/fmod.s=