From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 28EA738582AA; Thu, 7 Mar 2024 15:50:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28EA738582AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709826635; bh=OX4Afip8B3maDFT6DSKo6Fmz+0sXQmwTlXCOzGV2yV8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kitJmqjm7Nky8z1HykdPosIyL1mfarfnmGm9OgIp95viZiXrrViBIz03ynysOwC2S KnkSdGznpEhsry6iG7M8/VNy/K7BuajjLuKAtjC3NZn51foI6mWOorsVrpV8bCcf6g 0soM7Ot7HLY7f6HjkJrBElnFz9Ausyv/mTZdGwBM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114270] Integer multiplication on floating point constant with conversion back to integer is not optimized Date: Thu, 07 Mar 2024 15:50:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: bug_severity 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=3D114270 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #1 from Andrew Pinski --- The rules for this to be done are a bit more complex than what is described here. 1) Significand precision of the floating point type needs to be >=3D precis= ion of the integer type 2) the 1/(multiplier) needs to be representable in the integer type 3) (I think this is required) no trapping math is enabled as inexact floati= ng point exception could happen 4) (maybe?) Significand only has the implicit 1 set. Note there might be more rules on needed for this to be done and I have not thought about all of them currently.=