diff options
author | Mike Pall <mike> | 2012-06-10 16:41:00 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-06-10 16:41:00 +0200 |
commit | e496a502b0686af25053c161752c044074edc44e (patch) | |
tree | e0bfb4bfa40d3eb910ed04f4d66b641634b29a47 /src | |
parent | d5a915ccf58bff38f932de752771cd650809787e (diff) | |
download | luajit-e496a502b0686af25053c161752c044074edc44e.tar.gz luajit-e496a502b0686af25053c161752c044074edc44e.tar.bz2 luajit-e496a502b0686af25053c161752c044074edc44e.zip |
Pass various build, arch and OS flags to DynASM.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 45 | ||||
-rw-r--r-- | src/msvcbuild.bat | 4 | ||||
-rw-r--r-- | src/vm_x86.dasc | 7 |
3 files changed, 48 insertions, 8 deletions
diff --git a/src/Makefile b/src/Makefile index 3f733c59..d9bb178b 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -249,12 +249,12 @@ endif | |||
249 | endif | 249 | endif |
250 | endif | 250 | endif |
251 | 251 | ||
252 | ifneq (,$(findstring __CELLOS_LV2__ ,$(TARGET_TESTARCH))) | 252 | ifneq (,$(findstring LJ_TARGET_PS3 1,$(TARGET_TESTARCH))) |
253 | TARGET_SYS= PS3 | 253 | TARGET_SYS= PS3 |
254 | TARGET_ARCH+= -D__CELLOS_LV2__ | 254 | TARGET_ARCH+= -D__CELLOS_LV2__ |
255 | TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC | 255 | TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC |
256 | endif | 256 | endif |
257 | ifneq (,$(findstring LJ_NO_UNWIND ,$(TARGET_TESTARCH))) | 257 | ifneq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) |
258 | TARGET_ARCH+= -DLUAJIT_NO_UNWIND | 258 | TARGET_ARCH+= -DLUAJIT_NO_UNWIND |
259 | endif | 259 | endif |
260 | 260 | ||
@@ -377,13 +377,46 @@ DASM_XFLAGS= | |||
377 | DASM_AFLAGS= | 377 | DASM_AFLAGS= |
378 | DASM_ARCH= $(TARGET_LJARCH) | 378 | DASM_ARCH= $(TARGET_LJARCH) |
379 | 379 | ||
380 | ifneq (,$(findstring LJ_HASJIT 1,$(TARGET_TESTARCH))) | ||
381 | DASM_AFLAGS+= -D JIT | ||
382 | endif | ||
383 | ifneq (,$(findstring LJ_HASFFI 1,$(TARGET_TESTARCH))) | ||
384 | DASM_AFLAGS+= -D FFI | ||
385 | endif | ||
386 | ifneq (,$(findstring LJ_DUALNUM 1,$(TARGET_TESTARCH))) | ||
387 | DASM_AFLAGS+= -D DUALNUM | ||
388 | endif | ||
389 | ifneq (,$(findstring LJ_ARCH_HASFPU 1,$(TARGET_TESTARCH))) | ||
390 | DASM_AFLAGS+= -D FPU | ||
391 | endif | ||
392 | ifeq (,$(findstring LJ_ABI_SOFTFP 1,$(TARGET_TESTARCH))) | ||
393 | DASM_AFLAGS+= -D HF | ||
394 | endif | ||
395 | DASM_AFLAGS+= -D VER=$(subst LJ_ARCH_VERSION_,,$(filter LJ_ARCH_VERSION_%,$(subst LJ_ARCH_VERSION ,LJ_ARCH_VERSION_,$(TARGET_TESTARCH)))) | ||
396 | ifeq (Windows,$(TARGET_SYS)) | ||
397 | DASM_AFLAGS+= -D WIN | ||
398 | endif | ||
399 | ifeq (x86,$(TARGET_LJARCH)) | ||
400 | ifneq (,$(findstring __SSE2__ 1,$(TARGET_TESTARCH))) | ||
401 | DASM_AFLAGS+= -D SSE | ||
402 | endif | ||
403 | else | ||
380 | ifeq (x64,$(TARGET_LJARCH)) | 404 | ifeq (x64,$(TARGET_LJARCH)) |
405 | DASM_AFLAGS+= -D X64 | ||
381 | DASM_ARCH= x86 | 406 | DASM_ARCH= x86 |
382 | ifeq (Windows,$(TARGET_SYS)) | 407 | else |
383 | DASM_AFLAGS+= -D X64 -D X64WIN | 408 | ifeq (ppc,$(TARGET_LJARCH)) |
384 | else | 409 | ifneq (,$(findstring LJ_ARCH_SQRT 1,$(TARGET_TESTARCH))) |
385 | DASM_AFLAGS+= -D X64 | 410 | DASM_AFLAGS+= -D SQRT |
386 | endif | 411 | endif |
412 | ifneq (,$(findstring LJ_ARCH_ROUND 1,$(TARGET_TESTARCH))) | ||
413 | DASM_AFLAGS+= -D ROUND | ||
414 | endif | ||
415 | ifeq (PS3,$(TARGET_SYS)) | ||
416 | DASM_AFLAGS+= -D PS3 | ||
417 | endif | ||
418 | endif | ||
419 | endif | ||
387 | endif | 420 | endif |
388 | 421 | ||
389 | DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) | 422 | DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) |
diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat index cb973fe4..ad6f2113 100644 --- a/src/msvcbuild.bat +++ b/src/msvcbuild.bat | |||
@@ -29,13 +29,13 @@ | |||
29 | if exist minilua.exe.manifest^ | 29 | if exist minilua.exe.manifest^ |
30 | %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe | 30 | %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe |
31 | 31 | ||
32 | @set DASMFLAGS=-D X64 -D X64WIN | 32 | @set DASMFLAGS=-D X64 -D WIN |
33 | @if defined CPU goto :XCPU | 33 | @if defined CPU goto :XCPU |
34 | @set CPU=%PROCESSOR_ARCHITECTURE% | 34 | @set CPU=%PROCESSOR_ARCHITECTURE% |
35 | :XCPU | 35 | :XCPU |
36 | @if "%CPU%"=="AMD64" goto :X64 | 36 | @if "%CPU%"=="AMD64" goto :X64 |
37 | @if "%CPU%"=="X64" goto :X64 | 37 | @if "%CPU%"=="X64" goto :X64 |
38 | @set DASMFLAGS= | 38 | @set DASMFLAGS=-D WIN |
39 | :X64 | 39 | :X64 |
40 | minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc | 40 | minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc |
41 | @if errorlevel 1 goto :BAD | 41 | @if errorlevel 1 goto :BAD |
diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index 30ee5b67..1cab76eb 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc | |||
@@ -16,6 +16,13 @@ | |||
16 | | | 16 | | |
17 | |//----------------------------------------------------------------------- | 17 | |//----------------------------------------------------------------------- |
18 | | | 18 | | |
19 | |.if X64 | ||
20 | |.define SSE, 1 | ||
21 | |.if WIN | ||
22 | |.define X64WIN, 1 | ||
23 | |.endif | ||
24 | |.endif | ||
25 | | | ||
19 | |// Fixed register assignments for the interpreter. | 26 | |// Fixed register assignments for the interpreter. |
20 | |// This is very fragile and has many dependencies. Caveat emptor. | 27 | |// This is very fragile and has many dependencies. Caveat emptor. |
21 | |.define BASE, edx // Not C callee-save, refetched anyway. | 28 | |.define BASE, edx // Not C callee-save, refetched anyway. |