diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2001-10-22 01:21:16 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2001-10-22 01:21:16 +0000 |
commit | 45d21ca58755098e8fd47e1083c68e244c4f903c (patch) | |
tree | 87def99e8717cac416e72ef42ea05451ded05cf5 /src/mesa/x86 | |
parent | 52d4c6ebb52a40a707ea12058c07875b71c7f4e7 (diff) | |
download | external_mesa3d-45d21ca58755098e8fd47e1083c68e244c4f903c.zip external_mesa3d-45d21ca58755098e8fd47e1083c68e244c4f903c.tar.gz external_mesa3d-45d21ca58755098e8fd47e1083c68e244c4f903c.tar.bz2 |
applied Andrew Lewycky's patches
Diffstat (limited to 'src/mesa/x86')
-rw-r--r-- | src/mesa/x86/3dnow_normal.S | 92 | ||||
-rw-r--r-- | src/mesa/x86/3dnow_xform3.S | 90 | ||||
-rw-r--r-- | src/mesa/x86/3dnow_xform4.S | 101 |
3 files changed, 104 insertions, 179 deletions
diff --git a/src/mesa/x86/3dnow_normal.S b/src/mesa/x86/3dnow_normal.S index f7cc069..f13392e 100644 --- a/src/mesa/x86/3dnow_normal.S +++ b/src/mesa/x86/3dnow_normal.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_normal.S,v 1.1 2001/03/29 06:46:16 gareth Exp $ */ +/* $Id: 3dnow_normal.S,v 1.2 2001/10/22 01:21:16 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -91,12 +91,12 @@ GLNAME(_mesa_3dnow_transform_normalize_normals): 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 */ @@ -126,9 +126,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) ) @@ -137,9 +134,6 @@ LLBL (G3TN_transform): POP_L ( EAX ) /* now normalizing ... */ POP_L ( EBP ) - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ - CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */ JE ( LLBL (G3TN_norm ) ) /* calculate lengths */ @@ -149,6 +143,9 @@ LLBL (G3TN_norm_w_lengths): PREFETCHW ( REGOFF(12,EAX) ) + MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ + MOVD ( REGIND (EDI), MM3 ) /* | length (x) */ PFMUL ( MM3, MM1 ) /* | x2 (normalize*/ @@ -166,8 +163,6 @@ LLBL (G3TN_norm_w_lengths): ADD_L ( CONST(12), EAX ) /* next r */ DEC_L ( EBP ) /* decrement normal counter */ - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ JA ( LLBL (G3TN_norm_w_lengths) ) JMP ( LLBL (G3TN_exit_3dnow) ) @@ -262,9 +257,6 @@ GLNAME(_mesa_3dnow_transform_normalize_normals_no_rot): 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 */ @@ -276,6 +268,9 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */ PREFETCHW ( REGIND(EAX) ) + MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */ + PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */ ADD_L ( STRIDE, EDX ) /* next normal */ @@ -296,9 +291,6 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */ 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) ) @@ -307,6 +299,9 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */ PREFETCHW ( REGIND(EAX) ) + MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */ + PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */ ADD_L ( CONST(12), EAX ) /* next r */ @@ -341,9 +336,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,16 +388,16 @@ GLNAME(_mesa_3dnow_transform_rescale_normals_no_rot): 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): PREFETCHW ( REGIND(EAX) ) - + + MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */ + PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */ ADD_L ( STRIDE, EDX ) /* next normal */ @@ -418,9 +410,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 @@ -477,16 +466,17 @@ GLNAME(_mesa_3dnow_transform_rescale_normals): 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): PREFETCHW ( REGIND(EAX) ) + MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */ + MOVQ ( MM0, MM1 ) /* x1 | x0 */ PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */ @@ -515,9 +505,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) ) @@ -564,14 +551,14 @@ GLNAME(_mesa_3dnow_transform_normals_no_rot): 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): PREFETCHW ( REGIND(EAX) ) + MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */ + PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */ ADD_L ( STRIDE, EDX) /* next normal */ @@ -584,9 +571,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 @@ -636,14 +620,14 @@ GLNAME(_mesa_3dnow_transform_normals): 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): PREFETCHW ( REGIND(EAX) ) + MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */ + MOVQ ( MM0, MM1 ) /* x1 | x0 */ PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */ @@ -671,10 +655,8 @@ 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) ) FEMMS @@ -713,9 +695,6 @@ GLNAME(_mesa_3dnow_normalize_normals): 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 */ @@ -724,6 +703,9 @@ LLBL (G3N_norm1): /* use precalculated lengths */ PREFETCH ( REGIND(EAX) ) + MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */ + MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */ + MOVD ( REGIND(EDX), MM3 ) /* | length (x) */ PFMUL ( MM3, MM1 ) /* | x2 (normalized) */ @@ -741,8 +723,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) ) @@ -757,6 +737,9 @@ LLBL (G3N_norm2): /* need to calculate lengths */ PREFETCH ( REGIND(ECX) ) + MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */ + MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */ + PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */ MOVQ ( MM1, MM4 ) /* | x2 */ @@ -783,8 +766,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): @@ -825,14 +806,14 @@ GLNAME(_mesa_3dnow_rescale_normals): MOVD ( ARG_SCALE, MM0 ) /* scale */ PUNPCKLDQ ( MM0, MM0 ) - MOVQ ( REGIND(ECX), MM1 ) /* x1 | x0 */ - MOVD ( REGOFF(8, ECX), MM2 ) /* | x2 */ - ALIGNTEXT32 LLBL (G3R_rescale): PREFETCHW ( REGIND(EAX) ) + MOVQ ( REGIND(ECX), MM1 ) /* x1 | x0 */ + MOVD ( REGOFF(8, ECX), MM2 ) /* | x2 */ + PFMUL ( MM0, MM1 ) /* x1*scale | x0*scale */ ADD_L ( STRIDE, ECX ) /* next normal */ @@ -845,9 +826,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 diff --git a/src/mesa/x86/3dnow_xform3.S b/src/mesa/x86/3dnow_xform3.S index 7d225b3..c1e3bf9 100644 --- a/src/mesa/x86/3dnow_xform3.S +++ b/src/mesa/x86/3dnow_xform3.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_xform3.S,v 1.1 2001/03/29 06:46:16 gareth Exp $ */ +/* $Id: 3dnow_xform3.S,v 1.2 2001/10/22 01:21:16 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -59,15 +59,15 @@ GLNAME( _mesa_3dnow_transform_points3_general ): 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 ): 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 */ @@ -103,10 +103,6 @@ LLBL( G3TPGR_1 ): PFADD ( MM4, MM5 ) /* r3 | r2 */ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM2 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -156,15 +152,15 @@ GLNAME( _mesa_3dnow_transform_points3_perspective ): MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - 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) ) PXOR ( MM7, MM7 ) /* 0 | 0 */ @@ -186,10 +182,6 @@ LLBL( G3TPPR_1 ): MOVD ( MM6, REGOFF(-8, EDX) ) /* write r2 */ MOVD ( MM7, REGOFF(-4, EDX) ) /* write r3 */ - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - ADD_L ( EDI, EAX ) /* next vertex */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -235,15 +227,16 @@ GLNAME( _mesa_3dnow_transform_points3_3d ): MOVD ( REGOFF(8, ECX), MM7 ) /* | m2 */ PUNPCKLDQ ( REGOFF(24, ECX), MM7 ) /* m6 | m2 */ - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ ALIGNTEXT16 LLBL( G3TP3R_1 ): PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ + + MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ + + ADD_L ( EDI, EAX ) /* next vertex */ PREFETCH ( REGIND(EAX) ) MOVQ ( MM0, MM2 ) /* x1 | x0 */ @@ -276,11 +269,7 @@ LLBL( G3TP3R_1 ): 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 */ JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -332,18 +321,19 @@ GLNAME( _mesa_3dnow_transform_points3_3d_no_rot ): MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ PUNPCKLDQ ( MM3, MM3 ) /* m32 | m32 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ ALIGNTEXT16 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 */ + + ADD_L ( EDI, EAX ) /* next vertex */ PREFETCHW ( REGIND(EAX) ) + PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */ @@ -356,9 +346,6 @@ LLBL( G3TP3NRR_1 ): DEC_L ( ESI ) /* decrement vertex counter */ MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */ LLBL( G3TP3NRR_2 ): @@ -406,15 +393,16 @@ GLNAME( _mesa_3dnow_transform_points3_2d ): PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */ MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */ - - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - ADD_L ( EDI, EAX ) /* next vertex */ ALIGNTEXT16 LLBL( G3TP2R_2 ): 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 ( MM3, MM4 ) /* x1 | x0 */ @@ -429,10 +417,6 @@ LLBL( G3TP2R_2 ): PFADD ( MM2, MM3 ) /* x0*...*m10+m30 | x0*...*m11+m31 */ MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */ - MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */ @@ -478,16 +462,17 @@ GLNAME( _mesa_3dnow_transform_points3_2d_no_rot ): PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */ MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - ADD_L ( EDI, EAX ) /* next vertex */ ALIGNTEXT16 LLBL( G3TP2NRR_1 ): PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ + + MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ + + ADD_L ( EDI, EAX ) /* next vertex */ PREFETCH ( REGIND(EAX) ) PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ @@ -498,10 +483,6 @@ LLBL( G3TP2NRR_1 ): MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */ MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TP2NRR_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -542,14 +523,14 @@ GLNAME( _mesa_3dnow_transform_points3_identity ): PREFETCHW ( REGIND(EDX) ) - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ - ALIGNTEXT16 LLBL( G3TPIR_1 ): PREFETCHW ( REGOFF(32, EDX) ) + MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ + MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ + ADD_L ( EDI, EAX ) /* next vertex */ ADD_L ( CONST(16), EDX ) /* next r */ @@ -557,9 +538,6 @@ LLBL( G3TPIR_1 ): MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */ MOVD ( MM1, REGOFF(-8, EDX) ) /* | r2 */ - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - - MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */ JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */ LLBL( G3TPIR_2 ): diff --git a/src/mesa/x86/3dnow_xform4.S b/src/mesa/x86/3dnow_xform4.S index 06d7c69..0336b70 100644 --- a/src/mesa/x86/3dnow_xform4.S +++ b/src/mesa/x86/3dnow_xform4.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_xform4.S,v 1.1 2001/03/29 06:46:16 gareth Exp $ */ +/* $Id: 3dnow_xform4.S,v 1.2 2001/10/22 01:21:16 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -59,17 +59,17 @@ GLNAME( _mesa_3dnow_transform_points4_general ): PREFETCHW ( REGIND(EDX) ) - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM4 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - ALIGNTEXT16 LLBL( G3TPGR_1 ): PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - PREFETCH ( REGIND(EAX) ) + 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 */ @@ -110,10 +110,6 @@ 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 */ JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -165,16 +161,16 @@ GLNAME( _mesa_3dnow_transform_points4_perspective ): MOVQ ( REGOFF(32, ECX), MM2 ) /* m21 | m20 */ PXOR ( MM7, MM7 ) /* 0 | 0 */ +ALIGNTEXT16 +LLBL( G3TPPR_1 ): + + PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ + 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 */ - -ALIGNTEXT16 -LLBL( G3TPPR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */ MOVQ ( MM5, MM6 ) /* x3 | x2 */ @@ -193,12 +189,6 @@ LLBL( G3TPPR_1 ): MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */ MOVQ ( MM6, REGOFF(-8, EDX) ) /* write r2, r3 */ - 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 */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -244,15 +234,15 @@ GLNAME( _mesa_3dnow_transform_points4_3d ): MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */ PUNPCKLDQ ( REGOFF(56, ECX), MM7 ) /* m14 | m10 */ - MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */ - ALIGNTEXT16 LLBL( G3TP3R_1 ): PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ PREFETCH ( REGOFF(32, EAX) ) /* hopefully array is tightly packed */ + MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */ + MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */ + MOVQ ( MM2, MM0 ) /* x1 | x0 */ MOVQ ( MM3, MM4 ) /* x3 | x2 */ @@ -289,9 +279,6 @@ LLBL( G3TP3R_1 ): MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */ - DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -337,16 +324,16 @@ GLNAME( _mesa_3dnow_transform_points4_3d_no_rot ): MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */ +ALIGNTEXT16 +LLBL( G3TP3NRR_1 ): + + 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 */ ADD_L ( EDI, EAX ) /* next vertex */ - -ALIGNTEXT16 -LLBL( G3TP3NRR_1 ): - - PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */ MOVQ ( MM5, MM6 ) /* x3 | x2 */ @@ -364,12 +351,6 @@ LLBL( G3TP3NRR_1 ): MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - - MOVD ( REGOFF(12, EAX), MM7 ) /* | x3 */ - ADD_L ( EDI, EAX ) /* next vertex */ - DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -416,15 +397,15 @@ GLNAME( _mesa_3dnow_transform_points4_2d ): MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ - MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - ALIGNTEXT16 LLBL( G3TP2R_1 ): PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ + + MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */ + MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ + + ADD_L ( EDI, EAX ) /* next vertex */ PREFETCH ( REGIND(EAX) ) MOVQ ( MM3, MM4 ) /* x1 | x0 */ @@ -443,10 +424,6 @@ LLBL( G3TP2R_1 ): MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */ - MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */ - - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - ADD_L ( EDI, EAX ) /* next vertex */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TP2R_1 ) ) /* cnt > 0 ? -> process next vertex */ @@ -491,15 +468,15 @@ GLNAME( _mesa_3dnow_transform_points4_2d_no_rot ): MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - ALIGNTEXT16 LLBL( G3TP2NRR_2 ): PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ + + MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ + MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ + + ADD_L ( EDI, EAX ) /* next vertex */ PREFETCH ( REGIND(EAX) ) PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ @@ -514,10 +491,6 @@ LLBL( G3TP2NRR_2 ): MOVQ ( MM6, REGOFF(-16, EDX) ) /* write r0, r1 */ MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */ - MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ @@ -557,25 +530,21 @@ GLNAME( _mesa_3dnow_transform_points4_identity ): TEST_L ( ESI, ESI ) JZ ( LLBL( G3TPIR_2 ) ) - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */ - - ADD_L ( EDI, EAX ) /* next vertex */ - 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 */ + + ADD_L ( EDI, EAX ) /* next vertex */ PREFETCH ( REGIND(EAX) ) ADD_L ( CONST(16), EDX ) /* next r */ MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */ MOVQ ( MM1, REGOFF(-8, EDX) ) /* r3 | r2 */ - MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ - - MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */ - ADD_L ( EDI, EAX ) /* next vertex */ DEC_L ( ESI ) /* decrement vertex counter */ JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */ |