public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* use of fma
@ 2021-04-28  7:23 Paul Zimmermann
  2021-04-28  8:25 ` Florian Weimer
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Zimmermann @ 2021-04-28  7:23 UTC (permalink / raw)
  To: libc-alpha

       Hi,

I noticed that on recent x86_64 with fma (fused-multiply-add) in hardware,
as claimed by /proc/cpuinfo, glibc does not use fma by default.

The reason seems to be that with the default flags (-O2 -g), gcc does not
define __FP_FAST_FMA:

tomate$ gcc -O2 -g -dM -E -xc /dev/null | grep -q __FP_FAST_FMA
tomate$ echo $?
1

but it is defined with -march=native:

tomate$ gcc -O2 -g -march=native -dM -E -xc /dev/null | grep -q __FP_FAST_FMA
tomate$ echo $?
0

However, on PowerPC __FP_FAST_FMA is defined without -march=native:

pzimmermann@drac-12:~$ gcc -O2 -g -dM -E -xc /dev/null | grep -q __FP_FAST_FMA
pzimmermann@drac-12:~$ echo $?
0

Would it make sense to add -march=native to CFLAGS, or to add an option
like --enable-fma to configure?

Paul






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

end of thread, other threads:[~2021-04-28 17:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28  7:23 use of fma Paul Zimmermann
2021-04-28  8:25 ` Florian Weimer
2021-04-28  8:42   ` Paul Zimmermann
2021-04-28  9:06     ` Florian Weimer
2021-04-28 17:29     ` Joseph Myers
2021-04-28 15:00   ` Tulio Magno Quites Machado Filho
2021-04-28 15:18     ` Paul Zimmermann
2021-04-28 15:45       ` Tulio Magno Quites Machado Filho
2021-04-28 17:46         ` Joseph Myers

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).