libmvec in gcc to have vector math in fortran

Richard Biener
Fri Jun 15 08:41:00 GMT 2018

On Fri, Jun 15, 2018 at 9:59 AM Florian Weimer <> wrote:
> * Richard Biener:
> > 'pure' makes it pure but there doesn't seem to be a way to make it const?
> Does Fortran support setting the rounding mode?
> In C, sin is not const because it depends on the current rounding
> mode.

It is (well, the GCC builtin) by default because -fno-rounding-math
is default.  Note that using "reads global memory" (aka pure and not
const) is a bit of a stretch for "accesses the FP state" ;)  It's basically
a workaround for the fact that GCC doesn't "implement" FENV access.

That said, good to see some glibc folks jump in on this thread.
I'd like to see glibc provide a fortran intrinsic header advertising
the libmvec routines it has.  We probably do need some gfortran
adjustments here but I think that glibc advertising is better than
hard-coding lists into GCC (like we do for some targets with
their -mveclibabi= option).


More information about the Gcc mailing list