diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2025-03-25 15:59:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-25 08:59:34 +0100 |
| commit | a021fc200532a7cdd769f733a2f857616fbdb655 (patch) | |
| tree | 6ae8b22444118d44ae2744422c923ed29fe4f67f /src | |
| parent | 75e9aae2817664d8935fb6f6eeb206b9ecee7f9c (diff) | |
| download | box64-a021fc200532a7cdd769f733a2f857616fbdb655.tar.gz box64-a021fc200532a7cdd769f733a2f857616fbdb655.zip | |
[RV64_DYNAREC] Small optim to vsetvli usage (#2465)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dynarec/rv64/dynarec_rv64_helper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.c b/src/dynarec/rv64/dynarec_rv64_helper.c index 31b35811..25a1a469 100644 --- a/src/dynarec/rv64/dynarec_rv64_helper.c +++ b/src/dynarec/rv64/dynarec_rv64_helper.c @@ -2976,7 +2976,9 @@ int vector_vsetvli(dynarec_rv64_t* dyn, int ninst, int s1, int sew, int vlmul, f uint32_t vl = (int)((float)(16 >> sew) * multiple); uint32_t vtypei = (sew << (3 - !!rv64_xtheadvector)) | vlmul; if (dyn->inst_sew == VECTOR_SEWNA || dyn->inst_vl == 0 || dyn->inst_sew != sew || dyn->inst_vl != vl || dyn->inst_vlmul != vlmul) { - if (vl <= 31 && !rv64_xtheadvector) { + if (vl == (rv64_vlen >> (3 + sew - vlmul))) { + VSETVLI(s1, xZR, vtypei); + } else if (vl <= 31 && !rv64_xtheadvector) { VSETIVLI(xZR, vl, vtypei); } else { ADDI(s1, xZR, vl); |