From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D86CD3858C2C; Tue, 7 Dec 2021 16:21:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D86CD3858C2C From: "pc at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103605] New: [PowerPC] fmin/fmax should be inlined always with xsmindp/xsmaxdp Date: Tue, 07 Dec 2021 16:21:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pc 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 07 Dec 2021 16:21:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103605 Bug ID: 103605 Summary: [PowerPC] fmin/fmax should be inlined always with xsmindp/xsmaxdp Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: pc at gcc dot gnu.org Target Milestone: --- -- $ gcc --version gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-2) [...] $ gcc -c -O2 fmin.c && objdump -dr fmin.o 0: 00 00 4c 3c addis r2,r12,0 0: R_PPC64_REL16_HA .TOC. 4: 00 00 42 38 addi r2,r2,0 4: R_PPC64_REL16_LO .TOC.+0x4 8: a6 02 08 7c mflr r0 c: 10 00 01 f8 std r0,16(r1) 10: e1 ff 21 f8 stdu r1,-32(r1) 14: 01 00 00 48 bl 14 14: R_PPC64_REL24 fmin 18: 00 00 00 60 nop 1c: 20 00 21 38 addi r1,r1,32 20: 10 00 01 e8 ld r0,16(r1) 24: a6 03 08 7c mtlr r0 28: 20 00 80 4e blr $ gcc -c -O2 fmin.c -ffast-math && objdump -dr fmin.o 0: 40 14 21 f0 xsmincdp vs1,vs1,vs2 4: 20 00 80 4e blr -- And it appears that a better instruction choice in the above case is xsmind= p, and it can be used with and without "-ffast-math", as it matches the semant= ics required of fmin. Similarly, xsmaxdp with fmax.=