Skip to content

[RISC-V] attribute target arch=+zvfh doesn't add builtins #94306

@antonblanchard

Description

@antonblanchard

This fails when building with -march=rv64gc:

#include <riscv_vector.h>

__attribute__((target("arch=+v,+zvfh")))
void testcase(_Float16 *src, _Float16 *dst, int len)
{
        size_t nr = __riscv_vsetvl_e16m2(len);
        vfloat16m2_t a = __riscv_vle16_v_f16m2(src, nr);
        __riscv_vse16_v_f16m2(dst, a, nr);
}

with:

testcase.c:7:19: error: call to undeclared function '__riscv_vle16_v_f16m2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

It works with -march=rv64gcv_zvfh

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:RISC-Vclang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions