summaryrefslogtreecommitdiff
path: root/src/lj_arch.h
diff options
context:
space:
mode:
authorMike Pall <mike>2011-07-13 21:24:00 +0200
committerMike Pall <mike>2011-07-13 21:25:31 +0200
commit9687472454515f8d5c3aca587eb07375c2bd92a7 (patch)
treea281106054b48fdf5b0ee4425cac5262558333e5 /src/lj_arch.h
parenteb92daad0a3eb4a98d4803c76468ab2f179368be (diff)
downloadluajit-9687472454515f8d5c3aca587eb07375c2bd92a7.tar.gz
luajit-9687472454515f8d5c3aca587eb07375c2bd92a7.tar.bz2
luajit-9687472454515f8d5c3aca587eb07375c2bd92a7.zip
Cleanup single-number vs. dual-number mode selection.
Diffstat (limited to 'src/lj_arch.h')
-rw-r--r--src/lj_arch.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 17b766f8..03da79a6 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -95,6 +95,11 @@
95#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) 95#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS)
96#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX 96#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX
97 97
98#define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */
99#define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */
100#define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */
101#define LJ_NUMMODE_DUAL_SINGLE 3 /* Default to dual-number mode. */
102
98/* Set target architecture properties. */ 103/* Set target architecture properties. */
99#if LUAJIT_TARGET == LUAJIT_ARCH_X86 104#if LUAJIT_TARGET == LUAJIT_ARCH_X86
100 105
@@ -108,7 +113,7 @@
108#define LJ_TARGET_EHRETREG 0 113#define LJ_TARGET_EHRETREG 0
109#define LJ_TARGET_MASKSHIFT 1 114#define LJ_TARGET_MASKSHIFT 1
110#define LJ_TARGET_MASKROT 1 115#define LJ_TARGET_MASKROT 1
111#define LJ_ARCH_DUALNUM 1 116#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL
112 117
113#elif LUAJIT_TARGET == LUAJIT_ARCH_X64 118#elif LUAJIT_TARGET == LUAJIT_ARCH_X64
114 119
@@ -123,7 +128,7 @@
123#define LJ_TARGET_JUMPRANGE 31 /* +-2^31 = +-2GB */ 128#define LJ_TARGET_JUMPRANGE 31 /* +-2^31 = +-2GB */
124#define LJ_TARGET_MASKSHIFT 1 129#define LJ_TARGET_MASKSHIFT 1
125#define LJ_TARGET_MASKROT 1 130#define LJ_TARGET_MASKROT 1
126#define LJ_ARCH_DUALNUM 1 131#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL
127 132
128#elif LUAJIT_TARGET == LUAJIT_ARCH_ARM 133#elif LUAJIT_TARGET == LUAJIT_ARCH_ARM
129 134
@@ -139,7 +144,7 @@
139#define LJ_TARGET_MASKSHIFT 0 144#define LJ_TARGET_MASKSHIFT 0
140#define LJ_TARGET_MASKROT 1 145#define LJ_TARGET_MASKROT 1
141#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ 146#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
142#define LJ_ARCH_DUALNUM 2 147#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL
143#if LJ_TARGET_OSX 148#if LJ_TARGET_OSX
144/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */ 149/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
145#define LJ_ARCH_NOJIT 1 150#define LJ_ARCH_NOJIT 1
@@ -157,7 +162,7 @@
157#define LJ_TARGET_MASKSHIFT 0 162#define LJ_TARGET_MASKSHIFT 0
158#define LJ_TARGET_MASKROT 1 163#define LJ_TARGET_MASKROT 1
159#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */ 164#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */
160#define LJ_ARCH_DUALNUM 1 165#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE /* NYI: dual-num. */
161#define LJ_ARCH_NOFFI 1 /* NYI: comparisons, calls. */ 166#define LJ_ARCH_NOFFI 1 /* NYI: comparisons, calls. */
162#define LJ_ARCH_NOJIT 1 167#define LJ_ARCH_NOJIT 1
163 168
@@ -177,7 +182,7 @@
177#define LJ_TARGET_MASKSHIFT 0 182#define LJ_TARGET_MASKSHIFT 0
178#define LJ_TARGET_MASKROT 1 183#define LJ_TARGET_MASKROT 1
179#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */ 184#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */
180#define LJ_ARCH_DUALNUM 0 185#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE
181#define LJ_ARCH_NOFFI 1 /* NYI: comparisons, calls. */ 186#define LJ_ARCH_NOFFI 1 /* NYI: comparisons, calls. */
182#define LJ_ARCH_NOJIT 1 187#define LJ_ARCH_NOJIT 1
183 188
@@ -232,9 +237,10 @@
232#endif 237#endif
233#endif 238#endif
234 239
235/* Enable or disable the dual-number VM. */ 240/* Enable or disable the dual-number mode for the VM. */
236#if LJ_ARCH_DUALNUM == 2 || \ 241#if LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL || \
237 (defined(LUAJIT_ENABLE_DUALNUM) && LJ_ARCH_DUALNUM == 1) 242 (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL_SINGLE && LUAJIT_NUMMODE != 1) || \
243 (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE_DUAL && LUAJIT_NUMMODE == 2)
238#define LJ_DUALNUM 1 244#define LJ_DUALNUM 1
239#else 245#else
240#define LJ_DUALNUM 0 246#define LJ_DUALNUM 0