x86/x64: Clean up interpreter.

Use DynASM defines instead of C defines.
Remove support for ancient CPUs without CMOV (before Pentium Pro).
This commit is contained in:
Mike Pall 2012-06-10 16:44:33 +02:00
parent e496a502b0
commit 58ec704f78
3 changed files with 1076 additions and 1176 deletions

View File

@ -42,9 +42,8 @@ CCOPT= -O2 -fomit-frame-pointer
# #
# Target-specific compiler options: # Target-specific compiler options:
# #
# x86 only: it's recommended to compile at least for i686. By default the # x86 only: it's recommended to compile at least for i686. Better yet,
# assembler part of the interpreter makes use of CMOV/FCOMI*/FUCOMI* # compile for an architecture that has SSE2, too (-msse -msse2).
# instructions, anyway.
# #
# x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute # x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute
# the binaries to a different machine you could also use: -march=native # the binaries to a different machine you could also use: -march=native
@ -105,20 +104,6 @@ XCFLAGS=
# Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter. # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter.
#XCFLAGS+= -DLUAJIT_DISABLE_JIT #XCFLAGS+= -DLUAJIT_DISABLE_JIT
# #
# x86 only: use SSE2 instead of x87 instructions in the interpreter
# (always enabled for x64). A pure interpreter built with this flag won't
# run on older CPUs (before P4 or K8). There isn't much of a speed
# difference, so this is not enabled by default.
# The JIT compiler is not affected by this flag. It always uses runtime
# CPU feature detection before emitting code for SSE2 up to SSE4.1.
#XCFLAGS+= -DLUAJIT_CPU_SSE2
#
# x86 only: Disable the use of CMOV and FCOMI*/FUCOMI* instructions in the
# interpreter. Do this only if you intend to use REALLY ANCIENT CPUs
# (before Pentium Pro, or on the VIA C3). This generally slows down the
# 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 # Some architectures (e.g. PPC) can use either single-number (1) or
# dual-number (2) mode. Uncomment one of these lines to override the # 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. # default mode. Please see LJ_ARCH_NUMMODE in lj_arch.h for details.

View File

@ -29,15 +29,16 @@
if exist minilua.exe.manifest^ if exist minilua.exe.manifest^
%LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe
@set DASMFLAGS=-D X64 -D WIN @set DASMFLAGS=-D WIN -D JIT -D FFI
@set DASMX64=-D X64
@if defined CPU goto :XCPU @if defined CPU goto :XCPU
@set CPU=%PROCESSOR_ARCHITECTURE% @set CPU=%PROCESSOR_ARCHITECTURE%
:XCPU :XCPU
@if "%CPU%"=="AMD64" goto :X64 @if "%CPU%"=="AMD64" goto :X64
@if "%CPU%"=="X64" goto :X64 @if "%CPU%"=="X64" goto :X64
@set DASMFLAGS=-D WIN @set DASMX64=
:X64 :X64
minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc minilua %DASM% -LN %DASMFLAGS% %DASMX64% -o host\buildvm_arch.h vm_x86.dasc
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD
%LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c %LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c

File diff suppressed because it is too large Load Diff