Skip to content

riscv popcount lowering shouldn't call __muldi3/__mulsi3 #86205

@efriedma-quic

Description

@efriedma-quic

Consider:

int a(unsigned x) { return __builtin_popcount(x); }

With -march=rv32i, this generates a call to __mulsi3. This is likely to be slow; if we don't have "m", we should use shifts instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions