https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117576
Bug ID: 117576 Summary: -mveclibabi=aocl: Support vectorized array functions and maybe also sincos Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: pheeck at gcc dot gnu.org CC: burnus at gcc dot gnu.org, hubicka at gcc dot gnu.org, jamborm at gcc dot gnu.org, rguenth at gcc dot gnu.org Target Milestone: --- Target: x86_64-*-* GCC currently supports emitting calls to vectorized math functions from the AMD AOCL LibM library (this is enabled by specifying the -mveclibabi=aocl cmdline option). However, GCC doesn't support all available functions. >From commit message of r15-5204-g99ec0eb32a0350: > Compared to the list of functions in AOCL LibM docs I left out these > vectorized function families: > > - sincos and all functions working with arrays ... Because these > functions have pointer arguments and that would require a bigger > rework of ix86_veclibabi_aocl(). Also, I'm not sure if GCC even ever > generates calls to these functions. > - linearfrac ... Because these functions are specific to the AMD > library. There's no equivalent glibc function nor GCC internal > function nor GCC built-in. > - powx, sqrt, fabs ... Because GCC doesn't vectorize these functions > into calls and uses instructions instead. It could be interesting to add the missing support for emmiting calls to the array functions. There is a short remark on this by Richi in pr56504 and a short remark by Honza in https://gcc.gnu.org/pipermail/gcc-patches/2024-November/668603.html. It could also be interesting to add support for calls to vectorized sincos. Honza also comments on this in the linked mail. --- Misc notes: --- The array functions differ from other vectorized functions by having pointers to arrays of scalar types as parameters instead of having vector types as parameters. See an example here: https://github.com/amd/aocl-libm-ose/blob/master/src/optimized/vec/vrda_sin.c Extensive list of AMD vectorized math functions can be found here: https://docs.amd.com/r/en-US/57404-AOCL-user-guide/AOCL-LibM?section=fast-scalar-and-vector-variants The library can be downloaded here (on this page, there is also a link to its source files): https://www.amd.com/en/developer/aocl/libm.html