On Mon, Mar 11, 2019 at 11:39 PM Steve Ellcey <sell...@marvell.com> wrote: > > This is a proposed GCC patch that allows targets to modify the names of > the libmvec routines that get called. Currently, if you build ToT GCC > on Aarch64 and include this glibc patch: > > https://sourceware.org/ml/libc-alpha/2019-03/msg00106.html > > And then compile a call to expf which gets vectorized, GCC will > generate a libmvec call to '_ZGVnN4v___expf_finite' instead of > _ZGVnN4v_expf because the limvec name is based on the assembly name > of the scalar function (__expf_finite) and not the 'real' name (expf). > This means that libmvec needs to provide both names, even though the > routines don't differ. > > Rather than create both names I would like to make it possible for > GCC to generate calls to libmvec based on the real name by having > a target specific function that allows GCC to use the DECL_NAME instead > of DECL_ASSEMBLER_NAME to create the libmvec name. > > The responses to my glibc patch (referenced above) has a pointer > to where this was discussed in the GCC mailing list a couple of years > ago: > > https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html > > and which has a pointer back to an older glibc string as well: > > https://sourceware.org/ml/libc-alpha/2015-06/msg00213.html > > Any thoughts on this patch as a way of 'fixing' GCC to not use the > finite alias names?
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? Richard. > Steve Ellcey > sell...@marvell.com > > > 2018-03-11 Steve Ellcey <sell...@marvell.com> > > * config/aarch64/aarch64.c (aarch64_simd_clone_vec_base_name): > New function. > (TARGET_SIMD_CLONE_VEC_BASE_NAME): New macro. > * doc/tm.texi.in (TARGET_SIMD_CLONE_VEC_BASE_NAME): New hook. > * doc/tm.texi: Regenerate. > * omp-simd-clone.c (simd_clone_mangle): Call vec_base_name hook. > * target.def (vec_base_name): New hook. > * targhooks.c (cgraph.h): New include. > (default_vec_base_name): New function. > * targhooks.h (default_vec_base_name): New function declaration. >