From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0BD793857C44; Fri, 9 Jun 2023 06:40:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BD793857C44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686292856; bh=p71KFigukZ32ViJQztsnHPtlCM5dCJcUrgQiKq1Hp9s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e7tbSsAkvAqw4bmpgGKvk6s5q21A5rl/+vlQP7Ma4nstswKEhpBeGHyv1DS9LnHkg 5FhANBzDk16eoHL8w6FGqsoW/HChBHlprJuVQIbf/E5D9/uDBzkT6Y4XnShrv6A4bV nDv2v7LM5sPdjyo7hFxjt5swGRY6VKZ0sFMFz+5g= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110170] Sub-optimal conditional jumps in conditional-swap with floating point Date: Fri, 09 Jun 2023 06:40:55 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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=3D110170 --- Comment #6 from Hongtao.liu --- (In reply to Hongtao.liu from comment #5) > (In reply to Antony Polukhin from comment #2) > > -fno-trapping-math had no effect > >=20 > > Some tests with nans seem to produce the same results for both code > > snippets: https://godbolt.org/z/GaKM3EhMq >=20 > What about infinity, I notice > With -ffinite-math-only -funsafe-math-optimizations, gcc now can generate= =20 >=20 > __cond_swap(double*, double*): > movsd (%rdi), %xmm0 > movsd (%rsi), %xmm1 > movapd %xmm0, %xmm2 > minsd %xmm1, %xmm0 > maxsd %xmm1, %xmm2 > movsd %xmm2, (%rsi) > movsd %xmm0, (%rdi) > ret Assume -funsafe-math-optimizations is not needed?=