https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115325

            Bug ID: 115325
           Summary: RVV vmulh and vmulhu unknown without -march, but vmul
                    is known
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jan.wassenberg at gmail dot com
  Target Milestone: ---

To allow runtime dispatch (detecting at runtime whether V is available), we
would like to compile without -march=.

In GCC 13 for RVV this raised an #error. Looks like there has been progress in
GCC 14, no more #error in riscv_vector.h, but there is a strange difference
between vmulh and vmulh. Repro: https://gcc.godbolt.org/z/9PjEajq7r

When compiling without -march, vmul is at least known, though we get 
"return type 'vint64m1_t' requires the V ISA extension". We are almost but not
entirely able to get rid of this by using vectors only within the function:
https://gcc.godbolt.org/z/W74j7nzvs
(This is also blocking runtime dispatch.)

When compiling without -march, the situation worsens: changing vmul to vmulh
results in "error: '__riscv_vmulh_vv_i64m1' was not declared in this scope; did
you mean '__riscv_vmul_vv_i64m1'?".

Reply via email to