[PATCH][RFC]Overloading intrinsics
Richard Biener
richard.guenther@gmail.com
Mon Nov 12 14:51:00 GMT 2018
On Mon, Nov 12, 2018 at 9:48 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 11/10/18 9:46 PM, Bernhard Reutner-Fischer wrote:
> > On 10 November 2018 10:36:06 CET, "Martin Liška" <mliska@suse.cz> wrote:
> >
> >>>> !GCC$ builtin sinf attributes omp_simd_notinbranch
>
> Hello.
>
> >
> > I would expect "attribute" singular, like in C.
>
> Plural form is more aligned with e.g. '!GCC$ attributes NO_ARG_CHECK :: buf' ?
>
> >
> > I'm not opposed to your approach, but did we consider using -include glibc-simd-math.h via spec if lets say -O3 or -mveclibabi=glibc ?
>
> Richi?
Using specs was the original idea.
You need to add -include support to the Fortran FE for that, of
course. And you need to
add a default spec fragment somewhere given we want to include the
glibc variant by
default for glibc targets. And you need to allow the file to be not
present (easy to check
with the target hook...), either by making -include not error for not
existing ones or
by making spec processing add -include X only when X exists [in the
finclude path].
So in the end the target hook way seemed easier...
Yes, if we want to support -mveclibabi=foobar and then automatically include
foobar-vec.h if present that looks like specs processing is a better
fit for the job.
But I'm not sure if we should optimize for that scenario.
Richard.
> >
> > + /* Make a guard to prevent recursive inclusion. */
> > + static bool preinclude_done = false;
> > + const char *preinc = targetcm.c_preinclude ();
> >
> > Hm. Why don't you call the target hook only if !preinclude_done?
>
> Because otherwise I would see following error:
> math-vector-fortran.h:1: Error: File 'math-vector-fortran.h' is being included recursively
>
> Thanks,
> Martin
>
> >
> > + if (!preinclude_done && preinc != NULL)
> > + {
> > + preinclude_done = true;
> > + if (!load_file (preinc, NULL, false))
> > + exit (FATAL_EXIT_CODE);
> > + }
> > +
> >
> > thanks,
> >
>
More information about the Fortran
mailing list