Browse Source

Allow selection of single-number vs. dual-number mode in Makefile.

Mike Pall 14 years ago
parent
commit
fa9ade356b
2 changed files with 10 additions and 0 deletions
  1. 6 0
      src/Makefile
  2. 4 0
      src/lj_arch.h

+ 6 - 0
src/Makefile

@@ -118,6 +118,12 @@ XCFLAGS=
 # interpreter. Don't bother if your OS wouldn't run on them, anyway.
 #XCFLAGS+= -DLUAJIT_CPU_NOCMOV
 #
+# Some architectures (e.g. PPC) can use either single-number (1) or
+# dual-number (2) mode. Uncomment one of these lines to override the
+# default mode. Please see LJ_ARCH_NUMMODE in lj_arch.h for details.
+#XCFLAGS+= -DLUAJIT_NUMMODE=1
+#XCFLAGS+= -DLUAJIT_NUMMODE=2
+#
 ##############################################################################
 
 ##############################################################################

+ 4 - 0
src/lj_arch.h

@@ -235,6 +235,10 @@
 #endif
 
 /* Enable or disable the dual-number mode for the VM. */
+#if (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE && LUAJIT_NUMMODE == 2) || \
+    (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL && LUAJIT_NUMMODE == 1)
+#error "No support for this number mode on this architecture"
+#endif
 #if LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL || \
     (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL_SINGLE && LUAJIT_NUMMODE != 1) || \
     (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE_DUAL && LUAJIT_NUMMODE == 2)