diff --git a/src/lj_arch.h b/src/lj_arch.h index c728742f..5e866fe4 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h @@ -107,6 +107,7 @@ #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_MASKSHIFT 1 #define LJ_TARGET_MASKROT 1 +#define LJ_ARCH_DUALNUM 1 #elif LUAJIT_TARGET == LUAJIT_ARCH_X64 @@ -120,6 +121,7 @@ #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_MASKSHIFT 1 #define LJ_TARGET_MASKROT 1 +#define LJ_ARCH_DUALNUM 1 #elif LUAJIT_TARGET == LUAJIT_ARCH_ARM @@ -134,6 +136,7 @@ #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_MASKSHIFT 0 #define LJ_TARGET_MASKROT 1 +#define LJ_ARCH_DUALNUM 2 #define LJ_ARCH_NOFFI 1 #define LJ_ARCH_NOJIT 1 @@ -154,6 +157,7 @@ #define LJ_TARGET_EHRETREG 3 #define LJ_TARGET_MASKSHIFT 0 #define LJ_TARGET_MASKROT 1 +#define LJ_ARCH_DUALNUM 0 #define LJ_ARCH_NOFFI 1 /* NYI: comparisons, calls. */ #define LJ_ARCH_NOJIT 1 @@ -207,6 +211,14 @@ #endif #endif +/* Enable or disable the dual-number VM. */ +#if LJ_ARCH_DUALNUM == 2 || \ + (defined(LUAJIT_ENABLE_DUALNUM) && LJ_ARCH_DUALNUM == 1) +#define LJ_DUALNUM 1 +#else +#define LJ_DUALNUM 0 +#endif + /* Disable or enable the JIT compiler. */ #if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) #define LJ_HASJIT 0