Skip to content
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

__riscv_vmulh_vv_i64m1 doesn't work with __attribute__((target("arch=+v"))) #109694

Closed
dzaima opened this issue Sep 23, 2024 · 3 comments · Fixed by #112827
Closed

__riscv_vmulh_vv_i64m1 doesn't work with __attribute__((target("arch=+v"))) #109694

dzaima opened this issue Sep 23, 2024 · 3 comments · Fixed by #112827
Labels
backend:RISC-V clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@dzaima
Copy link

dzaima commented Sep 23, 2024

The code:

#include <riscv_vector.h>

__attribute__((target("arch=+v")))
vint64m1_t mulh_i64(vint64m1_t a, vint64m1_t b) {
  return __riscv_vmulh_vv_i64m1(a, b, 2);
}

does not compile with -march=rv64gc, giving the error:

<source>:5:10: error: builtin requires at least one of the following extensions: v
    5 |   return __riscv_vmulh_vv_i64m1(a, b, 2);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

even though +v is explicitly added. -march=rv64gcv works, and so does an equivalent 32-bit operation. https://godbolt.org/z/qYYzeoxGa

related (but listing different problems)

@topperc
Copy link
Collaborator

topperc commented Sep 23, 2024

CC @4vtomat @BeMg

@EugeneZelenko EugeneZelenko added backend:RISC-V clang:headers Headers provided by Clang, e.g. for intrinsics and removed new issue labels Sep 23, 2024
@llvmbot
Copy link

llvmbot commented Sep 23, 2024

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

Author: dzaima (dzaima)

The code:
#include &lt;riscv_vector.h&gt;

__attribute__((target("arch=+v")))
vint64m1_t mulh_i64(vint64m1_t a, vint64m1_t b) {
  return __riscv_vmulh_vv_i64m1(a, b, 2);
}

does not compile with -march=rv64gc, giving the error:

&lt;source&gt;:5:10: error: builtin requires at least one of the following extensions: v
    5 |   return __riscv_vmulh_vv_i64m1(a, b, 2);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

even though +v is explicitly added. -march=rv64gcv works, and so does an equivalent 32-bit operation. https://godbolt.org/z/qYYzeoxGa

related (but listing different problems)

tclin914 added a commit to tclin914/llvm-project that referenced this issue Oct 18, 2024
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed clang:headers Headers provided by Clang, e.g. for intrinsics labels Oct 18, 2024
@llvmbot
Copy link

llvmbot commented Oct 18, 2024

@llvm/issue-subscribers-clang-frontend

Author: dzaima (dzaima)

The code:
#include &lt;riscv_vector.h&gt;

__attribute__((target("arch=+v")))
vint64m1_t mulh_i64(vint64m1_t a, vint64m1_t b) {
  return __riscv_vmulh_vv_i64m1(a, b, 2);
}

does not compile with -march=rv64gc, giving the error:

&lt;source&gt;:5:10: error: builtin requires at least one of the following extensions: v
    5 |   return __riscv_vmulh_vv_i64m1(a, b, 2);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

even though +v is explicitly added. -march=rv64gcv works, and so does an equivalent 32-bit operation. https://godbolt.org/z/qYYzeoxGa

related (but listing different problems)

bricknerb pushed a commit to bricknerb/llvm-project that referenced this issue Oct 21, 2024
EricWF pushed a commit to efcs/llvm-project that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:RISC-V clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
4 participants