-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
RISC-V Vector - undefined identifier __builtin_rvv_vsetvlimax
#12106
Comments
I don't known what would be the relevance of this to the project #4456 itself. But it would help in testing in real and simulated environments of this architecture. I use a low-cost device based on the T-Head/Alibaba model this CPU is known as D1 (Xuantie C906) and unfortunately does not have mainstream llvm support. |
More importantly, I don't believe that Zig has any way of exposing these operations (at least, not in their full generality), since its vectors are fixed-length. ARM SVE intrinsics have the same problem. This is subject to change as the language evolves, of course. For more discussion, see: #7702 Your best bet in the meantime is to try using inline ASM instead. |
Yes, it is! --- edit Another reference |
see: https://godbolt.org/z/6Yacqc1qn 0.11.0-dev.3386+99fe2a23c - ErrorIn file included from <source>:17:
/opt/compiler-explorer/zig-master/lib/include/riscv_vector.h:18:2: error: "Vector intrinsics require the vector extension."
#error "Vector intrinsics require the vector extension."
^
<source>:120:18: error: call to undeclared function 'vsetvlmax_e8m8'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
size_t vlmax = vsetvlmax_e8m8();
^
<source>:124:25: error: call to undeclared function 'vle8ff_v_i8m8'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
vint8m8_t vec_src = vle8ff_v_i8m8(src, &vl, vlmax);
^
<source>:124:15: error: initializing 'vint8m8_t' (aka '__rvv_int8m8_t') with an expression of incompatible type 'int'
vint8m8_t vec_src = vle8ff_v_i8m8(src, &vl, vlmax);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:126:33: error: call to undeclared function 'vmseq_vx_i8m8_b1'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
vbool1_t string_terminate = vmseq_vx_i8m8_b1(vec_src, 0, vl);
^
<source>:126:14: error: initializing 'vbool1_t' (aka '__rvv_bool1_t') with an expression of incompatible type 'int'
vbool1_t string_terminate = vmseq_vx_i8m8_b1(vec_src, 0, vl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:127:21: error: call to undeclared function 'vmsif_m_b1'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
vbool1_t mask = vmsif_m_b1(string_terminate, vl);
^
<source>:127:14: error: initializing 'vbool1_t' (aka '__rvv_bool1_t') with an expression of incompatible type 'int'
vbool1_t mask = vmsif_m_b1(string_terminate, vl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:129:5: error: call to undeclared function 'vse8_v_i8m8_m'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
vse8_v_i8m8_m(mask, dst, vec_src, vl);
^
<source>:134:21: error: call to undeclared function 'vfirst_m_b1'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
first_set_bit = vfirst_m_b1(string_terminate, vl);
^
<source>:139:9: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int main() {
^
void
1 warning and 10 errors generated.
Compiler returned: 1 |
To be clear, is there still a bug here, or should this be closed? |
The original issue that translate-c is not seeing the |
Zig Version
0.10.0-dev.2981+7090f0471
Steps to Reproduce
I am trying to do some tests with the zig language using riscv vectorization, however both stage1 and stage2 are not supported.
Then while using the c-code to perform these tests, but an error occurred!
References
RISC-V Vector Extension Intrinsic Document
RISC-V Vector extension Spec
Expected Behavior
Works
Actual Behavior
Fail
The text was updated successfully, but these errors were encountered: