11b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
21b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes/*
31b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * Mesa 3-D graphics library
41b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * Version:  3.5
51b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes *
61b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
71b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes *
81b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * Permission is hereby granted, free of charge, to any person obtaining a
91b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * copy of this software and associated documentation files (the "Software"),
101b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * to deal in the Software without restriction, including without limitation
111b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * the rights to use, copy, modify, merge, publish, distribute, sublicense,
121b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * and/or sell copies of the Software, and to permit persons to whom the
131b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * Software is furnished to do so, subject to the following conditions:
141b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes *
151b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * The above copyright notice and this permission notice shall be included
161b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * in all copies or substantial portions of the Software.
171b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes *
181b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
191b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
201b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
211b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
221b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
231b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
241b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes */
251b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
26462183fe4cb6df6d90632d9e2cee881c8d26b1cbAlan Hourihane#ifdef USE_SSE_ASM
273474e9de924d92a941b4ea33ecc694f5fad2651fJosé Fonseca#include "assyntax.h"
281b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes#include "matypes.h"
291b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes#include "xform_args.h"
301b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
311b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SEG_TEXT
321b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
331b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes#define FRAME_OFFSET	8
341b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
351b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes#define SRC(i)		REGOFF(i * 4, ESI)
361b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes#define DST(i)		REGOFF(i * 4, EDI)
371b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes#define MAT(i)		REGOFF(i * 4, EDX)
381b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
391b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes#define SELECT(r0, r1, r2, r3)	CONST( r0 * 64 + r1 * 16 + r2 * 4 + r3 )
401b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
411b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
421b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesALIGNTEXT16
431b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesGLOBL GLNAME( _mesa_sse_transform_points4_general )
44932dee87e3002be87dc3bcc49efd8ac9ac3e1fa4Brian PaulHIDDEN(_mesa_sse_transform_points4_general)
451b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesGLNAME( _mesa_sse_transform_points4_general ):
461b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
471b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PUSH_L( ESI )
481b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PUSH_L( EDI )
491b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
501b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_SOURCE, ESI )
511b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_DEST, EDI )
521b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
531b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_MATRIX, EDX )
541b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
551b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
561b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	TEST_L( ECX, ECX )			/* verify non-zero count */
571b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	JE( LLBL( sse_general_done ) )
581b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
591b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )	/* stride */
601b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
611b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
621b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )	/* set dest count */
631b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )/* set dest size */
641b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
651b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_START, ESI), ESI )	/* ptr to first source vertex */
661b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_START, EDI), EDI )	/* ptr to first dest vertex */
671b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
681b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PREFETCHT0( REGIND(ESI) )
691b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
701b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(0), XMM4 )			/* m3  | m2  | m1  | m0  */
711b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(4), XMM5 )			/* m7  | m6  | m5  | m4  */
721b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(8), XMM6 )			/* m11 | m10 | m9  | m8  */
731b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(12), XMM7 )			/* m15 | m14 | m13 | m12 */
741b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
751b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesALIGNTEXT16
761b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesLLBL( sse_general_loop ):
771b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
781b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(0), XMM0 )			/* ox */
791b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM0, XMM0 )	/* ox | ox | ox | ox */
801b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM4, XMM0 )			/* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
811b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
821b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(1), XMM1 )			/* oy */
831b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM1, XMM1 )	/* oy | oy | oy | oy */
841b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM5, XMM1 )			/* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
851b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
861b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(2), XMM2 )			/* oz */
871b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM2, XMM2 )	/* oz | oz | oz | oz */
881b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM6, XMM2 )			/* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
891b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
901b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(3), XMM3 )			/* ow */
911b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM3, XMM3 )	/* ow | ow | ow | ow */
921b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM7, XMM3 )			/* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
931b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
941b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADDPS( XMM1, XMM0 )			/* ox*m3+oy*m7 | ... */
951b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADDPS( XMM2, XMM0 )			/* ox*m3+oy*m7+oz*m11 | ... */
961b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADDPS( XMM3, XMM0 )			/* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
971b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( XMM0, DST(0) )			/* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
981b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
991b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADD_L( CONST(16), EDI )
1001b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADD_L( EAX, ESI )
1011b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1021b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	DEC_L( ECX )
1031b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	JNZ( LLBL( sse_general_loop ) )
1041b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1051b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesLLBL( sse_general_done ):
1061b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1071b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	POP_L( EDI )
1081b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	POP_L( ESI )
1091b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	RET
1101b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1111b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1121b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1131b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1141b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesALIGNTEXT4
1151b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesGLOBL GLNAME( _mesa_sse_transform_points4_3d )
116932dee87e3002be87dc3bcc49efd8ac9ac3e1fa4Brian PaulHIDDEN(_mesa_sse_transform_points4_3d)
1171b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesGLNAME( _mesa_sse_transform_points4_3d ):
1181b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1191b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PUSH_L( ESI )
1201b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PUSH_L( EDI )
1211b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1221b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_SOURCE, ESI )		/* ptr to source GLvector4f */
1231b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_DEST, EDI )			/* ptr to dest GLvector4f */
1241b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1251b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_MATRIX, EDX )		/* ptr to matrix */
1261b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_COUNT, ESI), ECX )	/* source count */
1271b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1281b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	TEST_L( ECX, ECX)
1291b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	JZ( LLBL(K_GTP43P3DR_finish) )		/* count was zero; go to finish */
1301b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1311b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )	/* stride */
1321b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
1331b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1341b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )	/* set dest count */
1351b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )/* set dest size */
1361b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1371b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHL_L( CONST(4), ECX )			/* count *= 16 */
1381b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_START, ESI), ESI )	/* ptr to first source vertex */
1391b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1401b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_START, EDI), EDI )	/* ptr to first dest vertex */
1411b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADD_L( EDI, ECX )			/* count += dest ptr */
1421b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1431b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(0), XMM0 )			/* m3  | m2  | m1  |  m0 */
1441b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(4), XMM1 )			/* m7  | m6  | m5  |  m4 */
1451b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(8), XMM2 )			/* m11 | m10 | m9  |  m8 */
1461b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( MAT(12), XMM3 )			/* m15 | m14 | m13 | m12 */
1471b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1481b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesALIGNTEXT32
1491b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesLLBL( K_GTP43P3DR_top ):
1501b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(0), XMM4 )			/* ox */
1511b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM4, XMM4 )	/* ox | ox | ox | ox */
1521b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM0, XMM4 )			/* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
1531b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1541b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(1), XMM5 )			/* oy */
1551b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM5, XMM5 )	/* oy | oy | oy | oy */
1561b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM1, XMM5 )			/* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
1571b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1581b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(2), XMM6 )			/* oz */
1591b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM6, XMM6 )	/* oz | oz | oz | oz */
1601b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM2, XMM6 )			/* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
1611b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1621b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(3), XMM7 )			/* ow */
1631b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	SHUFPS( CONST(0x0), XMM7, XMM7 )	/* ow | ow | ow | ow */
1641b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MULPS( XMM3, XMM7 )			/* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
1651b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1661b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADDPS( XMM5, XMM4 )			/* ox*m3+oy*m7 | ... */
1671b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADDPS( XMM6, XMM4 )			/* ox*m3+oy*m7+oz*m11 | ... */
1681b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADDPS( XMM7, XMM4 )			/* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
1691b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( XMM4, DST(0) )			/* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
1701b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1711b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( SRC(3), XMM4 )			/* ow */
1721b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVSS( XMM4, DST(3) )			/* ->D(3) */
1731b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1741b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesLLBL( K_GTP43P3DR_skip ):
1751b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADD_L( CONST(16), EDI )
1761b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADD_L( EAX, ESI )
1771b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	CMP_L( ECX, EDI )
1781b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	JNE( LLBL(K_GTP43P3DR_top) )
1791b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1801b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesLLBL( K_GTP43P3DR_finish ):
1811b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	POP_L( EDI )
1821b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	POP_L( ESI )
1831b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	RET
1841b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1851b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1861b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesALIGNTEXT16
1871b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesGLOBL GLNAME( _mesa_sse_transform_points4_identity )
188932dee87e3002be87dc3bcc49efd8ac9ac3e1fa4Brian PaulHIDDEN(_mesa_sse_transform_points4_identity)
1891b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesGLNAME( _mesa_sse_transform_points4_identity ):
1901b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1911b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PUSH_L( ESI )
1921b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PUSH_L( EDI )
1931b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1941b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_SOURCE, ESI )
1951b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_DEST, EDI )
1961b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
1971b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ARG_MATRIX, EDX )
1981b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
1991b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2001b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	TEST_L( ECX, ECX )			/* verify non-zero count */
2011b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	JE( LLBL( sse_identity_done ) )
2021b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2031b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )	/* stride */
2041b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
2051b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2061b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )	/* set dest count */
2071b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )/* set dest size */
2081b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2091b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_START, ESI), ESI )	/* ptr to first source vertex */
2101b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOV_L( REGOFF(V4F_START, EDI), EDI )	/* ptr to first dest vertex */
2111b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2121b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesALIGNTEXT16
2131b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesLLBL( sse_identity_loop ):
2141b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2151b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	PREFETCHNTA( REGOFF(32, ESI) )
2161b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2171b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( REGIND(ESI), XMM0 )
2181b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADD_L( EAX, ESI )
2191b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2201b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	MOVAPS( XMM0, REGIND(EDI) )
2211b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	ADD_L( CONST(16), EDI )
2221b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2231b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	DEC_L( ECX )
2241b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	JNZ( LLBL( sse_identity_loop ) )
2251b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2261b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth HughesLLBL( sse_identity_done ):
2271b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes
2281b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	POP_L( EDI )
2291b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	POP_L( ESI )
2301b2fef5c28a40cd001598071e25b876ad4fccdd1Gareth Hughes	RET
231462183fe4cb6df6d90632d9e2cee881c8d26b1cbAlan Hourihane#endif
232fcdc6a7d2488defd66bc7e8398c6d8c9a6190a1aKristian Høgsberg
233fcdc6a7d2488defd66bc7e8398c6d8c9a6190a1aKristian Høgsberg#if defined (__ELF__) && defined (__linux__)
234fcdc6a7d2488defd66bc7e8398c6d8c9a6190a1aKristian Høgsberg	.section .note.GNU-stack,"",%progbits
235fcdc6a7d2488defd66bc7e8398c6d8c9a6190a1aKristian Høgsberg#endif
236