On Tue, Mar 12, 2019 at 09:33:40AM +0100, Jakub Jelinek wrote:
> On Tue, Mar 12, 2019 at 09:25:35AM +0100, Richard Biener wrote:
> > I think this needs to be fixed on the glibc side - if glibc advertises
> > 
> > float expf (float, float)
> > __attribute__((simd(notinbranch),alias("__expf_finite"))
> > 
> > or so then you of course have to provide an implementation that matches 
> > this.
> > 
> > It shouldn't be difficult to provide an alias from the glibc side, no?  How 
> > does
> > x86 avoid this issue?
> 
> Yeah, the patch looks just wrong, it is completely intentional that we use
> DECL_ASSEMBLER_NAME, it is part of the OpenMP ABI, e.g. for C++ we really
> need to use the C++ mangled names there, can't use foo or __ct instead of
> say _Z3fooii or _ZN1AC2Ev as the base parts of the names.
> 
> Please have a look at how this works on x86_64 on the glibc side and do the
> aarch64 glibc patch similarly.

Trying:
#include <math.h>

double a[1024];

void
foo (void)
{
  for (int i = 0; i < 1024; i++)
    a[i] = exp (a[i]);
}

void
bar (void)
{
  for (int i = 0; i < 1024; i++)
    a[i] = sin (a[i]);
}

int
main ()
{
  return 0;
}

on x86_64 with -Ofast -lmvec this works for sin, but doesn't link for exp.
You've hit a glibc bug then, this needs to be fixed on the glibc side,
probably by adding aliases.

        Jakub

Reply via email to