Sep 20 – 24, 2021
US/Pacific timezone

Puzzle for RISC-V ifunc

Sep 21, 2021, 10:00 AM
Microconference3/Virtual-Room (LPC Virtual)


LPC Virtual



Kito Cheng (SiFive) Palmer Dabbelt (Google)


ifunc is a widely used mechnish for specialized those performance
critical functions in glibc, like memcpy, strcmp and strlen.
It’s not used in upstream glibc for RISC-V yet, but with several new
extensions becoming ratified soon, users will desire to have
vector-optimized routines to boost their program.
It’s a generic infrastructure for GNU toolchain, so we don’t need too
much work to enable that in theory, but the real world isn’t so

Here is the list of the puzzle for the RISC-V ifunc, some is there and
some is missing:
- Relocation for ifunc.
- Mapping symbol.
- New asm directive to enable/disable any extension in specific code
region (like .option rvc/.option norvc, but more generic one.)
- New function target attribute for C/C++
- e.g. int sse3_func (void) attribute ((target ("sse3")));
- hwcap and hwcap2

Most items are toolchain stuff, but last item for hwcap, it should
coordinate between glibc and linux kernel to implement a new mechanism
to discover the machine capability.

I agree to abide by the anti-harassment policy I agree

Primary authors

Kito Cheng (SiFive) Palmer Dabbelt (Google)

Presentation materials

Diamond Sponsor

Platinum Sponsor

Gold Sponsors

Silver Sponsors

Speaker Gift Sponsor

T-Shirt Sponsor

Conference Services provided by