about summary refs log tree commit diff stats
path: root/src/os/hostext_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/hostext_linux.c')
-rw-r--r--src/os/hostext_linux.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/os/hostext_linux.c b/src/os/hostext_linux.c
index c202a33f..531f7b85 100644
--- a/src/os/hostext_linux.c
+++ b/src/os/hostext_linux.c
@@ -185,7 +185,7 @@ int DetectHostCpuFeatures(void)
     #endif
 #elif defined(LA64)
     char* p = GetEnv("BOX64_DYNAREC_LA64NOEXT");
-    if(p == NULL || p[0] == '0') {
+    if (p == NULL || p[0] != '1') {
         uint32_t cpucfg2 = 0, idx = 2;
         asm volatile("cpucfg %0, %1" : "=r"(cpucfg2) : "r"(idx));
         if (((cpucfg2 >> 6) & 0b11) != 3) return 0; // LSX/LASX must present
@@ -195,6 +195,17 @@ int DetectHostCpuFeatures(void)
         cpuext.lam_bh = (cpucfg2 >> 27) & 0b1;
         cpuext.lamcas = (cpucfg2 >> 28) & 0b1;
         cpuext.scq = (cpucfg2 >> 30) & 0b1;
+        if (p) {
+            p = strtok(p, ",");
+            while (p) {
+                if (!strcasecmp(p, "lbt")) cpuext.lbt = 0;
+                if (!strcasecmp(p, "frecipe")) cpuext.frecipe = 0;
+                if (!strcasecmp(p, "lam_bh")) cpuext.lam_bh = 0;
+                if (!strcasecmp(p, "lamcas")) cpuext.lamcas = 0;
+                if (!strcasecmp(p, "scq")) cpuext.scq = 0;
+                p = strtok(NULL, ",");
+            }
+        }
     }
 #elif defined(RV64)
     // private env. variable for the developer ;)