From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EB80385783D; Tue, 13 Apr 2021 06:24:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EB80385783D From: "luoxhu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97142] __builtin_fmod not optimized on POWER Date: Tue, 13 Apr 2021 06:24:51 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: luoxhu at gcc dot gnu.org X-Bugzilla-Status: NEW 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 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: Tue, 13 Apr 2021 06:24:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97142 --- Comment #10 from luoxhu at gcc dot gnu.org --- If not built with fast-math, gimple_has_side_effects will return true and c= ause the expand_call_stmt fail to expand the "_1 =3D fmod (x_2(D), y_3(D));" to internal function. X86 also produces "bl fmod" for O3 build. xlF expands the fmod to below ASM, no FMA generated? 0000000010000900 : 10000900: 8c 03 01 10 vspltisw v0,1 10000904: 00 00 24 c8 lfd f1,0(r4) 10000908: 00 00 03 c8 lfd f0,0(r3) 1000090c: e2 03 40 f0 xvcvsxwdp vs2,vs32 10000910: c0 09 62 f0 xsdivdp vs3,vs2,vs1 10000914: 80 19 80 f0 xsmuldp vs4,vs0,vs3 10000918: 64 21 a0 f0 xsrdpiz vs5,vs4 1000091c: 88 2d 01 f0 xsnmsubadp vs0,vs1,vs5 10000920: 18 00 20 fc frsp f1,f0 10000924: 20 00 80 4e blr=