move cl_math.S into renderer/sw/transform.S (never before realised it was

part of the renderer)
This commit is contained in:
Bill Currie 2001-05-26 03:33:09 +00:00
parent 3035224bec
commit 4c5b977902
5 changed files with 4 additions and 116 deletions

View file

@ -17,4 +17,5 @@ libsw_la_SOURCES = d_edge.c d_fill.c d_init.c d_modech.c d_part.c d_polyse.c \
sw_skin.c \
d_draw.S d_draw16.S d_parta.S d_polysa.S d_scana.S d_spr8.S \
d_varsa.S surf16.S surf8.S sw_raclipa.S sw_raliasa.S sw_rdrawa.S \
sw_redgea.S sw_rvarsa.S
sw_redgea.S sw_rvarsa.S \
transform.S

View file

@ -107,5 +107,4 @@ C(TransformVector):
ret
#endif // USE_INTEL_ASM

View file

@ -40,8 +40,7 @@ EXTRA_PROGRAMS= nq-3dfx nq-fbdev nq-glx nq-mgl nq-sdl \
noinst_LIBRARIES= libqfnet.a
math_ASM= cl_math.S
common_ASM= sys_ia32.S worlda.S $(math_ASM)
common_ASM= sys_ia32.S worlda.S
common_SOURCES= game.c host_skin.c skin.c wad.c world.c com.c $(common_ASM)

View file

@ -99,7 +99,7 @@ client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \
cl_skin.c cl_slist.c cl_tent.c \
console.c keys.c locs.c pcx.c \
r_view.c sbar.c skin.c teamplay.c tga.c \
wad.c cl_math.S $(syscl_SRC)
wad.c $(syscl_SRC)
# Software-rendering clients
#

View file

@ -1,111 +0,0 @@
/*
cl_math.S
Client x86 assembly-language math routines.
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:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
$Id$
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "QF/asm_i386.h"
#include "quakeasm.h"
#undef USE_INTEL_ASM //XXX asm pic hack
#ifdef USE_INTEL_ASM
.data
.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
#endif // USE_INTEL_ASM