about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2024-06-27 14:43:49 +0800
committerGitHub <noreply@github.com>2024-06-27 08:43:49 +0200
commit52c97c47ab397a37c8fc23c5cb20ad687b2fe11f (patch)
tree79fdf92b0b344c6d26257d02a7916cf684d6b6ee /src
parent5f06d066e7d768ffb7d14a989b282822b76e4b8b (diff)
downloadbox64-52c97c47ab397a37c8fc23c5cb20ad687b2fe11f.tar.gz
box64-52c97c47ab397a37c8fc23c5cb20ad687b2fe11f.zip
[RV64_DYNAREC] Detect vector extension (#1619)
Diffstat (limited to 'src')
-rw-r--r--src/core.c2
-rw-r--r--src/include/debug.h1
-rw-r--r--src/rv64detect.c5
3 files changed, 8 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 3149f0b6..fbd41ba4 100644
--- a/src/core.c
+++ b/src/core.c
@@ -108,6 +108,7 @@ int rv64_zba = 0;
 int rv64_zbb = 0;
 int rv64_zbc = 0;
 int rv64_zbs = 0;
+int rv64_vector = 0;
 int rv64_xtheadba = 0;
 int rv64_xtheadbb = 0;
 int rv64_xtheadbs = 0;
@@ -501,6 +502,7 @@ HWCAP2_AFP
     if(rv64_zbb) printf_log(LOG_INFO, " Zbb");
     if(rv64_zbc) printf_log(LOG_INFO, " Zbc");
     if(rv64_zbs) printf_log(LOG_INFO, " Zbs");
+    if(rv64_vector) printf_log(LOG_INFO, " Vector");
     if(rv64_xtheadba) printf_log(LOG_INFO, " XTheadBa");
     if(rv64_xtheadbb) printf_log(LOG_INFO, " XTheadBb");
     if(rv64_xtheadbs) printf_log(LOG_INFO, " XTheadBs");
diff --git a/src/include/debug.h b/src/include/debug.h
index f743a7e2..98f6281e 100644
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -54,6 +54,7 @@ extern int rv64_zba;
 extern int rv64_zbb;
 extern int rv64_zbc;
 extern int rv64_zbs;
+extern int rv64_vector;
 extern int rv64_xtheadba;
 extern int rv64_xtheadbb;
 extern int rv64_xtheadbs;
diff --git a/src/rv64detect.c b/src/rv64detect.c
index 9c7a37cf..698200cc 100644
--- a/src/rv64detect.c
+++ b/src/rv64detect.c
@@ -68,6 +68,11 @@ void RV64_Detect_Function()
     BR(xRA);
     rv64_zbs = Check(my_block);
 
+    // Test Vector v1.0 with CSRR zero, vcsr
+    CSRRS(xZR, xZR, 0x00f);
+    BR(xRA);
+    rv64_vector = Check(my_block);
+
     // THead vendor extensions
     if (!rv64_zba) {
         // Test XTheadBa with TH_ADDSL