[RESEND] [PATCH] PPC64: First in the series of patches implementing POWER8 vector math.
GT
tnggil@protonmail.com
Wed Feb 27 15:32:00 GMT 2019
Notable differences from the previous patch and further commentary:
1. Renamed the main C source file from vec_d_cos2_power8.c to
vec_d_cos2_vsx.c. VSX functionality is also available on POWER7 and
POWER9, hence the change.
2. Removed vec_d_cos2_core.c and vec_d_cos2_vmx.c. The former did
ifunc selection between the latter and the main C implementation.
File vec_d_cos2_vmx.c was not a true Altivec implementation. It was
only a wrapper to the scalar cosine funtion.
3. A new file, vec_finite_alias.c is a workaround until the vector
log function is implemented. It is needed so that libmvec_nonshared.a
is built. Without it, compiling against the newly-built glibc will
fail due to its being missing.
4. __PPC64__ is the macro tested in math-vector.h. Table 5.1 of
the POWER ELFv2 ABI defines it and __powerpc64__ as synonyms.
The other macros in that file are all-uppercase and the choice
made preserves consistency.
5. GCC has no vectorizing support for PPC64. The openmp pragmas
are ignored and only scalar cosine calls generated. Exactly as when
libmvec doesn't exist.
6. The executables created to test against new glibc installation
required a workaround. x86_64 also did when I tried to compile the
same test. The test is a modification of Example #1 at
<https://sourceware.org/glibc/wiki/libmvec>. The only change initially
is a replacement of the call to cos () with one to the vector version
_ZGVbN2v_cos (). Compilation fails due to function without a
prototype. The solution for both PPC64 and x86_64 was to supply a
'extern <return type> _ZGVbN2v_cos (<in arg. type>)' forward
declaration. Then compilation created an executable that used
the new vector cosine.
7. This patch is half of the requirement for BZ #24205. The other is
implementing vector single-precision cosine. There are two outstanding
issues which I ask to be pushed into the patch for cosf. Gracefully
terminating configure if the GCC used does not provide the VSX builtins
required to build libmvec. And runtime avoidance of tests of the vector
functions on machines without VSX hardware.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PPC64-First-in-the-series-of-patches-implementing-PO.patch
Type: text/x-patch
Size: 19082 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20190227/eb86ce81/attachment.bin>
More information about the Libc-alpha
mailing list