About
This covers multiple efforts.
- Scalar inline expansion of various mem* and str* routines in GCC. Essentially when some of the arguments are known the compiler can emit efficient versions of those routines while at the same time exposing the semantics to the optimizers allowing further optimization. The scalar inline expansion work in GCC is largely complete at this point. This work was largely done by VRULL under contract to Ventana.
- Vector inline expansion. Similar to scalar expansion, but using vector instructions when possible. The bulk of this work has already been integrated for gcc-14 and is the combination of work from Ventana (Robin Dapp) and EMBECOSM (Joern Rennecke).
- Additional vector inline expansion. memmove, memset and memcmp can also be expanded inline by the compiler using vector instructions. Sergei from Rivos has submitted an implementation of these routines, but the submission missed the gcc-14 deadline. The implementation looks pretty reasonable and is expected to integrate into GCC in the late spring. It is expected this work will provide another percent or so improvement on the GCC workload within spec2017.
- Glibc provides generic versions of all the relevant routines and needs both scalar and vector implementations with automatic selection via ifuncs.
- VRULL has reasonable scalar implementations of several functions
- Rivos has reasonable vector implementations of several functions as well
- There is a general agreement that dynamic ifunc selection for RISC-V can be integrated after the glibc-2.39 release (due the first week of Feb). So in the near these routines should be integrated into glibc with dynamic selection
Stakeholders/Partners
RISE:
Ventana: Jeff & Robin
Rivos: Palmer & Sergei
External:
VRULL: Christoph Muller
EMBECOSM: Joern Rennecke
Dependencies
Status
Updates
- Added some additional text for the cases covered by this change as well as some performance expectations.
- Jeff L has done some review work on Sergei's work and is planning to incorporate that work into his upstream GCC tester ASAP.
- Robin Dapp from Ventana has submitted & integrated vector versions of str[n]cmp, strlen
- Christoph has submitted and integrated scalar versions of str[n]cmp, strlen, memcpy
- Sergei Lewis has submitted vector version of memset, memmove and memcmp.
- Joern has submitted Embecosm's work to inline vectorized memcpy.
- Project reported as a priority for 1H2024.
- Christoph has submitted VRULL's work for str(n)cmp inline expansion and it has been integrated upstream