From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9129B3857009; Fri, 28 Aug 2020 12:20:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9129B3857009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598617224; bh=e2z0Ahd7PNh1L/qW65qF/NiKFfFY/5dOelWQ1g6voF8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M9H+rOGJMYe0VX9ev5JCfEwoIg9mKrh8MDw7mWNRicNVE4fjwlx3HZilSqXMppNIw yVjRIkKUJyS9fjrt/hVmY4Xoh+GCGn0dJpSfEJ8/Z4cQLoUi8KnS8fg7q8MicroEOJ Z5Qt1NZOoPUOQuIKfmt/6yd7EmwIr7wKcbWlOwlc= From: "glisse at gcc dot gnu.org" 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 12:20:24 +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: glisse at gcc dot gnu.org 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 12:20:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96793 --- Comment #14 from Marc Glisse --- (In reply to Marc Glisse from comment #13) > if (HONOR_SIGNED_ZEROS (mode)) > x2 =3D copysign (x2, x); Hmm, I misread the comment, sorry. We already do that, for both floor and c= eil. But we don't use a true copysign, we use ix86_sse_copysign_to_positive which won't be able to change the sign from - to +. Just changing it to a true copysign (one extra and or andn) should be enough then?=