about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorxctan <xctan@cirno.icu>2024-11-25 02:32:39 +0800
committerGitHub <noreply@github.com>2024-11-24 19:32:39 +0100
commitab654220349a7f3a8e7e69d5f4bcec173aceb85b (patch)
tree6ee8559e868920686937a6a69ae842f6f688c49c /src
parent3bde222242709abe778702b48c054a774c24c64a (diff)
downloadbox64-ab654220349a7f3a8e7e69d5f4bcec173aceb85b.tar.gz
box64-ab654220349a7f3a8e7e69d5f4bcec173aceb85b.zip
[CORE] Enhanced BOX64_DYNAREC_RV64NOEXT (#2065)
Diffstat (limited to 'src')
-rw-r--r--src/core.c56
1 files changed, 24 insertions, 32 deletions
diff --git a/src/core.c b/src/core.c
index 346d386f..5060823f 100644
--- a/src/core.c
+++ b/src/core.c
@@ -534,39 +534,31 @@ HWCAP2_AFP
     void RV64_Detect_Function();
     // private env. variable for the developer ;)
     char *p = getenv("BOX64_DYNAREC_RV64NOEXT");
-    if(p == NULL || p[0] == '0')
+    if(p == NULL || strcasecmp(p, "1")) {
         RV64_Detect_Function();
-    if (p != NULL && !strcasecmp(p, "vector")) {
-        RV64_Detect_Function();
-        rv64_vector = 0;
-        rv64_xtheadvector = 0;
-    } else if (p != NULL && !strcasecmp(p, "zba")) {
-        RV64_Detect_Function();
-        rv64_zba = 0;
-    } else if (p != NULL && !strcasecmp(p, "zbb")) {
-        RV64_Detect_Function();
-        rv64_zbb = 0;
-    } else if (p != NULL && !strcasecmp(p, "zbc")) {
-        RV64_Detect_Function();
-        rv64_zbc = 0;
-    } else if (p != NULL && !strcasecmp(p, "zbs")) {
-        RV64_Detect_Function();
-        rv64_zbs = 0;
-    } else if (p != NULL && !strcasecmp(p, "xtheadba")) {
-        RV64_Detect_Function();
-        rv64_xtheadba = 0;
-    } else if (p != NULL && !strcasecmp(p, "xtheadbb")) {
-        RV64_Detect_Function();
-        rv64_xtheadbb = 0;
-    } else if (p != NULL && !strcasecmp(p, "xtheadbs")) {
-        RV64_Detect_Function();
-        rv64_xtheadbs = 0;
-    } else if (p != NULL && !strcasecmp(p, "xtheadmempair")) {
-        RV64_Detect_Function();
-        rv64_xtheadmempair = 0;
-    } else if (p != NULL && !strcasecmp(p, "xtheadcondmov")) {
-        RV64_Detect_Function();
-        rv64_xtheadcondmov = 0;
+        if (p) {
+            p = strtok(p, ",");
+            while (p) {
+                if (!strcasecmp(p, "zba")) rv64_zba = 0;
+                if (!strcasecmp(p, "zbb")) rv64_zbb = 0;
+                if (!strcasecmp(p, "zbc")) rv64_zbc = 0;
+                if (!strcasecmp(p, "zbs")) rv64_zbs = 0;
+                if (!strcasecmp(p, "vector")) {
+                    rv64_vector = 0;
+                    rv64_xtheadvector = 0;
+                }
+                if (!strcasecmp(p, "xtheadba")) rv64_xtheadba = 0;
+                if (!strcasecmp(p, "xtheadbb")) rv64_xtheadbb = 0;
+                if (!strcasecmp(p, "xtheadbs")) rv64_xtheadbs = 0;
+                // if (!strcasecmp(p, "xtheadmemidx")) rv64_xtheadmemidx = 0;
+                // if (!strcasecmp(p, "xtheadfmemidx")) rv64_xtheadfmemidx = 0;
+                // if (!strcasecmp(p, "xtheadmac")) rv64_xtheadmac = 0;
+                // if (!strcasecmp(p, "xtheadfmv")) rv64_xtheadfmv = 0;
+                if (!strcasecmp(p, "xtheadmempair")) rv64_xtheadmempair = 0;
+                if (!strcasecmp(p, "xtheadcondmov")) rv64_xtheadcondmov = 0;
+                p = strtok(NULL, ",");
+            }
+        }
     }
 
     printf_log(LOG_INFO, "Dynarec for RISC-V ");