about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/core_arch.h50
-rw-r--r--src/include/debug.h38
2 files changed, 52 insertions, 36 deletions
diff --git a/src/include/core_arch.h b/src/include/core_arch.h
new file mode 100644
index 00000000..f297bcb8
--- /dev/null
+++ b/src/include/core_arch.h
@@ -0,0 +1,50 @@
+#ifndef __CORE_ARCH_H__
+#define __CORE_ARCH_H__
+#include <stdint.h>
+
+#ifdef DYNAREC
+typedef union cpu_ext_s {
+    struct {
+#ifdef ARM64
+ uint64_t atomics:1;    // it's important this is the 1st bit
+ uint64_t asimd:1;
+ uint64_t aes:1;
+ uint64_t pmull:1;
+ uint64_t crc32:1;
+ uint64_t sha1:1;
+ uint64_t sha2:1;
+ uint64_t uscat:1;
+ uint64_t flagm:1;
+ uint64_t flagm2:1;
+ uint64_t frintts:1;
+ uint64_t afp:1;
+ uint64_t rndr:1;
+#elif defined(RV64)
+uint64_t vlen:8;  // Not *8, 8bits should be enugh? that's 2048 vector
+ uint64_t zba:1;
+ uint64_t zbb:1;
+ uint64_t zbc:1;
+ uint64_t zbs:1;
+ uint64_t vector:1; // rvv 1.0 or xtheadvector
+ uint64_t xtheadvector:1;
+ uint64_t xtheadba:1;
+ uint64_t xtheadbb:1;
+ uint64_t xtheadbs:1;
+ uint64_t xtheadcondmov:1;
+ uint64_t xtheadmemidx:1;
+ uint64_t xtheadmempair:1;
+ uint64_t xtheadfmemidx:1;
+ uint64_t xtheadmac:1;
+ uint64_t xtheadfmv:1;
+#elif defined(LA64)
+ uint64_t lbt:1;    // it's important it's stay the 1st bit
+ uint64_t lam_bh:1;
+ uint64_t lamcas:1;
+ uint64_t scq:1;
+#endif
+    };
+    uint64_t x;
+} cpu_ext_t;
+#endif
+
+#endif //__CORE_ARCH_H__
\ No newline at end of file
diff --git a/src/include/debug.h b/src/include/debug.h
index abd94bf7..57520cbd 100644
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -4,6 +4,7 @@
 #include <env.h>
 
 #include "os.h"
+#include "core_arch.h"
 
 typedef struct box64context_s box64context_t;
 extern box64env_t box64env;
@@ -14,42 +15,7 @@ extern int box64_rdtsc;
 extern uint8_t box64_rdtsc_shift;
 extern int box64_is32bits;
 #ifdef DYNAREC
-#ifdef ARM64
-extern int arm64_asimd;
-extern int arm64_aes;
-extern int arm64_pmull;
-extern int arm64_crc32;
-extern int arm64_atomics;
-extern int arm64_sha1;
-extern int arm64_sha2;
-extern int arm64_uscat;
-extern int arm64_flagm;
-extern int arm64_flagm2;
-extern int arm64_frintts;
-extern int arm64_rndr;
-#elif defined(RV64)
-extern int rv64_zba;
-extern int rv64_zbb;
-extern int rv64_zbc;
-extern int rv64_zbs;
-extern int rv64_vector;
-extern int rv64_xtheadvector; // rvv 1.0 or xtheadvector
-extern int rv64_vlen;
-extern int rv64_xtheadba;
-extern int rv64_xtheadbb;
-extern int rv64_xtheadbs;
-extern int rv64_xtheadcondmov;
-extern int rv64_xtheadmemidx;
-extern int rv64_xtheadmempair;
-extern int rv64_xtheadfmemidx;
-extern int rv64_xtheadmac;
-extern int rv64_xtheadfmv;
-#elif defined(LA64)
-extern int la64_lbt;
-extern int la64_lam_bh;
-extern int la64_lamcas;
-extern int la64_scq;
-#endif
+extern cpu_ext_t cpuext;
 #endif
 #ifdef HAVE_TRACE
 extern uintptr_t trace_start, trace_end;