- Add MASM assembler files for MSVC x64 projects to support vm_x86 in x64 mode

- Clean up ftol()/snapvector() mess
- Make use of SSE instructions for ftol()/snapvector() if available
- move ftol/snapvector pure assembler to inline assembler, this will add x86_64 and improve support for different calling conventions
- Set FPU control word at program startup to get consistent behaviour on all platforms
This commit is contained in:
Thilo Schulz 2011-06-13 09:56:39 +00:00
parent 471182cba0
commit 03201aff22
22 changed files with 540 additions and 460 deletions

View file

@ -1504,13 +1504,30 @@ ifeq ($(ARCH),i386)
Q3OBJ += \
$(B)/client/snd_mixa.o \
$(B)/client/matha.o \
$(B)/client/snapvectora.o
$(B)/client/snapvector.o \
$(B)/client/ftola.o
endif
ifeq ($(ARCH),x86)
Q3OBJ += \
$(B)/client/snd_mixa.o \
$(B)/client/matha.o \
$(B)/client/snapvectora.o
$(B)/client/snapvector.o \
$(B)/client/ftola.o
endif
ifeq ($(ARCH),x86_64)
Q3OBJ += \
$(B)/client/snapvector.o \
$(B)/client/ftola.o
endif
ifeq ($(ARCH),amd64)
Q3OBJ += \
$(B)/client/snapvector.o \
$(B)/client/ftola.o
endif
ifeq ($(ARCH),x64)
Q3OBJ += \
$(B)/client/snapvector.o \
$(B)/client/ftola.o
endif
ifeq ($(USE_VOIP),1)
@ -1572,13 +1589,11 @@ endif
ifeq ($(HAVE_VM_COMPILED),true)
ifeq ($(ARCH),i386)
Q3OBJ += \
$(B)/client/vm_x86.o \
$(B)/client/ftola.o
$(B)/client/vm_x86.o
endif
ifeq ($(ARCH),x86)
Q3OBJ += \
$(B)/client/vm_x86.o \
$(B)/client/ftola.o
$(B)/client/vm_x86.o
endif
ifeq ($(ARCH),x86_64)
ifeq ($(USE_OLD_VM64),1)
@ -1587,8 +1602,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
$(B)/client/vm_x86_64_assembler.o
else
Q3OBJ += \
$(B)/client/vm_x86.o \
$(B)/client/ftola.o
$(B)/client/vm_x86.o
endif
endif
ifeq ($(ARCH),amd64)
@ -1598,8 +1612,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
$(B)/client/vm_x86_64_assembler.o
else
Q3OBJ += \
$(B)/client/vm_x86.o \
$(B)/client/ftola.o
$(B)/client/vm_x86.o
endif
endif
ifeq ($(ARCH),x64)
@ -1609,8 +1622,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
$(B)/client/vm_x86_64_assembler.o
else
Q3OBJ += \
$(B)/client/vm_x86.o \
$(B)/client/ftola.o
$(B)/client/vm_x86.o
endif
endif
ifeq ($(ARCH),ppc)
@ -1747,13 +1759,30 @@ Q3DOBJ = \
ifeq ($(ARCH),i386)
Q3DOBJ += \
$(B)/ded/snapvectora.o \
$(B)/ded/matha.o
$(B)/ded/matha.o \
$(B)/ded/snapvector.o \
$(B)/ded/ftola.o
endif
ifeq ($(ARCH),x86)
Q3DOBJ += \
$(B)/ded/snapvectora.o \
$(B)/ded/matha.o
$(B)/ded/matha.o \
$(B)/ded/snapvector.o \
$(B)/ded/ftola.o
endif
ifeq ($(ARCH),x86_64)
Q3DOBJ += \
$(B)/ded/snapvector.o \
$(B)/ded/ftola.o
endif
ifeq ($(ARCH),amd64)
Q3DOBJ += \
$(B)/ded/snapvector.o \
$(B)/ded/ftola.o
endif
ifeq ($(ARCH),x64)
Q3DOBJ += \
$(B)/ded/snapvector.o \
$(B)/ded/ftola.o
endif
ifeq ($(USE_INTERNAL_ZLIB),1)
@ -1769,13 +1798,11 @@ endif
ifeq ($(HAVE_VM_COMPILED),true)
ifeq ($(ARCH),i386)
Q3DOBJ += \
$(B)/ded/vm_x86.o \
$(B)/ded/ftola.o
$(B)/ded/vm_x86.o
endif
ifeq ($(ARCH),x86)
Q3DOBJ += \
$(B)/ded/vm_x86.o \
$(B)/ded/ftola.o
$(B)/ded/vm_x86.o
endif
ifeq ($(ARCH),x86_64)
ifeq ($(USE_OLD_VM64),1)
@ -1784,8 +1811,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
$(B)/ded/vm_x86_64_assembler.o
else
Q3DOBJ += \
$(B)/ded/vm_x86.o \
$(B)/ded/ftola.o
$(B)/ded/vm_x86.o
endif
endif
ifeq ($(ARCH),amd64)
@ -1795,8 +1821,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
$(B)/ded/vm_x86_64_assembler.o
else
Q3DOBJ += \
$(B)/ded/vm_x86.o \
$(B)/ded/ftola.o
$(B)/ded/vm_x86.o
endif
endif
ifeq ($(ARCH),x64)
@ -1806,8 +1831,7 @@ ifeq ($(HAVE_VM_COMPILED),true)
$(B)/ded/vm_x86_64_assembler.o
else
Q3DOBJ += \
$(B)/ded/vm_x86.o \
$(B)/ded/ftola.o
$(B)/ded/vm_x86.o
endif
endif
ifeq ($(ARCH),ppc)
@ -2133,6 +2157,10 @@ $(B)/missionpack/vm/ui.qvm: $(MPUIVMOBJ) $(UIDIR)/ui_syscalls.asm $(Q3ASM)
$(B)/client/%.o: $(ASMDIR)/%.s
$(DO_AS)
# k8 so inline assembler knows about SSE
$(B)/client/%.o: $(ASMDIR)/%.c
$(DO_CC) -march=k8
$(B)/client/%.o: $(CDIR)/%.c
$(DO_CC)
@ -2176,6 +2204,10 @@ $(B)/client/%.o: $(SYSDIR)/%.rc
$(B)/ded/%.o: $(ASMDIR)/%.s
$(DO_AS)
# k8 so inline assembler knows about SSE
$(B)/ded/%.o: $(ASMDIR)/%.c
$(DO_CC) -march=k8
$(B)/ded/%.o: $(SDIR)/%.c
$(DO_DED_CC)