fix a screwup with math.S

turns out make doesn't like files being included more than once (duplicate .d files)
This commit is contained in:
Bill Currie 2000-05-11 13:45:45 +00:00
parent 44deb188ec
commit d5214f07a2
2 changed files with 28 additions and 122 deletions

View file

@ -7,7 +7,7 @@ CL_SVGA_name=qw-client-svga
CL_SVGA_libs=-lvga
CL_X11_name=qw-client-x11
CL_X11_libs=
CL_X11_libs=-L/usr/X11R6/lib -lX11 -lXext
DIRECTORIES=
vpath %.a $(patsubst @%,%,$(DIRECTORIES)) /usr/lib
@ -28,6 +28,25 @@ CXXFLAGS+=-g -O2
# *List Macros*
COM_sources=\
net_chan.c \
net_com.c \
net_udp.c \
pmove.c \
pmovetst.c \
zone.c \
mdfour.c \
mathlib.c \
math.S \
cvar.c \
crc.c \
common.c \
cmd.c \
model.c
COM_dependencies = $(patsubst %,%.d,$(basename $(COM_sources)))
COM_objects = $(patsubst %.d,%.o,$(COM_dependencies))
SV_sources=\
pr_cmds.c \
pr_edict.c \
@ -45,21 +64,7 @@ SV_sources=\
world.c \
worlda.S \
sys_unix.c \
model.c \
cmd.c \
common.c \
crc.c \
cvar.c \
sv_cvar.c \
mathlib.c \
math.S \
mdfour.c \
zone.c \
pmove.c \
pmovetst.c \
net_chan.c \
net_com.c \
net_udp.c
sv_cvar.c
SV_dependencies = $(patsubst %,%.d,$(basename $(SV_sources)))
SV_objects = $(patsubst %.d,%.o,$(SV_dependencies))
@ -75,11 +80,7 @@ CL_sources=\
cl_pred.c \
cl_tent.c \
cl_cam.c \
cmd.c \
common.c \
console.c \
crc.c \
cvar.c \
d_edge.c \
d_fill.c \
d_init.c \
@ -94,16 +95,8 @@ CL_sources=\
d_zpoint.c \
draw.c \
keys.c \
mathlib.c \
mdfour.c \
menu.c \
model.c \
net_chan.c \
net_com.c \
net_udp.c \
nonintel.c \
pmove.c \
pmovetst.c \
r_aclip.c \
r_alias.c \
r_bsp.c \
@ -126,7 +119,6 @@ CL_sources=\
snd_mix.c \
view.c \
wad.c \
zone.c \
cd_linux.c \
sys_linux.c \
snd_linux.c \
@ -138,7 +130,6 @@ CL_sources=\
d_scana.S \
d_spr8.S \
d_varsa.S \
math.S \
r_aclipa.S \
r_aliasa.S \
r_drawa.S \
@ -169,20 +160,21 @@ CL_X11_objects = $(patsubst %.d,%.o,$(CL_X11_dependencies))
all: $(SV_name) #$(CL_SVGA_name) $(CL_X11_name)
$(SV_name): $(SV_objects) $(SV_libs)
$(SV_name): $(COM_objects) $(SV_objects) $(SV_libs)
$(CC) $(LDFLAGS) -o $@ $^ -lm -ldl -lpthread
$(CL_SVGA_name): $(CL_objects) $(CL_SVGA_objects) $(CL_SVGA_libs)
$(CL_SVGA_name): $(COM_objects) $(CL_objects) $(CL_SVGA_objects) $(CL_SVGA_libs)
$(CC) $(LDFLAGS) -o $@ $^ -lm -ldl -lpthread
$(CL_X11_name): $(CL_objects) $(CL_X11_objects) $(CL_X11_libs)
$(CL_X11_name): $(COM_objects) $(CL_objects) $(CL_X11_objects) $(CL_X11_libs)
$(CC) $(LDFLAGS) -o $@ $^ -lm -ldl -lpthread
clean:
-rm -f *.[od] $(SV_name)
-rm -f *.[od] $(SV_name) $(CL_SVGA_name) $(CL_X11_name)
# *Individual File Dependencies*
-include $(COM_dependencies)
-include $(SV_dependencies)
-include $(CL_dependencies)
-include $(CL_SVGA_dependencies)

