Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
antonblanchard opened this issue Jun 4, 2024 · 4 comments
Closed

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

antonblanchard opened this issue Jun 4, 2024 · 4 comments
Labels
backend:RISC-V clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

Comments

@antonblanchard
Copy link
Contributor

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

@EugeneZelenko EugeneZelenko added backend:RISC-V clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' and removed new issue labels Jun 4, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2024

@llvm/issue-subscribers-backend-risc-v

Author: Anton Blanchard (antonblanchard)

This fails when building with `-march=rv64gc`:
#include &lt;riscv_vector.h&gt;

__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

@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2024

@llvm/issue-subscribers-clang-driver

Author: Anton Blanchard (antonblanchard)

This fails when building with `-march=rv64gc`:
#include &lt;riscv_vector.h&gt;

__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

@topperc
Copy link
Collaborator

topperc commented Jun 4, 2024

@4vtomat can you take a look?

tclin914 added a commit that referenced this issue Nov 11, 2024
This is a follow-up patch for
#101811.
That we can remove the type checking for fp16 from SemaRISCV.cpp.

Fixes: #101621 and
#94306
@tclin914
Copy link
Contributor

Fixed by : #115436

Groverkss pushed a commit to iree-org/llvm-project that referenced this issue Nov 15, 2024
This is a follow-up patch for
llvm#101811.
That we can remove the type checking for fp16 from SemaRISCV.cpp.

Fixes: llvm#101621 and
llvm#94306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:RISC-V clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Projects
None yet
Development

No branches or pull requests

5 participants