From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E7F843858C00; Wed, 18 Jan 2023 20:10:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7F843858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674072647; bh=xDjwoJNZ9Yz3MBmym5kcfd7HKvU1zVNWjDeFph9MxYE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=X0tVJtMkFJdCA+LMHvbCEDSin5hJvDpj0hfZpZLvpir4qKtaLl2uTW2QofY/+Lrx0 Z1X1/kqKTpOW2n1XyHkJOwhdNywQJ+W9CYmsf9NUEKQ9Vzsx9eycJyCRAd971rgP99 xz1zkeE8L99iRyNm5z5Ivjl74XWDPz0gvpJnv130= From: "wilco at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/108279] Improved speed for float128 routines Date: Wed, 18 Jan 2023 20:10:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: wilco 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=3D108279 --- Comment #21 from Wilco --- (In reply to Jakub Jelinek from comment #20) > __attribute__((noinline, optimize ("rounding-math"))) static int > round_to_nearest (void) { return 1.0f - __FLT_MIN__ =3D=3D 1.0f + __FLT_M= IN__; } Wouldn't that always set inexact? > and > if (round_to_nearest ()) \ > _fcw =3D FP_RND_NEAREST; \ > else \ > __asm__ __volatile__ ("%vstmxcsr\t%0" : "=3Dm" (_fcw)); \ >=20 > Except that from _fcw we don't determine just the rounding mode but also > what exceptions are enabled. Yes that wouldn't work in fenv but FP emulation functions don't need to read the exception flags.=