summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralanh <alanh>2001-10-22 20:01:45 +0000
committeralanh <alanh>2001-10-22 20:01:45 +0000
commit985923cd447a6c820d397b8c0ca1cd8f4a1cdce2 (patch)
treea31f93eadf48c02f14aed816c0c2a156c3e2035d
parent1fa3309d6c7982be97690a11e7c1978bbac3e0d1 (diff)
merge in current Mesa 3.4.2 code.
-rw-r--r--xc/extras/Mesa/include/GL/osmesa.h3
-rw-r--r--xc/extras/Mesa/src/X/xmesa1.c9
-rw-r--r--xc/extras/Mesa/src/X86/3dnow_norm_raw.S95
-rw-r--r--xc/extras/Mesa/src/X86/3dnow_xform_raw3.S674
-rw-r--r--xc/extras/Mesa/src/X86/3dnow_xform_raw4.S692
5 files changed, 703 insertions, 770 deletions
diff --git a/xc/extras/Mesa/include/GL/osmesa.h b/xc/extras/Mesa/include/GL/osmesa.h
index 3f1b863ea..8fccaa8e0 100644
--- a/xc/extras/Mesa/include/GL/osmesa.h
+++ b/xc/extras/Mesa/include/GL/osmesa.h
@@ -1,3 +1,4 @@
+/* $Id: osmesa.h,v 1.2.64.2 2001/10/22 20:01:45 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -58,7 +59,7 @@ extern "C" {
#endif
-#include <GL/gl.h>
+#include "GL/gl.h"
#define OSMESA_MAJOR_VERSION 3
diff --git a/xc/extras/Mesa/src/X/xmesa1.c b/xc/extras/Mesa/src/X/xmesa1.c
index bf3c7521d..86ce2d87d 100644
--- a/xc/extras/Mesa/src/X/xmesa1.c
+++ b/xc/extras/Mesa/src/X/xmesa1.c
@@ -2034,6 +2034,10 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
if (drawBuffer->FXctx) {
fxMesaMakeCurrent(drawBuffer->FXctx);
+ /* Disassociate drawBuffer's current context from drawBuffer */
+ if (drawBuffer->xm_context)
+ drawBuffer->xm_context->xm_buffer = NULL;
+
/* Disassociate old buffer from this context */
if (c->xm_buffer)
c->xm_buffer->xm_context = NULL;
@@ -2056,9 +2060,14 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
return GL_TRUE;
}
+ /* Disassociate drawBuffer's current context from drawBuffer */
+ if (drawBuffer->xm_context)
+ drawBuffer->xm_context->xm_buffer = NULL;
+
/* Disassociate old buffer with this context */
if (c->xm_buffer)
c->xm_buffer->xm_context = NULL;
+
drawBuffer->xm_context = c; /* Associate the context with this buffer */
c->xm_buffer = drawBuffer;
diff --git a/xc/extras/Mesa/src/X86/3dnow_norm_raw.S b/xc/extras/Mesa/src/X86/3dnow_norm_raw.S
index e074c3337..74492a326 100644
--- a/xc/extras/Mesa/src/X86/3dnow_norm_raw.S
+++ b/xc/extras/Mesa/src/X86/3dnow_norm_raw.S
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.4
*
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
@@ -21,7 +21,6 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/extras/Mesa/src/X86/3dnow_norm_raw.S,v 1.4 2000/09/26 15:56:39 tsi Exp $ */
/*
* 3Dnow assembly code by Holger Waechtler
@@ -122,12 +121,12 @@ GLNAME(gl_3dnow_transform_normalize_normals_raw):
PFMUL ( MM0, MM6 ) /* scale * m9 | scale * m8 */
PFMUL ( MM0, MM7 ) /* | scale * m10 */
+ALIGNTEXT32
LLBL (G3TN_scale_end):
+LLBL (G3TN_transform):
MOVQ ( REGIND (EDX), MM0 ) /* x1 | x0 */
MOVD ( REGOFF (8, EDX), MM2 ) /* | x2 */
-ALIGNTEXT32
-LLBL (G3TN_transform):
MOVQ ( MM0, MM1 ) /* x1 | x0 */
PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
@@ -157,9 +156,6 @@ LLBL (G3TN_transform):
PREFETCH ( REGIND(EDX) )
MOVD ( MM1, REGOFF(-4, EAX) ) /* write r2 */
- MOVQ ( REGIND (EDX), MM0 ) /* x1 | x0 */
-
- MOVD ( REGOFF (8, EDX), MM2 ) /* | x2 */
DEC_L ( EBP ) /* decrement normal counter */
JA ( LLBL (G3TN_transform) )
@@ -254,7 +250,7 @@ ALIGNTEXT16
GLOBL GLNAME(gl_3dnow_transform_normalize_normals_no_rot_raw)
GLNAME(gl_3dnow_transform_normalize_normals_no_rot_raw):
- #undef FRAME_OFFSET
+ #undef FRAME_OFFSET
#define FRAME_OFFSET 12
PUSH_L ( EDI )
@@ -293,18 +289,17 @@ GLNAME(gl_3dnow_transform_normalize_normals_no_rot_raw):
ALIGNTEXT32
LLBL (G3TNNR_scale_end):
- MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
-
CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */
JE ( LLBL (G3TNNR_norm) ) /* need to calculate lengths */
- MOVD ( REGIND(EDI), MM3 ) /* | length (x) */
-
-
ALIGNTEXT32
LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */
+ MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
+
+ MOVD ( REGIND(EDI), MM3 ) /* | length (x) */
+
PREFETCHW ( REGIND(EAX) )
PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */
@@ -325,10 +320,6 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */
MOVQ ( MM6, REGOFF(-12, EAX) ) /* write r0, r1 */
MOVD ( MM7, REGOFF(-4, EAX) ) /* write r2 */
- MOVD ( REGIND(EDI), MM3 ) /* | length (x) */
-
- MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
JA ( LLBL (G3TNNR_norm_w_lengths) )
JMP ( LLBL (G3TNNR_exit_3dnow) )
@@ -336,6 +327,9 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */
ALIGNTEXT32
LLBL (G3TNNR_norm): /* need to calculate lengths */
+ MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
+
PREFETCHW ( REGIND(EAX) )
PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */
@@ -372,9 +366,6 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */
PFMUL ( MM5, MM7 ) /* | x2 (normalized) */
MOVD ( MM7, REGOFF(-4, EAX) ) /* write r2 */
- MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */
-
- MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
JA ( LLBL (G3TNNR_norm) )
@@ -396,7 +387,7 @@ ALIGNTEXT16
GLOBL GLNAME(gl_3dnow_transform_rescale_normals_no_rot_raw)
GLNAME(gl_3dnow_transform_rescale_normals_no_rot_raw):
- #undef FRAME_OFFSET
+ #undef FRAME_OFFSET
#define FRAME_OFFSET 12
PUSH_L ( EDI )
@@ -427,14 +418,14 @@ GLNAME(gl_3dnow_transform_rescale_normals_no_rot_raw):
PFMUL ( MM6, MM0 ) /* scale*m5 | scale*m0 */
MOVD ( REGOFF(40, ECX), MM2 ) /* | m10 */
- MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
PFMUL ( MM6, MM2 ) /* | scale*m10 */
- MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
-
ALIGNTEXT32
LLBL (G3TRNR_rescale):
+ MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
+
PREFETCHW ( REGIND(EAX) )
PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */
@@ -449,9 +440,6 @@ LLBL (G3TRNR_rescale):
MOVQ ( MM4, REGOFF(-12, EAX) ) /* write r0, r1 */
MOVD ( MM5, REGOFF(-4, EAX) ) /* write r2 */
- MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
-
- MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
JA ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */
FEMMS
@@ -508,14 +496,15 @@ GLNAME(gl_3dnow_transform_rescale_normals_raw):
PFMUL ( MM0, MM5 ) /* scale*m6 | scale*m2 */
PFMUL ( MM0, MM6 ) /* scale*m9 | scale*m8 */
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
PFMUL ( MM0, MM7 ) /* | scale*m10 */
- MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
ALIGNTEXT32
LLBL (G3TR_rescale):
+ MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
+ MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
+
PREFETCHW ( REGIND(EAX) )
MOVQ ( MM0, MM1 ) /* x1 | x0 */
@@ -546,9 +535,6 @@ LLBL (G3TR_rescale):
PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */
MOVD ( MM1, REGOFF(-4, EAX) ) /* write r2 */
- MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
-
DEC_L ( EDI ) /* decrement normal counter */
JA ( LLBL (G3TR_rescale) )
@@ -595,12 +581,12 @@ GLNAME(gl_3dnow_transform_normals_no_rot_raw):
MOVD ( REGOFF(40, ECX), MM2 ) /* | m10 */
PUNPCKLDQ ( MM2, MM2 ) /* m10 | m10 */
- MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
-
ALIGNTEXT32
LLBL (G3TNR_transform):
+ MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
+
PREFETCHW ( REGIND(EAX) )
PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */
@@ -615,9 +601,6 @@ LLBL (G3TNR_transform):
MOVQ ( MM4, REGOFF(-12, EAX) ) /* write r0, r1 */
MOVD ( MM5, REGOFF(-4, EAX) ) /* write r2 */
- MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
-
- MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
JA ( LLBL (G3TNR_transform) )
FEMMS
@@ -667,12 +650,12 @@ GLNAME(gl_3dnow_transform_normals_raw):
MOVQ ( REGOFF(32, ECX), MM6 ) /* m9 | m8 */
MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */
- MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
-
ALIGNTEXT32
LLBL (G3T_transform):
+ MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
+
PREFETCHW ( REGIND(EAX) )
MOVQ ( MM0, MM1 ) /* x1 | x0 */
@@ -702,9 +685,6 @@ LLBL (G3T_transform):
PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */
MOVD ( MM1, REGOFF(-4, EAX) ) /* write r2 */
- MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
-
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
DEC_L ( EDI ) /* decrement normal counter */
JA ( LLBL (G3T_transform) )
@@ -744,15 +724,15 @@ GLNAME(gl_3dnow_normalize_normals_raw):
FEMMS
- MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
-
CMP_L ( CONST(0), EDX ) /* lengths == 0 ? */
JE ( LLBL (G3N_norm2) ) /* calculate lengths */
ALIGNTEXT32
LLBL (G3N_norm1): /* use precalculated lengths */
+ MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
+
PREFETCH ( REGIND(EAX) )
MOVD ( REGIND(EDX), MM3 ) /* | length (x) */
@@ -772,8 +752,6 @@ LLBL (G3N_norm1): /* use precalculated lengths */
ADD_L ( CONST(4), EDX ) /* next length */
DEC_L ( EBP ) /* decrement normal counter */
- MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
JA ( LLBL (G3N_norm1) )
JMP ( LLBL (G3N_end1) )
@@ -781,6 +759,9 @@ LLBL (G3N_norm1): /* use precalculated lengths */
ALIGNTEXT32
LLBL (G3N_norm2): /* need to calculate lengths */
+ MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
+
PREFETCHW ( REGIND(EAX) )
MOVQ ( MM0, MM3 ) /* x1 | x0 */
@@ -814,8 +795,6 @@ LLBL (G3N_norm2): /* need to calculate lengths */
PFMUL ( MM5, MM1 ) /* | x2 (normalized) */
MOVD ( MM1, REGOFF(-4, EAX) ) /* write new x2 */
- MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
JA ( LLBL (G3N_norm2) )
LLBL (G3N_end1):
@@ -856,12 +835,12 @@ GLNAME(gl_3dnow_rescale_normals_raw):
MOVD ( ARG_SCALE, MM0 ) /* scale */
PUNPCKLDQ ( MM0, MM0 )
- MOVQ ( REGIND(ECX), MM1 ) /* x1 | x0 */
- MOVD ( REGOFF(8, ECX), MM2 ) /* | x2 */
-
ALIGNTEXT32
LLBL (G3R_rescale):
+ MOVQ ( REGIND(ECX), MM1 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, ECX), MM2 ) /* | x2 */
+
PREFETCHW ( REGIND(EAX) )
PFMUL ( MM0, MM1 ) /* x1*scale | x0*scale */
@@ -876,9 +855,6 @@ LLBL (G3R_rescale):
MOVD ( MM2, REGOFF(-4, EAX) ) /* write r2 */
DEC_L ( EDX ) /* decrement normal counter */
- MOVQ ( REGIND(ECX), MM1 ) /* x1 | x0 */
-
- MOVD ( REGOFF(8, ECX), MM2 ) /* | x2 */
JA ( LLBL (G3R_rescale) )
FEMMS
@@ -887,6 +863,3 @@ LLBL (G3R_end):
POP_L ( ESI )
POP_L ( EDI )
RET
-
-
-
diff --git a/xc/extras/Mesa/src/X86/3dnow_xform_raw3.S b/xc/extras/Mesa/src/X86/3dnow_xform_raw3.S
index dc4105d9f..75928a9e5 100644
--- a/xc/extras/Mesa/src/X86/3dnow_xform_raw3.S
+++ b/xc/extras/Mesa/src/X86/3dnow_xform_raw3.S
@@ -1,96 +1,111 @@
-#include "assyntax.h"
-
- SEG_TEXT
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.4
+ *
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
-#define VEC_SIZE_1 1
-#define VEC_SIZE_2 3
-#define VEC_SIZE_3 7
-#define VEC_SIZE_4 15
+#include "assyntax.h"
+#include "xform_args.h"
+ SEG_TEXT
+#define FRAME_OFFSET 4
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points3_general_raw)
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points3_general_raw )
GLNAME( gl_3dnow_transform_points3_general_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TPGR_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TPGR_2 ) )
PREFETCHW ( REGIND(EDX) )
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM2 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
+ALIGNTEXT16
+LLBL( G3TPGR_1 ):
-ALIGNTEXT32
-LLBL(G3TPGR_1):
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EAX), MM2 ) /* | x2 */
+ ADD_L ( EDI, EAX ) /* next vertex */
PREFETCH ( REGIND(EAX) )
- MOVQ ( MM0, MM1 ) /* x1 | x0 */
- PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
-
- PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
- MOVQ ( MM2, MM5 ) /* x2 | x2 */
+ MOVQ ( MM0, MM1 ) /* x1 | x0 */
+ PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
- PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */
- PFMUL ( REGOFF(32, ECX), MM2 ) /* x2*m9 | x2*m8 */
+ PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
+ MOVQ ( MM2, MM5 ) /* x2 | x2 */
- MOVQ ( MM0, MM3 ) /* x0 | x0 */
- PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */
+ PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */
+ PFMUL ( REGOFF(32, ECX), MM2 ) /* x2*m9 | x2*m8 */
- MOVQ ( MM1, MM4 ) /* x1 | x1 */
- PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
+ MOVQ ( MM0, MM3 ) /* x0 | x0 */
+ PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */
- PFADD ( REGOFF(48, ECX), MM2 ) /* x2*m9+m13 | x2*m8+m12 */
- PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */
+ MOVQ ( MM1, MM4 ) /* x1 | x1 */
+ PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
- PFADD ( REGOFF(56, ECX), MM5 ) /* x2*m11+m15 | x2*m10+m14 */
- PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
+ PFADD ( REGOFF(48, ECX), MM2 ) /* x2*m9+m13 | x2*m8+m12 */
+ PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */
- PFMUL ( REGOFF(8, ECX), MM3 ) /* x0*m3 | x0*m2 */
- PFADD ( MM1, MM2 ) /* result r1 | r0 */
+ PFADD ( REGOFF(56, ECX), MM5 ) /* x2*m11+m15 | x2*m10+m14 */
+ PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
- PFMUL ( REGOFF(24, ECX), MM4 ) /* x1*m7 | x1*m6 */
- ADD_L ( CONST(16), EDX ) /* next r */
+ PFMUL ( REGOFF(8, ECX), MM3 ) /* x0*m3 | x0*m2 */
+ PFADD ( MM1, MM2 ) /* r1 | r0 */
- PFADD ( MM3, MM4 ) /* x0*m3+x1*m7 | x0*m2+x1*m6 */
- MOVQ ( MM2, REGOFF(-16, EDX) ) /* write r0, r1 */
+ PFMUL ( REGOFF(24, ECX), MM4 ) /* x1*m7 | x1*m6 */
+ ADD_L ( CONST(16), EDX ) /* next output vertex */
- PFADD ( MM4, MM5 ) /* r3 | r2 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
+ PFADD ( MM3, MM4 ) /* x0*m3+x1*m7 | x0*m2+x1*m6 */
+ MOVQ ( MM2, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM2 ) /* | x2 */
+ PFADD ( MM4, MM5 ) /* r3 | r2 */
+ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
- ADD_L ( EDI, EAX ) /* next vertex */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TPGR_1) ) /* cnt > 0 ? -> process next vertex */
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TPGR_2):
+LLBL( G3TPGR_2 ):
FEMMS
POP_L ( EDI )
@@ -100,55 +115,77 @@ LLBL(G3TPGR_2):
-
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points3_identity_raw)
-GLNAME( gl_3dnow_transform_points3_identity_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points3_perspective_raw )
+GLNAME( gl_3dnow_transform_points3_perspective_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(3), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TPIR_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TPPR_2 ) )
+ PREFETCH ( REGIND(EAX) )
PREFETCHW ( REGIND(EDX) )
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-ALIGNTEXT32
-LLBL(G3TPIR_1):
+ MOVQ ( REGOFF(32, ECX), MM1 ) /* m21 | m20 */
+ MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
- PREFETCHW ( REGOFF(32, EDX) )
+ MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
+
+ALIGNTEXT16
+LLBL( G3TPPR_1 ):
+
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+
+ MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
+ MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCH ( REGIND(EAX) )
- ADD_L ( EDI, EAX ) /* next vertex */
- ADD_L ( CONST(16), EDX ) /* next r */
+ PXOR ( MM7, MM7 ) /* 0 | 0 */
+ MOVQ ( MM5, MM6 ) /* | x2 */
- DEC_L ( ESI ) /* decrement vertex counter */
- MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */
+ PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
+ PFSUB ( MM5, MM7 ) /* | -x2 */
- MOVD ( MM1, REGOFF(-8, EDX) ) /* | r2 */
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
+ PFMUL ( MM2, MM6 ) /* | x2*m22 */
+ PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
- JA ( LLBL(G3TPIR_1) ) /* cnt > 0 ? -> process next vertex */
+ ADD_L ( CONST(16), EDX ) /* next r */
+ PFMUL ( MM1, MM5 ) /* x2*m21 | x2*m20 */
-ALIGNTEXT32
-LLBL(G3TPIR_2):
+ PFADD ( MM3, MM6 ) /* | x2*m22+m32 */
+ PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */
+
+ MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */
+ MOVD ( MM6, REGOFF(-8, EDX) ) /* write r2 */
+
+ MOVD ( MM7, REGOFF(-4, EDX) ) /* write r3 */
+
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */
+
+LLBL( G3TPPR_2 ):
FEMMS
POP_L ( EDI )
@@ -158,74 +195,83 @@ LLBL(G3TPIR_2):
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points3_2d_raw)
-GLNAME( gl_3dnow_transform_points3_2d_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points3_3d_raw )
+GLNAME( gl_3dnow_transform_points3_3d_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(3), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP2R_3) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP3R_2 ) )
PREFETCH ( REGIND(EAX) )
+ PREFETCH ( REGIND(EDX) )
- PREFETCHW ( REGIND(EDX) )
+ MOVD ( REGOFF(8, ECX), MM7 ) /* | m2 */
+ PUNPCKLDQ ( REGOFF(24, ECX), MM7 ) /* m6 | m2 */
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
+ALIGNTEXT16
+LLBL( G3TP3R_1 ):
- MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
- MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
+ MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCH ( REGIND(EAX) )
-ALIGNTEXT32
-LLBL(G3TP2R_2):
+ MOVQ ( MM0, MM2 ) /* x1 | x0 */
+ ADD_L ( CONST(16), EDX ) /* next r */
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ PUNPCKLDQ ( MM2, MM2 ) /* x0 | x0 */
+ MOVQ ( MM0, MM3 ) /* x1 | x0 */
- PREFETCH ( REGIND(EAX) )
+ PFMUL ( REGIND(ECX), MM2 ) /* x0*m1 | x0*m0 */
+ PUNPCKHDQ ( MM3, MM3 ) /* x1 | x1 */
- MOVQ ( MM3, MM4 ) /* x1 | x0 */
- PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */
+ MOVQ ( MM1, MM4 ) /* | x2 */
+ PFMUL ( REGOFF(16, ECX), MM3 ) /* x1*m5 | x1*m4 */
- ADD_L ( CONST(16), EDX ) /* next r */
- PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */
+ PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */
+ PFADD ( MM2, MM3 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
- PFACC ( MM4, MM3 ) /* x0*m00+x1*m10 | x0*m01+x1*m11 */
- MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */
+ PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */
+ PFADD ( REGOFF(48, ECX), MM3 ) /* x0*m1+...+m11 | x0*m0+x1*m4+m12 */
- PFADD ( MM2, MM3 ) /* x0*...*m10+m30| x0*m01+x1*m11+m31 */
- MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
+ PFMUL ( MM7, MM0 ) /* x1*m6 | x0*m2 */
+ PFADD ( MM4, MM3 ) /* r1 | r0 */
- MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
+ PFMUL ( REGOFF(40, ECX), MM1 ) /* | x2*m10 */
+ PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m14 | x2*m10 */
- ADD_L ( EDI, EAX ) /* next vertex */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TP2R_2) ) /* cnt > 0 ? -> process next vertex */
+ PFACC ( MM0, MM1 )
+
+ MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
+ PFACC ( MM1, MM1 ) /* | r2 */
+
+ MOVD ( MM1, REGOFF(-8, EDX) ) /* write r2 */
-ALIGNTEXT32
-LLBL(G3TP2R_3):
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */
+
+LLBL( G3TP3R_2 ):
FEMMS
POP_L ( EDI )
@@ -235,70 +281,71 @@ LLBL(G3TP2R_3):
-
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points3_2d_no_rot_raw)
-GLNAME( gl_3dnow_transform_points3_2d_no_rot_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points3_3d_no_rot_raw )
+GLNAME( gl_3dnow_transform_points3_3d_no_rot_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(3), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP2NRR_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP3NRR_2 ) )
PREFETCH ( REGIND(EAX) )
-
PREFETCHW ( REGIND(EDX) )
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
+ PUNPCKLDQ ( MM2, MM2 ) /* m22 | m22 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
+ MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
+ PUNPCKLDQ ( MM3, MM3 ) /* m32 | m32 */
-ALIGNTEXT32
-LLBL(G3TP2NRR_1):
+ALIGNTEXT16
+LLBL( G3TP3NRR_1 ):
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- PREFETCH ( REGIND(EAX) )
+ MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- ADD_L ( CONST(16), EDX ) /* next r */
+ ADD_L ( EDI, EAX ) /* next vertex */
- PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */
+ PREFETCHW ( REGIND(EAX) )
+ PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */
+ PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */
+ PFMUL ( MM2, MM5 ) /* | x2*m22 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
+ PFADD ( MM3, MM5 ) /* | x2*m22+m32 */
+ MOVQ ( MM4, REGIND(EDX) ) /* write r0, r1 */
- ADD_L ( EDI, EAX ) /* next vertex */
- DEC_L ( ESI ) /* decrement vertex counter */
+ ADD_L ( CONST(16), EDX ) /* next r */
+ DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TP2NRR_1) ) /* cnt > 0 ? -> process next vertex */
+ MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 */
+ JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TP2NRR_2):
+LLBL( G3TP3NRR_2 ):
FEMMS
POP_L ( EDI )
@@ -308,89 +355,69 @@ LLBL(G3TP2NRR_2):
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points3_3d_raw)
-GLNAME( gl_3dnow_transform_points3_3d_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points3_2d_raw )
+GLNAME( gl_3dnow_transform_points3_2d_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(3), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP3R_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP2R_3) )
PREFETCH ( REGIND(EAX) )
+ PREFETCHW ( REGIND(EDX) )
- PREFETCH ( REGIND(EDX) )
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
- MOVD ( REGOFF(8, ECX), MM7 ) /* | m2 */
- PUNPCKLDQ ( REGOFF(24, ECX), MM7 ) /* m6 | m2 */
+ MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
+ MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ALIGNTEXT16
+LLBL( G3TP2R_2 ):
-ALIGNTEXT32
-LLBL(G3TP3R_1):
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
+ ADD_L ( EDI, EAX ) /* next vertex */
PREFETCH ( REGIND(EAX) )
- MOVQ ( MM0, MM2 ) /* x1 | x0 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PUNPCKLDQ ( MM2, MM2 ) /* x0 | x0 */
- MOVQ ( MM0, MM3 ) /* x1 | x0 */
-
- PFMUL ( REGIND(ECX), MM2 ) /* x0*m1 | x0*m0 */
- PUNPCKHDQ ( MM3, MM3 ) /* x1 | x1 */
+ MOVQ ( MM3, MM4 ) /* x1 | x0 */
+ PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */
- MOVQ ( MM1, MM4 ) /* | x2 */
- PFMUL ( REGOFF(16, ECX), MM3 ) /* x1*m5 | x1*m4 */
+ ADD_L ( CONST(16), EDX ) /* next r */
+ PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */
- PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */
- PFADD ( MM2, MM3 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
+ PFACC ( MM4, MM3 ) /* x0*m00+x1*m10 | x0*m01+x1*m11 */
+ MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */
- PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */
- PFADD ( REGOFF(48, ECX), MM3 ) /* x0*m1+...+m11 | x0*m0+x1*m4+m12 */
+ PFADD ( MM2, MM3 ) /* x0*...*m10+m30 | x0*...*m11+m31 */
+ MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
- PFMUL ( MM7, MM0 ) /* x1*m6 | x0*m2 */
- PFADD ( MM4, MM3 ) /* r1 | r0 */
-
- PFMUL ( REGOFF(40, ECX), MM1 ) /* | x2*m10 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m14 | x2*m10 */
-
- PFACC ( MM0, MM1 )
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */
- MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
- PFACC ( MM1, MM1 ) /* | r2 */
-
- MOVD ( MM1, REGOFF(-8, EDX) ) /* write r2 */
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
-
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TP3R_1) ) /* cnt > 0 ? -> process next vertex */
-
-ALIGNTEXT32
-LLBL(G3TP3R_2):
+LLBL( G3TP2R_3 ):
FEMMS
POP_L ( EDI )
@@ -400,74 +427,62 @@ LLBL(G3TP3R_2):
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points3_3d_no_rot_raw)
-GLNAME( gl_3dnow_transform_points3_3d_no_rot_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points3_2d_no_rot_raw )
+GLNAME( gl_3dnow_transform_points3_2d_no_rot_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(3), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP3NRR_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP2NRR_2 ) )
PREFETCH ( REGIND(EAX) )
-
PREFETCHW ( REGIND(EDX) )
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
- PUNPCKLDQ ( MM2, MM2 ) /* m22 | m22 */
-
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
- PUNPCKLDQ ( MM3, MM3 ) /* m32 | m32 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
+ALIGNTEXT16
+LLBL( G3TP2NRR_1 ):
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-ALIGNTEXT32
-LLBL(G3TP3NRR_1):
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- ADD_L ( EDI, EAX ) /* next vertex */
+ MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
- PREFETCHW ( REGIND(EAX) )
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */
- PFMUL ( MM2, MM5 ) /* | x2*m22 */
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCH ( REGIND(EAX) )
- PFADD ( MM3, MM5 ) /* | x2*m22+m32 */
- MOVQ ( MM4, REGIND(EDX) ) /* write r0, r1 */
+ PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
+ ADD_L ( CONST(16), EDX ) /* next r */
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
+ PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */
- MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
+ MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
- JA ( LLBL(G3TP3NRR_1) ) /* cnt > 0 ? -> process next vertex */
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TP2NRR_1 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TP3NRR_2):
+LLBL( G3TP2NRR_2 ):
FEMMS
POP_L ( EDI )
@@ -477,90 +492,53 @@ LLBL(G3TP3NRR_2):
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points3_perspective_raw)
-GLNAME( gl_3dnow_transform_points3_perspective_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points3_identity_raw )
+GLNAME( gl_3dnow_transform_points3_identity_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
-
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TPPR_2) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- PREFETCH ( REGIND(EAX) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TPIR_2 ) )
PREFETCHW ( REGIND(EDX) )
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVQ ( REGOFF(32, ECX), MM1 ) /* m21 | m20 */
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
-
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
-
-ALIGNTEXT32
-LLBL(G3TPPR_1):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- PREFETCH ( REGIND(EAX) )
+ALIGNTEXT16
+LLBL( G3TPIR_1 ):
- PXOR ( MM7, MM7 ) /* 0 | 0 */
- MOVQ ( MM5, MM6 ) /* | x2 */
-
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- PFSUB ( MM5, MM7 ) /* | -x2 */
-
- PFMUL ( MM2, MM6 ) /* | x2*m22 */
- PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- PFMUL ( MM1, MM5 ) /* x2*m21 | x2*m20 */
-
- PFADD ( MM3, MM6 ) /* | x2*m22+m32 */
- PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */
+ PREFETCHW ( REGOFF(32, EDX) )
- MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVD ( MM6, REGOFF(-8, EDX) ) /* write r2 */
+ MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
+ MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
- MOVD ( MM7, REGOFF(-4, EDX) ) /* write r3 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
+ ADD_L ( EDI, EAX ) /* next vertex */
+ ADD_L ( CONST(16), EDX ) /* next r */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ DEC_L ( ESI ) /* decrement vertex counter */
+ MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TPPR_1) ) /* cnt > 0 ? -> process next vertex */
+ MOVD ( MM1, REGOFF(-8, EDX) ) /* | r2 */
+ JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TPPR_2):
+LLBL( G3TPIR_2 ):
FEMMS
POP_L ( EDI )
POP_L ( ESI )
RET
-
-
-
-
-
diff --git a/xc/extras/Mesa/src/X86/3dnow_xform_raw4.S b/xc/extras/Mesa/src/X86/3dnow_xform_raw4.S
index 17f584f75..c64564c8a 100644
--- a/xc/extras/Mesa/src/X86/3dnow_xform_raw4.S
+++ b/xc/extras/Mesa/src/X86/3dnow_xform_raw4.S
@@ -1,86 +1,105 @@
-#include "assyntax.h"
-
- SEG_TEXT
-
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.4
+ *
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
-#define VEC_SIZE_1 1
-#define VEC_SIZE_2 3
-#define VEC_SIZE_3 7
-#define VEC_SIZE_4 15
+#include "assyntax.h"
+#include "xform_args.h"
+ SEG_TEXT
+#define FRAME_OFFSET 4
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points4_general_raw)
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points4_general_raw )
GLNAME( gl_3dnow_transform_points4_general_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TPGR_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TPGR_2 ) )
PREFETCHW ( REGIND(EDX) )
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM4 ) /* x3 | x2 */
+ALIGNTEXT16
+LLBL( G3TPGR_1 ):
- ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-ALIGNTEXT32
-LLBL(G3TPGR_1):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
+ MOVQ ( REGOFF(8, EAX), MM4 ) /* x3 | x2 */
+ ADD_L ( EDI, EAX ) /* next vertex */
PREFETCH ( REGIND(EAX) )
- MOVQ ( MM0, MM2 ) /* x1 | x0 */
- MOVQ ( MM4, MM6 ) /* x3 | x2 */
+ MOVQ ( MM0, MM2 ) /* x1 | x0 */
+ MOVQ ( MM4, MM6 ) /* x3 | x2 */
- PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
- PUNPCKHDQ ( MM2, MM2 ) /* x1 | x1 */
+ PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
+ PUNPCKHDQ ( MM2, MM2 ) /* x1 | x1 */
- MOVQ ( MM0, MM1 ) /* x0 | x0 */
- ADD_L ( CONST(16), EDX ) /* next r */
+ MOVQ ( MM0, MM1 ) /* x0 | x0 */
+ ADD_L ( CONST(16), EDX ) /* next r */
- PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
- MOVQ ( MM2, MM3 ) /* x1 | x1 */
+ PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
+ MOVQ ( MM2, MM3 ) /* x1 | x1 */
- PFMUL ( REGOFF(8, ECX), MM1 ) /* x0*m3 | x0*m2 */
- PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */
+ PFMUL ( REGOFF(8, ECX), MM1 ) /* x0*m3 | x0*m2 */
+ PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */
- PFMUL ( REGOFF(16, ECX), MM2 ) /* x1*m5 | x1*m4 */
- MOVQ ( MM4, MM5 ) /* x2 | x2 */
+ PFMUL ( REGOFF(16, ECX), MM2 ) /* x1*m5 | x1*m4 */
+ MOVQ ( MM4, MM5 ) /* x2 | x2 */
- PFMUL ( REGOFF(24, ECX), MM3 ) /* x1*m7 | x1*m6 */
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
+ PFMUL ( REGOFF(24, ECX), MM3 ) /* x1*m7 | x1*m6 */
+ PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
- PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */
- MOVQ ( MM6, MM7 ) /* x3 | x3 */
+ PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */
+ MOVQ ( MM6, MM7 ) /* x3 | x3 */
- PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */
+ PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */
PFADD ( MM0, MM2 )
- PFMUL ( REGOFF(48, ECX), MM6 ) /* x3*m13 | x3*m12 */
+ PFMUL ( REGOFF(48, ECX), MM6 ) /* x3*m13 | x3*m12 */
PFADD ( MM1, MM3 )
- PFMUL ( REGOFF(56, ECX), MM7 ) /* x3*m15 | x3*m14 */
+ PFMUL ( REGOFF(56, ECX), MM7 ) /* x3*m15 | x3*m14 */
PFADD ( MM4, MM6 )
PFADD ( MM5, MM7 )
@@ -90,17 +109,11 @@ LLBL(G3TPGR_1):
MOVQ ( MM6, REGOFF(-16, EDX) )
MOVQ ( MM7, REGOFF(-8, EDX) )
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
-
- MOVQ ( REGOFF(8, EAX), MM4 ) /* x3 | x2 */
- ADD_L ( EDI, EAX ) /* next vertex */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TPGR_1) ) /* cnt > 0 ? -> process next vertex */
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-ALIGNTEXT32
-LLBL(G3TPGR_2):
+LLBL( G3TPGR_2 ):
FEMMS
POP_L ( EDI )
@@ -110,57 +123,77 @@ LLBL(G3TPGR_2):
-
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points4_identity_raw)
-GLNAME( gl_3dnow_transform_points4_identity_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points4_perspective_raw )
+GLNAME( gl_3dnow_transform_points4_perspective_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
+
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TPPR_2 ) )
+
+ PREFETCH ( REGIND(EAX) )
+ PREFETCHW ( REGIND(EDX) )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TPIR_2) )
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */
+ MOVD ( REGOFF(40, ECX), MM1 ) /* | m22 */
+ PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m32 | m22 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ MOVQ ( REGOFF(32, ECX), MM2 ) /* m21 | m20 */
+ PXOR ( MM7, MM7 ) /* 0 | 0 */
-ALIGNTEXT32
-LLBL(G3TPIR_1):
+ALIGNTEXT16
+LLBL( G3TPPR_1 ):
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- PREFETCH ( REGIND(EAX) )
+ MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
+ MOVD ( REGOFF(8, EAX), MM3 ) /* | x2 */
+
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */
- ADD_L ( CONST(16), EDX ) /* next r */
- MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */
+ MOVQ ( MM5, MM6 ) /* x3 | x2 */
+ PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- MOVQ ( MM1, REGOFF(-8, EDX) ) /* r3 | r2 */
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
+ PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */
+ ADD_L ( CONST(16), EDX ) /* next r */
- MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ PFMUL ( MM2, MM5 ) /* x2*m21 | x2*m20 */
+ PFSUBR ( MM7, MM3 ) /* | -x2 */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TPIR_1) ) /* cnt > 0 ? -> process next vertex */
+ PFMUL ( MM1, MM6 ) /* x3*m32 | x2*m22 */
+ PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */
-ALIGNTEXT32
-LLBL(G3TPIR_2):
+ PFACC ( MM3, MM6 ) /* -x2 | x2*m22+x3*m32 */
+ MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */
+
+ MOVQ ( MM6, REGOFF(-8, EDX) ) /* write r2, r3 */
+
+ DEC_L ( ESI ) /* decrement vertex counter */
+
+ JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */
+
+LLBL( G3TPPR_2 ):
FEMMS
POP_L ( EDI )
@@ -170,77 +203,85 @@ LLBL(G3TPIR_2):
-
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points4_2d_raw)
-GLNAME( gl_3dnow_transform_points4_2d_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points4_3d_raw )
+GLNAME( gl_3dnow_transform_points4_3d_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP2R_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP3R_2 ) )
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
+ MOVD ( REGOFF(8, ECX), MM6 ) /* | m2 */
+ PUNPCKLDQ ( REGOFF(24, ECX), MM6 ) /* m6 | m2 */
- MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
+ MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */
+ PUNPCKLDQ ( REGOFF(56, ECX), MM7 ) /* m14 | m10 */
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
+ALIGNTEXT16
+LLBL( G3TP3R_1 ):
- MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
+ MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */
+ MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ PREFETCH ( REGOFF(32, EAX) ) /* hopefully array is tightly packed */
-ALIGNTEXT32
-LLBL(G3TP2R_1):
+ MOVQ ( MM2, MM0 ) /* x1 | x0 */
+ MOVQ ( MM3, MM4 ) /* x3 | x2 */
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ MOVQ ( MM0, MM1 ) /* x1 | x0 */
+ MOVQ ( MM4, MM5 ) /* x3 | x2 */
- PREFETCH ( REGIND(EAX) )
+ PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
+ PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */
- MOVQ ( MM3, MM4 ) /* x1 | x0 */
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
+ PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
+ PUNPCKLDQ ( MM3, MM3 ) /* x2 | x2 */
- PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
+ PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */
+ PUNPCKHDQ ( MM4, MM4 ) /* x3 | x3 */
- PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */
- ADD_L ( CONST(16), EDX ) /* next r */
+ PFMUL ( MM6, MM2 ) /* x1*m6 | x0*m2 */
+ PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
- PFACC ( MM4, MM3 ) /* x0*m01+x1*m11 | x0*m00+x1*m10 */
- PFMUL ( MM2, MM6 ) /* x3*m31 | x3*m30 */
+ PFMUL ( REGOFF(32, ECX), MM3 ) /* x2*m9 | x2*m8 */
+ ADD_L ( CONST(16), EDX ) /* next r */
- PFADD ( MM6, MM3 ) /* r1 | r0 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
+ PFMUL ( REGOFF(48, ECX), MM4 ) /* x3*m13 | x3*m12 */
+ PFADD ( MM1, MM3 ) /* x0*m1+..+x2*m9 | x0*m0+...+x2*m8 */
- MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
+ PFMUL ( MM7, MM5 ) /* x3*m14 | x2*m10 */
+ PFADD ( MM3, MM4 ) /* r1 | r0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ PFACC ( MM2, MM5 ) /* x0*m2+x1*m6 | x2*m10+x3*m14 */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TP2R_1) ) /* cnt > 0 ? -> process next vertex */
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PFACC ( MM0, MM5 ) /* r3 | r2 */
-ALIGNTEXT32
-LLBL(G3TP2R_2):
+ MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
+ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
+
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */
+
+LLBL( G3TP3R_2 ):
FEMMS
POP_L ( EDI )
@@ -250,70 +291,70 @@ LLBL(G3TP2R_2):
-
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points4_2d_no_rot_raw)
-GLNAME( gl_3dnow_transform_points4_2d_no_rot_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points4_3d_no_rot_raw )
+GLNAME( gl_3dnow_transform_points4_3d_no_rot_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP2NRR_3) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP3NRR_2 ) )
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
+ MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
+ PUNPCKLDQ ( REGOFF(56, ECX), MM2 ) /* m32 | m22 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
+ MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ALIGNTEXT16
+LLBL( G3TP3NRR_1 ):
-ALIGNTEXT32
-LLBL(G3TP2NRR_2):
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
+ MOVD ( REGOFF(12, EAX), MM7 ) /* | x3 */
- PREFETCH ( REGIND(EAX) )
+ ADD_L ( EDI, EAX ) /* next vertex */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
+ PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */
- ADD_L ( CONST(16), EDX ) /* next r */
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
+ MOVQ ( MM5, MM6 ) /* x3 | x2 */
+ PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */
- PFADD ( MM4, MM6 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */
+ PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
+ PFMUL ( MM2, MM5 ) /* x3*m32 | x2*m22 */
- MOVQ ( MM6, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
+ PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */
+ PFACC ( MM7, MM5 ) /* x3 | x2*m22+x3*m32 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
+ PFADD ( MM6, MM4 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */
+ ADD_L ( CONST(16), EDX ) /* next r */
- ADD_L ( EDI, EAX ) /* next vertex */
- DEC_L ( ESI ) /* decrement vertex counter */
+ MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
+ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
- JA ( LLBL(G3TP2NRR_2) ) /* cnt > 0 ? -> process next vertex */
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TP2NRR_3):
+LLBL( G3TP3NRR_2 ):
FEMMS
POP_L ( EDI )
@@ -323,92 +364,71 @@ LLBL(G3TP2NRR_3):
-
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points4_3d_raw)
-GLNAME( gl_3dnow_transform_points4_3d_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points4_2d_raw )
+GLNAME( gl_3dnow_transform_points4_2d_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP3R_2) )
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP2R_2 ) )
- MOVD ( REGOFF(8, ECX), MM6 ) /* | m2 */
- PUNPCKLDQ ( REGOFF(24, ECX), MM6 ) /* m6 | m2 */
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
- MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM7 ) /* m14 | m10 */
+ MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
- MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */
+ MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-ALIGNTEXT32
-LLBL(G3TP3R_1):
+ALIGNTEXT16
+LLBL( G3TP2R_1 ):
PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- PREFETCH ( REGOFF(32, EAX) ) /* hopefully array is tightly packed */
-
- MOVQ ( MM2, MM0 ) /* x1 | x0 */
- MOVQ ( MM3, MM4 ) /* x3 | x2 */
-
- MOVQ ( MM0, MM1 ) /* x1 | x0 */
- MOVQ ( MM4, MM5 ) /* x3 | x2 */
-
- PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
- PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */
-
- PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
- PUNPCKLDQ ( MM3, MM3 ) /* x2 | x2 */
+ MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
+ MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */
- PUNPCKHDQ ( MM4, MM4 ) /* x3 | x3 */
-
- PFMUL ( MM6, MM2 ) /* x1*m6 | x0*m2 */
- PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
-
- PFMUL ( REGOFF(32, ECX), MM3 ) /* x2*m9 | x2*m8 */
- ADD_L ( CONST(16), EDX ) /* next r */
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCH ( REGIND(EAX) )
- PFMUL ( REGOFF(48, ECX), MM4 ) /* x3*m13 | x3*m12 */
- PFADD ( MM1, MM3 ) /* x0*m1+..+x2*m9| x0*m0+...+x2*m8 */
-
- PFMUL ( MM7, MM5 ) /* x3*m14 | x2*m10 */
- PFADD ( MM3, MM4 ) /* r1 | r0 */
+ MOVQ ( MM3, MM4 ) /* x1 | x0 */
+ MOVQ ( MM5, MM6 ) /* x3 | x2 */
- PFACC ( MM2, MM5 ) /* x0*m2+x1*m6 | x2*m10+x3*m14 */
- MOVD ( REGOFF(12, EAX), MM0 ) /* | x3 */
+ PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */
+ PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
- ADD_L ( EDI, EAX ) /* next vertex */
- PFACC ( MM0, MM5 ) /* r3 | r2 */
+ PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */
+ ADD_L ( CONST(16), EDX ) /* next r */
- MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
+ PFACC ( MM4, MM3 ) /* x0*m01+x1*m11 | x0*m00+x1*m10 */
+ PFMUL ( MM2, MM6 ) /* x3*m31 | x3*m30 */
- MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */
+ PFADD ( MM6, MM3 ) /* r1 | r0 */
+ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TP3R_1) ) /* cnt > 0 ? -> process next vertex */
+ MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TP2R_1 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TP3R_2):
+LLBL( G3TP2R_2 ):
FEMMS
POP_L ( EDI )
@@ -418,78 +438,64 @@ LLBL(G3TP3R_2):
-
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points4_3d_no_rot_raw)
-GLNAME( gl_3dnow_transform_points4_3d_no_rot_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points4_2d_no_rot_raw )
+GLNAME( gl_3dnow_transform_points4_2d_no_rot_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
-
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TP3NRR_2) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TP2NRR_3 ) )
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM2 ) /* m32 | m22 */
+ MOVD ( REGIND(ECX), MM0 ) /* | m00 */
+ PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
+ MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- MOVD ( REGOFF(12, EAX), MM7 ) /* | x3 */
+ALIGNTEXT16
+LLBL( G3TP2NRR_2 ):
- ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-ALIGNTEXT32
-LLBL(G3TP3NRR_1):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+ MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */
-
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
- PFMUL ( MM2, MM5 ) /* x3*m32 | x2*m22 */
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCH ( REGIND(EAX) )
- PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */
- PFACC ( MM7, MM5 ) /* x3 | x2*m22+x3*m32 */
+ PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
+ MOVQ ( MM5, MM6 ) /* x3 | x2 */
- PFADD ( MM6, MM4 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */
- ADD_L ( CONST(16), EDX ) /* next r */
+ ADD_L ( CONST(16), EDX ) /* next r */
+ PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
- MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
+ PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */
+ PFADD ( MM4, MM6 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
+ MOVQ ( MM6, REGOFF(-16, EDX) ) /* write r0, r1 */
+ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
- MOVD ( REGOFF(12, EAX), MM7 ) /* | x3 */
- ADD_L ( EDI, EAX ) /* next vertex */
+ DEC_L ( ESI ) /* decrement vertex counter */
- DEC_L ( ESI ) /* decrement vertex counter */
- JA ( LLBL(G3TP3NRR_1) ) /* cnt > 0 ? -> process next vertex */
+ JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TP3NRR_2):
+LLBL( G3TP2NRR_3 ):
FEMMS
POP_L ( EDI )
@@ -499,87 +505,53 @@ LLBL(G3TP3NRR_2):
-ALIGNTEXT32
-GLOBL GLNAME(gl_3dnow_transform_points4_perspective_raw)
-GLNAME( gl_3dnow_transform_points4_perspective_raw ):
+ALIGNTEXT16
+GLOBL GLNAME( gl_3dnow_transform_points4_identity_raw )
+GLNAME( gl_3dnow_transform_points4_identity_raw ):
PUSH_L ( ESI )
- MOV_L ( REGOFF(8, ESP), ECX )
- MOV_L ( REGOFF(12, ESP), ESI )
- MOV_L ( REGOFF(16, ESP), EAX )
- MOV_L ( CONST(4), REGOFF(16, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(20, ECX) )
- MOV_L ( REGOFF(8, EAX), EDX )
- MOV_L ( EDX, REGOFF(8, ECX) )
+
+ MOV_L ( ARG_DEST, ECX )
+ MOV_L ( ARG_MATRIX, ESI )
+ MOV_L ( ARG_SOURCE, EAX )
+ MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
+ OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
+ MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
+ MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
PUSH_L ( EDI )
- MOV_L ( REGOFF(4, ECX), EDX )
+ MOV_L ( REGOFF(V4F_START, ECX), EDX )
MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(8, EAX), ESI )
- MOV_L ( REGOFF(12, EAX), EDI )
- MOV_L ( REGOFF(4, EAX), EAX )
-
- CMP_L ( CONST(0), ESI )
- JE ( LLBL(G3TPPR_2) )
-
- PREFETCH ( REGIND(EAX) )
-
- PREFETCHW ( REGIND(EDX) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVD ( REGOFF(40, ECX), MM1 ) /* | m22 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m32 | m22 */
-
- MOVQ ( REGOFF(32, ECX), MM2 ) /* m21 | m20 */
- PXOR ( MM7, MM7 ) /* 0 | 0 */
+ MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
+ MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
+ MOV_L ( REGOFF(V4F_START, EAX), EAX )
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- MOVD ( REGOFF(8, EAX), MM3 ) /* | x2 */
+ TEST_L ( ESI, ESI )
+ JZ ( LLBL( G3TPIR_2 ) )
- ADD_L ( EDI, EAX ) /* next vertex */
-
-ALIGNTEXT32
-LLBL(G3TPPR_1):
+ALIGNTEXT16
+LLBL( G3TPIR_1 ):
PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
+
+ MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
+ MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */
- PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */
-
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PFMUL ( MM2, MM5 ) /* x2*m21 | x2*m20 */
- PFSUBR ( MM7, MM3 ) /* | -x2 */
-
- PFMUL ( MM1, MM6 ) /* x3*m32 | x2*m22 */
- PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */
-
- PFACC ( MM3, MM6 ) /* -x2 | x2*m22+x3*m32 */
- MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */
-
- MOVQ ( MM6, REGOFF(-8, EDX) ) /* write r2, r3 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
+ ADD_L ( EDI, EAX ) /* next vertex */
+ PREFETCH ( REGIND(EAX) )
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- MOVD ( REGOFF(8, EAX), MM3 ) /* | x2 */
+ ADD_L ( CONST(16), EDX ) /* next r */
+ MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */
- ADD_L ( EDI, EAX ) /* next vertex */
- DEC_L ( ESI ) /* decrement vertex counter */
+ MOVQ ( MM1, REGOFF(-8, EDX) ) /* r3 | r2 */
- JA ( LLBL(G3TPPR_1) ) /* cnt > 0 ? -> process next vertex */
+ DEC_L ( ESI ) /* decrement vertex counter */
+ JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */
-ALIGNTEXT32
-LLBL(G3TPPR_2):
+LLBL( G3TPIR_2 ):
FEMMS
POP_L ( EDI )
POP_L ( ESI )
RET
-