We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
你好, 我为了测试gem5 (commit: 2909be3) 而去执行 rvv-intrinsic-doc/examples/rvv_strcpy.c 生成的执行档会得到fail的结果, 然而使用spike去模拟是可以得到pass的,可以请你们看看问题出在什么地方吗?
以下是我的command:
riscv64-unknown-elf-gcc -march=rv64gcv -o rvv_strcpy rvv_strcpy.c spike --isa=rv64gcv --varch=vlen:256,elen:64 pk rvv_strcpy gem5.opt se.py -c rvv_strcpy
rvv_strcpy.c:
#include "common.h" #include <assert.h> #include <riscv_vector.h> #include <string.h> // reference https://github.com/riscv/riscv-v-spec/blob/master/example/strcpy.s char *strcpy_vec(char *dst, const char *src) { char *save = dst; size_t vlmax = __riscv_vsetvlmax_e8m8(); long first_set_bit = -1; size_t vl; while (first_set_bit < 0) { vint8m8_t vec_src = __riscv_vle8ff_v_i8m8(src, &vl, vlmax); vbool1_t string_terminate = __riscv_vmseq_vx_i8m8_b1(vec_src, 0, vl); vbool1_t mask = __riscv_vmsif_m_b1(string_terminate, vl); __riscv_vse8_v_i8m8_m(mask, dst, vec_src, vl); src += vl; dst += vl; first_set_bit = __riscv_vfirst_m_b1(string_terminate, vl); } return save; } int main() { const int N = 2000; const uint32_t seed = 0xdeadbeef; srand(seed); // data gen char s0[N]; gen_string(s0, N); // compute char golden[N], actual[N]; strcpy(golden, s0); strcpy_vec(actual, s0); // compare puts(strcmp(golden, actual) == 0 ? "pass" : "fail"); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
你好,
我为了测试gem5 (commit: 2909be3) 而去执行 rvv-intrinsic-doc/examples/rvv_strcpy.c 生成的执行档会得到fail的结果,
然而使用spike去模拟是可以得到pass的,可以请你们看看问题出在什么地方吗?
以下是我的command:
rvv_strcpy.c:
The text was updated successfully, but these errors were encountered: