From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 75E253857830; Fri, 15 Mar 2024 16:58:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75E253857830 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710521926; bh=FRjqu5Rv6PxaQFhW+x9fFQsSBypuJ0wQjs4b/FgE9uk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E3xT7LkCe30Qmiw1ZR7CYiGp0p6QSMlkMaOKgOuKTx73i0fT/byDycqYf1LJxxRcC 6fbrgftPLmpnfRLrwPdW1ubQiBx/HmxiHfxWNlZGj6zTMJHn/aeoM8Ngobjlh41vC1 4ZBUfNgyLLLaNDtN9W4GkPkZBrRMs0jn/llQmw4g= From: "jsm28 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114347] wrong constant folding when casting __bf16 to int Date: Fri, 15 Mar 2024 16:58:45 +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: 13.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jsm28 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=3D114347 --- Comment #4 from Joseph S. Myers --- I think it's correct that conversions (explicit or implicit) from a value w= ith excess precision convert only once; they don't first remove excess range and precision and then convert to the target type. This is not an assertion about whether we should implement __bf16 with exce= ss precision, though it probably makes sense to do so in general for formats f= or which processors don't provide direct arithmetic support.=