public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103605] New: [PowerPC] fmin/fmax should be inlined always with xsmindp/xsmaxdp
@ 2021-12-07 16:21 pc at gcc dot gnu.org
  2021-12-07 16:21 ` [Bug target/103605] " pc at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pc at gcc dot gnu.org @ 2021-12-07 16:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103605

            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 <fm+0x14>
                        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 xsmindp,
and it can be used with and without "-ffast-math", as it matches the semantics
required of fmin.  Similarly, xsmaxdp with fmax.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-08-17  5:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 16:21 [Bug target/103605] New: [PowerPC] fmin/fmax should be inlined always with xsmindp/xsmaxdp pc at gcc dot gnu.org
2021-12-07 16:21 ` [Bug target/103605] " pc at gcc dot gnu.org
2022-04-26  9:27 ` guihaoc at gcc dot gnu.org
2022-04-26 18:35 ` pc at gcc dot gnu.org
2022-04-26 18:46 ` joseph at codesourcery dot com
2022-04-26 20:45 ` pc at gcc dot gnu.org
2022-04-27  5:32 ` guihaoc at gcc dot gnu.org
2022-04-28  3:22 ` linkw at gcc dot gnu.org
2022-05-10 12:21 ` segher at gcc dot gnu.org
2023-07-25  2:43 ` cvs-commit at gcc dot gnu.org
2023-08-17  5:26 ` guihaoc at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).