View file

@ -1,22 +1,3 @@
/*
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//
// math.s
// x86 assembly-language math routines.
@ -25,7 +6,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakeasm.h"
#if id386
#if id386
.data
@ -35,73 +16,6 @@ Ljmptab: .long Lcase0, Lcase1, Lcase2, Lcase3
.text
// TODO: rounding needed?
// stack parameter offset
#define val 4
.globl C(Invert24To16)
C(Invert24To16):
movl val(%esp),%ecx
movl $0x100,%edx // 0x10000000000 as dividend
cmpl %edx,%ecx
jle LOutOfRange
subl %eax,%eax
divl %ecx
ret
LOutOfRange:
movl $0xFFFFFFFF,%eax
ret
#define in 4
#define out 8
.align 2
.globl C(TransformVector)
C(TransformVector):
movl in(%esp),%eax
movl out(%esp),%edx
flds (%eax) // in[0]
fmuls C(vright) // in[0]*vright[0]
flds (%eax) // in[0] | in[0]*vright[0]
fmuls C(vup) // in[0]*vup[0] | in[0]*vright[0]
flds (%eax) // in[0] | in[0]*vup[0] | in[0]*vright[0]
fmuls C(vpn) // in[0]*vpn[0] | in[0]*vup[0] | in[0]*vright[0]
flds 4(%eax) // in[1] | ...
fmuls C(vright)+4 // in[1]*vright[1] | ...
flds 4(%eax) // in[1] | in[1]*vright[1] | ...
fmuls C(vup)+4 // in[1]*vup[1] | in[1]*vright[1] | ...
flds 4(%eax) // in[1] | in[1]*vup[1] | in[1]*vright[1] | ...
fmuls C(vpn)+4 // in[1]*vpn[1] | in[1]*vup[1] | in[1]*vright[1] | ...
fxch %st(2) // in[1]*vright[1] | in[1]*vup[1] | in[1]*vpn[1] | ...
faddp %st(0),%st(5) // in[1]*vup[1] | in[1]*vpn[1] | ...
faddp %st(0),%st(3) // in[1]*vpn[1] | ...
faddp %st(0),%st(1) // vpn_accum | vup_accum | vright_accum
flds 8(%eax) // in[2] | ...
fmuls C(vright)+8 // in[2]*vright[2] | ...
flds 8(%eax) // in[2] | in[2]*vright[2] | ...
fmuls C(vup)+8 // in[2]*vup[2] | in[2]*vright[2] | ...
flds 8(%eax) // in[2] | in[2]*vup[2] | in[2]*vright[2] | ...
fmuls C(vpn)+8 // in[2]*vpn[2] | in[2]*vup[2] | in[2]*vright[2] | ...
fxch %st(2) // in[2]*vright[2] | in[2]*vup[2] | in[2]*vpn[2] | ...
faddp %st(0),%st(5) // in[2]*vup[2] | in[2]*vpn[2] | ...
faddp %st(0),%st(3) // in[2]*vpn[2] | ...
faddp %st(0),%st(1) // vpn_accum | vup_accum | vright_accum
fstps 8(%edx) // out[2]
fstps 4(%edx) // out[1]
fstps (%edx) // out[0]
ret
#define EMINS 4+4
#define EMAXS 4+8
@ -121,7 +35,7 @@ C(BoxOnPlaneSide):
jge Lerror
flds pl_normal(%edx) // p->normal[0]
fld %st(0) // p->normal[0] | p->normal[0]
jmp Ljmptab(,%eax,4)
jmp *Ljmptab(,%eax,4)
//dist1= p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];