/
CT_00_038 - mem* and str* -- inline expansion in GLIBC implementation

CT_00_038 - mem* and str* -- inline expansion in GLIBC implementation

About

Glibc provides generic versions of all the relevant routines and needs both scalar and vector implementations with automatic selection via ifuncs.

    1. VRULL has reasonable scalar implementations of several functions
    2. Rivos and SiFive have reasonable vector implementations of several functions as well
    3. 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

Development

COMPLETE


Development Timeline1H2024
Upstreaming

IN PROGRESS


Upstream Version


glibc-2.41 (target)
Winter 2024




Contacts

Jeff Law (Ventana)


Dependencies

None



Updates

 

  • Vectorized memset accepted by glibc project, pending one trivial fix.
  • Should be able to stamp out the rest trivially now

 

  • Ventana has changes which wire up the vector str*/mem* routines from SiFive & Rivos as well as scalar versions of VRULL into ifunc/hwprobe framework
  • Tested on BPI & QEMU to verify we get into the appropriate routine based on the result of the hwprobe query
    • Did expose minor bugs in the VRULL scalar implementations which have since been fixed
  • Upstream doesn't want the str* scalar implementations in their current form
    • Rather than full raw assembly routines, use C versions with the magic twiddles to enable using orc.b and such
    • Not currently planning to implement this (focused on vector), but someone else certainly could

  • GLIBC effort broken out into a distinct 2H2024 work item

Related content