2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // x86 assembly-language Alias model transform
and project code.
42 .globl C(R_Alias_clip_bottom)
43 C
(R_Alias_clip_bottom
):
50 movl C
(r_refdef
)+rd_aliasvrectbottom
,%eax
54 movl fv_v+
4(%esi
),%edx
55 movl fv_v+
4(%edi
),%ecx
60 movl fv_v+
4(%esi
),%ecx
61 movl fv_v+
4(%edi
),%edx
76 fdivp
%st(0),%st(1) // scale
79 fildl fv_v+
0(%esi
) // fv0v0 | scale
80 fildl fv_v+
0(%edi
) // fv1v0 | fv0v0 | scale
81 fildl fv_v+
4(%esi
) // fv0v1 | fv1v0 | fv0v0 | scale
82 fildl fv_v+
4(%edi
) // fv1v1 | fv0v1 | fv1v0 | fv0v0 | scale
83 fildl fv_v+
8(%esi
) // fv0v2 | fv1v1 | fv0v1 | fv1v0 | fv0v0 | scale
84 fildl fv_v+
8(%edi
) // fv1v2 | fv0v2 | fv1v1 | fv0v1 | fv1v0 | fv0v0 |
86 fxch
%st(5) // fv0v0 | fv0v2 | fv1v1 | fv0v1 | fv1v0 | fv1v2 |
88 fsubr
%st(0),%st(4) // fv0v0 | fv0v2 | fv1v1 | fv0v1 | fv1v0-fv0v0 |
90 fxch
%st(3) // fv0v1 | fv0v2 | fv1v1 | fv0v0 | fv1v0-fv0v0 |
92 fsubr
%st(0),%st(2) // fv0v1 | fv0v2 | fv1v1-fv0v1 | fv0v0 |
93 // fv1v0-fv0v0 | fv1v2 | scale
94 fxch
%st(1) // fv0v2 | fv0v1 | fv1v1-fv0v1 | fv0v0 |
95 // fv1v0-fv0v0 | fv1v2 | scale
96 fsubr
%st(0),%st(5) // fv0v2 | fv0v1 | fv1v1-fv0v1 | fv0v0 |
97 // fv1v0-fv0v0 | fv1v2-fv0v2 | scale
98 fxch
%st(6) // scale | fv0v1 | fv1v1-fv0v1 | fv0v0 |
99 // fv1v0-fv0v0 | fv1v2-fv0v2 | fv0v2
100 fmul %st(0),%st(4) // scale | fv0v1 | fv1v1-fv0v1 | fv0v0 |
101 // (fv1v0-fv0v0
)*scale | fv1v2-fv0v2 | fv0v2
103 fmul %st(0),%st(2) // scale | fv0v1 |
(fv1v1-fv0v1
)*scale | fv0v0 |
104 // (fv1v0-fv0v0
)*scale | fv1v2-fv0v2 | fv0v2
107 fmul %st(0),%st(5) // scale | fv0v1 |
(fv1v1-fv0v1
)*scale | fv0v0 |
108 // (fv1v0-fv0v0
)*scale |
(fv1v2-fv0v2
)*scale |
110 fxch
%st(3) // fv0v0 | fv0v1 |
(fv1v1-fv0v1
)*scale | scale |
111 // (fv1v0-fv0v0
)*scale |
(fv1v2-fv0v2
)*scale |
113 faddp
%st(0),%st(4) // fv0v1 |
(fv1v1-fv0v1
)*scale | scale |
114 // fv0v0+
(fv1v0-fv0v0
)*scale |
115 // (fv1v2-fv0v2
)*scale | fv0v2
116 faddp
%st(0),%st(1) // fv0v1+
(fv1v1-fv0v1
)*scale | scale |
117 // fv0v0+
(fv1v0-fv0v0
)*scale |
118 // (fv1v2-fv0v2
)*scale | fv0v2
119 fxch
%st(4) // fv0v2 | scale | fv0v0+
(fv1v0-fv0v0
)*scale |
120 // (fv1v2-fv0v2
)*scale | fv0v1+
(fv1v1-fv0v1
)*scale
121 faddp
%st(0),%st(3) // scale | fv0v0+
(fv1v0-fv0v0
)*scale |
122 // fv0v2+
(fv1v2-fv0v2
)*scale |
123 // fv0v1+
(fv1v1-fv0v1
)*scale
124 fxch
%st(1) // fv0v0+
(fv1v0-fv0v0
)*scale | scale |
125 // fv0v2+
(fv1v2-fv0v2
)*scale |
126 // fv0v1+
(fv1v1-fv0v1
)*scale
128 fxch
%st(3) // fv0v1+
(fv1v1-fv0v1
)*scale | scale |
129 // fv0v2+
(fv1v2-fv0v2
)*scale |
130 // fv0v0+
(fv1v0-fv0v0
)*scale
132 fxch
%st(2) // fv0v2+
(fv1v2-fv0v2
)*scale | scale |
133 // fv0v1+
(fv1v1-fv0v1
)*scale |
134 // fv0v0+
(fv1v0-fv0v0
)*scale
136 fxch
%st(3) // fv0v0+
(fv1v0-fv0v0
)*scale | scale |
137 // fv0v1+
(fv1v1-fv0v1
)*scale |
138 // fv0v2+
(fv1v2-fv0v2
)*scale
139 fistpl fv_v+
0-12(%edx
) // scale | fv0v1+
(fv1v1-fv0v1
)*scale |
140 // fv0v2+
(fv1v2-fv0v2
)*scale
141 fxch
%st(1) // fv0v1+
(fv1v1-fv0v1
)*scale | scale |
142 // fv0v2+
(fv1v2-fv0v2
)*scale | scale
143 fistpl fv_v+
4-12(%edx
) // scale | fv0v2+
(fv1v2-fv0v2
)*scale
144 fxch
%st(1) // fv0v2+
(fv1v2-fv0v2
)*sc | scale
145 fistpl fv_v+
8-12(%edx
) // scale
158 .globl C(R_Alias_clip_top)
166 movl C
(r_refdef
)+rd_aliasvrect+
4,%eax
167 jmp LDoForwardOrBackward
171 .globl C(R_Alias_clip_right)
172 C
(R_Alias_clip_right
):
179 movl C
(r_refdef
)+rd_aliasvrectright
,%eax
184 movl fv_v+
4(%esi
),%edx
185 movl fv_v+
4(%edi
),%ecx
188 movl fv_v+
0(%esi
),%edx
190 movl fv_v+
0(%edi
),%ecx
193 movl fv_v+
0(%esi
),%ecx
194 movl fv_v+
0(%edi
),%edx
203 .globl C(R_Alias_clip_left)
204 C
(R_Alias_clip_left
):
211 movl C
(r_refdef
)+rd_aliasvrect+
0,%eax