llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[RISC-V][SiFive] `sifive_vector.h` doesn't work in C++?

Open michalt opened this issue 1 year ago • 2 comments

The same code for C works just fine: https://godbolt.org/z/T3WboYvT3 but fails for C++: https://godbolt.org/z/aKP38aTqd

#include <sifive_vector.h>

#define p27_26 (0b11)
#define p11_7  (0b11111)

void test_sf_vc_xv_se_u64m1(vuint64m1_t vs2, uint64_t rs1, size_t vl) {
  __riscv_sf_vc_xv_se_u64m1(p27_26, p11_7, vs2, rs1, vl);
}

C++ failure:

<source>:7:3: error: use of undeclared identifier '__riscv_sf_vc_xv_se_u64m1'
    7 |   __riscv_sf_vc_xv_se_u64m1(p27_26, p11_7, vs2, rs1, vl);
      |   ^
1 error generated.
Compiler returned: 1

(both compiled with -march=rv64gcv_xsfvcp)

Am I doing something wrong? Any advice would be welcome! :)

michalt avatar Jun 28 '23 06:06 michalt

@4vtomat @topperc @kito-cheng Perhaps you have some suggestions since you worked on https://reviews.llvm.org/D148223

michalt avatar Jun 28 '23 06:06 michalt

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

llvmbot avatar Jun 28 '23 14:06 llvmbot

cc: @eopXD

topperc avatar Jun 29 '23 05:06 topperc

Resolving this issue in https://reviews.llvm.org/D154050

eopXD avatar Jun 29 '23 08:06 eopXD

Awesome, thank you! 😄

michalt avatar Jun 29 '23 09:06 michalt

Patch has landed, closing the issue.

eopXD avatar Jun 29 '23 13:06 eopXD

@llvm/issue-subscribers-clang-frontend

llvmbot avatar Jun 29 '23 13:06 llvmbot