17117f1b4Smrg 27117f1b4Smrg/* 37117f1b4Smrg * Mesa 3-D graphics library 47117f1b4Smrg * 57117f1b4Smrg * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. 67117f1b4Smrg * 77117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a 87117f1b4Smrg * copy of this software and associated documentation files (the "Software"), 97117f1b4Smrg * to deal in the Software without restriction, including without limitation 107117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 117117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the 127117f1b4Smrg * Software is furnished to do so, subject to the following conditions: 137117f1b4Smrg * 147117f1b4Smrg * The above copyright notice and this permission notice shall be included 157117f1b4Smrg * in all copies or substantial portions of the Software. 167117f1b4Smrg * 177117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 187117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 197117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 21af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 22af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE. 247117f1b4Smrg */ 257117f1b4Smrg 267117f1b4Smrg#ifdef USE_3DNOW_ASM 27c1f859d4Smrg#include "assyntax.h" 287ec681f3Smrg#define MATH_ASM_PTR_SIZE 4 297ec681f3Smrg#include "math/m_vector_asm.h" 307117f1b4Smrg#include "xform_args.h" 317117f1b4Smrg 327117f1b4Smrg SEG_TEXT 337117f1b4Smrg 347117f1b4Smrg#define FRAME_OFFSET 4 357117f1b4Smrg 367117f1b4Smrg 377117f1b4SmrgALIGNTEXT16 387117f1b4SmrgGLOBL GLNAME( _mesa_3dnow_transform_points1_general ) 397117f1b4SmrgHIDDEN(_mesa_3dnow_transform_points1_general) 407117f1b4SmrgGLNAME( _mesa_3dnow_transform_points1_general ): 417ec681f3Smrg _CET_ENDBR 427117f1b4Smrg PUSH_L ( ESI ) 437117f1b4Smrg 447117f1b4Smrg MOV_L ( ARG_DEST, ECX ) 457117f1b4Smrg MOV_L ( ARG_MATRIX, ESI ) 467117f1b4Smrg MOV_L ( ARG_SOURCE, EAX ) 477117f1b4Smrg MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) 487117f1b4Smrg OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) 497117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) 507117f1b4Smrg MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) 517117f1b4Smrg 527117f1b4Smrg PUSH_L ( EDI ) 537117f1b4Smrg 547117f1b4Smrg MOV_L ( REGOFF(4, ECX), EDX ) 557117f1b4Smrg MOV_L ( ESI, ECX ) 567117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) 577117f1b4Smrg MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) 587117f1b4Smrg MOV_L ( REGOFF(V4F_START, EAX), EAX ) 597117f1b4Smrg 607117f1b4Smrg TEST_L ( ESI, ESI ) 617117f1b4Smrg JZ ( LLBL( G3TPGR_3 ) ) 627117f1b4Smrg 637117f1b4Smrg MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */ 647117f1b4Smrg MOVQ ( REGOFF(8, ECX), MM1 ) /* m03 | m02 */ 657117f1b4Smrg 667117f1b4Smrg MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ 677117f1b4Smrg MOVQ ( REGOFF(56, ECX), MM3 ) /* m33 | m32 */ 687117f1b4Smrg 697117f1b4SmrgALIGNTEXT16 707117f1b4SmrgLLBL( G3TPGR_2 ): 717117f1b4Smrg 727117f1b4Smrg MOVD ( REGIND(EAX), MM4 ) /* | x0 */ 737117f1b4Smrg PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */ 747117f1b4Smrg 757117f1b4Smrg MOVQ ( MM4, MM5 ) /* x0 | x0 */ 767117f1b4Smrg PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */ 777117f1b4Smrg 787117f1b4Smrg PFMUL ( MM1, MM5 ) /* x0*m03 | x0*m02 */ 797117f1b4Smrg PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */ 807117f1b4Smrg 817117f1b4Smrg PFADD ( MM3, MM5 ) /* x0*m03+m33 | x0*m02+m32 */ 827117f1b4Smrg MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ 837117f1b4Smrg 847117f1b4Smrg MOVQ ( MM5, REGOFF(8, EDX) ) /* write r3, r2 */ 857117f1b4Smrg ADD_L ( EDI, EAX ) /* next vertex */ 867117f1b4Smrg 877117f1b4Smrg ADD_L ( CONST(16), EDX ) /* next r */ 887117f1b4Smrg DEC_L ( ESI ) /* decrement vertex counter */ 897117f1b4Smrg 907117f1b4Smrg JNZ ( LLBL( G3TPGR_2 ) ) /* cnt > 0 ? -> process next vertex */ 917117f1b4Smrg 927117f1b4SmrgLLBL( G3TPGR_3 ): 937117f1b4Smrg 947117f1b4Smrg FEMMS 957117f1b4Smrg POP_L ( EDI ) 967117f1b4Smrg POP_L ( ESI ) 977117f1b4Smrg RET 987117f1b4Smrg 997117f1b4Smrg 1007117f1b4Smrg 1017117f1b4Smrg 1027117f1b4SmrgALIGNTEXT16 1037117f1b4SmrgGLOBL GLNAME( _mesa_3dnow_transform_points1_identity ) 1047117f1b4SmrgHIDDEN(_mesa_3dnow_transform_points1_identity) 1057117f1b4SmrgGLNAME( _mesa_3dnow_transform_points1_identity ): 1067ec681f3Smrg _CET_ENDBR 1077117f1b4Smrg PUSH_L ( ESI ) 1087117f1b4Smrg 1097117f1b4Smrg MOV_L ( ARG_DEST, ECX ) 1107117f1b4Smrg MOV_L ( ARG_MATRIX, ESI ) 1117117f1b4Smrg MOV_L ( ARG_SOURCE, EAX ) 1127117f1b4Smrg MOV_L ( CONST(1), REGOFF(V4F_SIZE, ECX) ) 1137117f1b4Smrg OR_B ( CONST(VEC_SIZE_1), REGOFF(V4F_FLAGS, ECX) ) 1147117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) 1157117f1b4Smrg MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) 1167117f1b4Smrg 1177117f1b4Smrg PUSH_L ( EDI ) 1187117f1b4Smrg 1197117f1b4Smrg MOV_L ( REGOFF(4, ECX), EDX ) 1207117f1b4Smrg MOV_L ( ESI, ECX ) 1217117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) 1227117f1b4Smrg MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) 1237117f1b4Smrg MOV_L ( REGOFF(V4F_START, EAX), EAX ) 1247117f1b4Smrg 1257117f1b4Smrg TEST_L ( ESI, ESI ) 1267117f1b4Smrg JZ ( LLBL( G3TPIR_4) ) 1277117f1b4Smrg 1287117f1b4SmrgALIGNTEXT16 1297117f1b4SmrgLLBL( G3TPIR_3 ): 1307117f1b4Smrg 1317117f1b4Smrg MOVD ( REGIND(EAX), MM0 ) /* | x0 */ 1327117f1b4Smrg ADD_L ( EDI, EAX ) /* next vertex */ 1337117f1b4Smrg 1347117f1b4Smrg MOVD ( MM0, REGIND(EDX) ) /* | r0 */ 1357117f1b4Smrg ADD_L ( CONST(16), EDX ) /* next r */ 1367117f1b4Smrg 1377117f1b4Smrg DEC_L ( ESI ) /* decrement vertex counter */ 1387117f1b4Smrg JNZ ( LLBL( G3TPIR_3 ) ) /* cnt > 0 ? -> process next vertex */ 1397117f1b4Smrg 1407117f1b4SmrgLLBL( G3TPIR_4 ): 1417117f1b4Smrg 1427117f1b4Smrg FEMMS 1437117f1b4Smrg POP_L ( EDI ) 1447117f1b4Smrg POP_L ( ESI ) 1457117f1b4Smrg RET 1467117f1b4Smrg 1477117f1b4Smrg 1487117f1b4Smrg 1497117f1b4Smrg 1507117f1b4SmrgALIGNTEXT16 1517117f1b4SmrgGLOBL GLNAME( _mesa_3dnow_transform_points1_3d_no_rot ) 1527117f1b4SmrgHIDDEN(_mesa_3dnow_transform_points1_3d_no_rot) 1537117f1b4SmrgGLNAME( _mesa_3dnow_transform_points1_3d_no_rot ): 1547ec681f3Smrg _CET_ENDBR 1557117f1b4Smrg PUSH_L ( ESI ) 1567117f1b4Smrg 1577117f1b4Smrg MOV_L ( ARG_DEST, ECX ) 1587117f1b4Smrg MOV_L ( ARG_MATRIX, ESI ) 1597117f1b4Smrg MOV_L ( ARG_SOURCE, EAX ) 1607117f1b4Smrg MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) 1617117f1b4Smrg OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) 1627117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) 1637117f1b4Smrg MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) 1647117f1b4Smrg 1657117f1b4Smrg PUSH_L ( EDI ) 1667117f1b4Smrg 1677117f1b4Smrg MOV_L ( REGOFF(4, ECX), EDX ) 1687117f1b4Smrg MOV_L ( ESI, ECX ) 1697117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) 1707117f1b4Smrg MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) 1717117f1b4Smrg MOV_L ( REGOFF(V4F_START, EAX), EAX ) 1727117f1b4Smrg 1737117f1b4Smrg TEST_L ( ESI, ESI ) 1747117f1b4Smrg JZ ( LLBL( G3TP3NRR_3 ) ) 1757117f1b4Smrg 1767117f1b4Smrg MOVD ( REGIND(ECX), MM0 ) /* | m00 */ 1777117f1b4Smrg MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ 1787117f1b4Smrg 1797117f1b4Smrg MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ 1807117f1b4Smrg 1817117f1b4SmrgALIGNTEXT16 1827117f1b4SmrgLLBL( G3TP3NRR_2 ): 1837117f1b4Smrg 1847117f1b4Smrg MOVD ( REGIND(EAX), MM4 ) /* | x0 */ 1857117f1b4Smrg PFMUL ( MM0, MM4 ) /* | x0*m00 */ 1867117f1b4Smrg 1877117f1b4Smrg PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */ 1887117f1b4Smrg MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ 1897117f1b4Smrg 1907117f1b4Smrg MOVD ( MM3, REGOFF(8, EDX) ) /* write r2 */ 1917117f1b4Smrg ADD_L ( EDI, EAX ) /* next vertex */ 1927117f1b4Smrg 1937117f1b4Smrg ADD_L ( CONST(16), EDX ) /* next r */ 1947117f1b4Smrg DEC_L ( ESI ) /* decrement vertex counter */ 1957117f1b4Smrg 1967117f1b4Smrg JNZ ( LLBL( G3TP3NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ 1977117f1b4Smrg 1987117f1b4SmrgLLBL( G3TP3NRR_3 ): 1997117f1b4Smrg 2007117f1b4Smrg FEMMS 2017117f1b4Smrg POP_L ( EDI ) 2027117f1b4Smrg POP_L ( ESI ) 2037117f1b4Smrg RET 2047117f1b4Smrg 2057117f1b4Smrg 2067117f1b4Smrg 2077117f1b4Smrg 2087117f1b4SmrgALIGNTEXT16 2097117f1b4SmrgGLOBL GLNAME( _mesa_3dnow_transform_points1_perspective ) 2107117f1b4SmrgHIDDEN(_mesa_3dnow_transform_points1_perspective) 2117117f1b4SmrgGLNAME( _mesa_3dnow_transform_points1_perspective ): 2127ec681f3Smrg _CET_ENDBR 2137117f1b4Smrg PUSH_L ( ESI ) 2147117f1b4Smrg 2157117f1b4Smrg MOV_L ( ARG_DEST, ECX ) 2167117f1b4Smrg MOV_L ( ARG_MATRIX, ESI ) 2177117f1b4Smrg MOV_L ( ARG_SOURCE, EAX ) 2187117f1b4Smrg MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) ) 2197117f1b4Smrg OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) ) 2207117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) 2217117f1b4Smrg MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) 2227117f1b4Smrg 2237117f1b4Smrg PUSH_L ( EDI ) 2247117f1b4Smrg 2257117f1b4Smrg MOV_L ( REGOFF(4, ECX), EDX ) 2267117f1b4Smrg MOV_L ( ESI, ECX ) 2277117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) 2287117f1b4Smrg MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) 2297117f1b4Smrg MOV_L ( REGOFF(V4F_START, EAX), EAX ) 2307117f1b4Smrg 2317117f1b4Smrg TEST_L ( ESI, ESI ) 2327117f1b4Smrg JZ ( LLBL( G3TPPR_3 ) ) 2337117f1b4Smrg 2347117f1b4Smrg MOVD ( REGIND(ECX), MM0 ) /* | m00 */ 2357117f1b4Smrg MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ 2367117f1b4Smrg 2377117f1b4SmrgALIGNTEXT16 2387117f1b4SmrgLLBL( G3TPPR_2 ): 2397117f1b4Smrg 2407117f1b4Smrg MOVD ( REGIND(EAX), MM4 ) /* 0 | x0 */ 2417117f1b4Smrg PFMUL ( MM0, MM4 ) /* 0 | x0*m00 */ 2427117f1b4Smrg 2437117f1b4Smrg MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ 2447117f1b4Smrg MOVQ ( MM3, REGOFF(8, EDX) ) /* write r2 (=m32), r3 (=0) */ 2457117f1b4Smrg 2467117f1b4Smrg ADD_L ( EDI, EAX ) /* next vertex */ 2477117f1b4Smrg ADD_L ( CONST(16), EDX ) /* next r */ 2487117f1b4Smrg 2497117f1b4Smrg DEC_L ( ESI ) /* decrement vertex counter */ 2507117f1b4Smrg JNZ ( LLBL( G3TPPR_2 ) ) /* cnt > 0 ? -> process next vertex */ 2517117f1b4Smrg 2527117f1b4SmrgLLBL( G3TPPR_3 ): 2537117f1b4Smrg 2547117f1b4Smrg FEMMS 2557117f1b4Smrg POP_L ( EDI ) 2567117f1b4Smrg POP_L ( ESI ) 2577117f1b4Smrg RET 2587117f1b4Smrg 2597117f1b4Smrg 2607117f1b4Smrg 2617117f1b4Smrg 2627117f1b4SmrgALIGNTEXT16 2637117f1b4SmrgGLOBL GLNAME( _mesa_3dnow_transform_points1_2d ) 2647117f1b4SmrgHIDDEN(_mesa_3dnow_transform_points1_2d) 2657117f1b4SmrgGLNAME( _mesa_3dnow_transform_points1_2d ): 2667ec681f3Smrg _CET_ENDBR 2677117f1b4Smrg PUSH_L ( ESI ) 2687117f1b4Smrg 2697117f1b4Smrg MOV_L ( ARG_DEST, ECX ) 2707117f1b4Smrg MOV_L ( ARG_MATRIX, ESI ) 2717117f1b4Smrg MOV_L ( ARG_SOURCE, EAX ) 2727117f1b4Smrg MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) ) 2737117f1b4Smrg OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) ) 2747117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) 2757117f1b4Smrg MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) 2767117f1b4Smrg 2777117f1b4Smrg PUSH_L ( EDI ) 2787117f1b4Smrg 2797117f1b4Smrg MOV_L ( REGOFF(4, ECX), EDX ) 2807117f1b4Smrg MOV_L ( ESI, ECX ) 2817117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) 2827117f1b4Smrg MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) 2837117f1b4Smrg MOV_L ( REGOFF(V4F_START, EAX), EAX ) 2847117f1b4Smrg 2857117f1b4Smrg TEST_L ( ESI, ESI ) 2867117f1b4Smrg JZ ( LLBL( G3TP2R_3 ) ) 2877117f1b4Smrg 2887117f1b4Smrg MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */ 2897117f1b4Smrg MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ 2907117f1b4Smrg 2917117f1b4SmrgALIGNTEXT16 2927117f1b4SmrgLLBL( G3TP2R_2 ): 2937117f1b4Smrg 2947117f1b4Smrg MOVD ( REGIND(EAX), MM4 ) /* | x0 */ 2957117f1b4Smrg PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */ 2967117f1b4Smrg 2977117f1b4Smrg PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */ 2987117f1b4Smrg PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */ 2997117f1b4Smrg 3007117f1b4Smrg MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ 3017117f1b4Smrg ADD_L ( EDI, EAX ) /* next vertex */ 3027117f1b4Smrg 3037117f1b4Smrg ADD_L ( CONST(16), EDX ) /* next r */ 3047117f1b4Smrg DEC_L ( ESI ) /* decrement vertex counter */ 3057117f1b4Smrg 3067117f1b4Smrg JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */ 3077117f1b4Smrg 3087117f1b4SmrgLLBL( G3TP2R_3 ): 3097117f1b4Smrg 3107117f1b4Smrg FEMMS 3117117f1b4Smrg POP_L ( EDI ) 3127117f1b4Smrg POP_L ( ESI ) 3137117f1b4Smrg RET 3147117f1b4Smrg 3157117f1b4Smrg 3167117f1b4Smrg 3177117f1b4Smrg 3187117f1b4SmrgALIGNTEXT16 3197117f1b4SmrgGLOBL GLNAME( _mesa_3dnow_transform_points1_2d_no_rot ) 3207117f1b4SmrgHIDDEN(_mesa_3dnow_transform_points1_2d_no_rot) 3217117f1b4SmrgGLNAME( _mesa_3dnow_transform_points1_2d_no_rot ): 3227ec681f3Smrg _CET_ENDBR 3237117f1b4Smrg PUSH_L ( ESI ) 3247117f1b4Smrg 3257117f1b4Smrg MOV_L ( ARG_DEST, ECX ) 3267117f1b4Smrg MOV_L ( ARG_MATRIX, ESI ) 3277117f1b4Smrg MOV_L ( ARG_SOURCE, EAX ) 3287117f1b4Smrg MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) ) 3297117f1b4Smrg OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) ) 3307117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) 3317117f1b4Smrg MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) 3327117f1b4Smrg 3337117f1b4Smrg PUSH_L ( EDI ) 3347117f1b4Smrg 3357117f1b4Smrg MOV_L ( REGOFF(4, ECX), EDX ) 3367117f1b4Smrg MOV_L ( ESI, ECX ) 3377117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) 3387117f1b4Smrg MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) 3397117f1b4Smrg MOV_L ( REGOFF(V4F_START, EAX), EAX ) 3407117f1b4Smrg 3417117f1b4Smrg TEST_L ( ESI, ESI ) 3427117f1b4Smrg JZ ( LLBL( G3TP2NRR_3 ) ) 3437117f1b4Smrg 3447117f1b4Smrg MOVD ( REGIND(ECX), MM0 ) /* | m00 */ 3457117f1b4Smrg MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ 3467117f1b4Smrg 3477117f1b4SmrgALIGNTEXT16 3487117f1b4SmrgLLBL( G3TP2NRR_2 ): 3497117f1b4Smrg 3507117f1b4Smrg MOVD ( REGIND(EAX), MM4 ) /* | x0 */ 3517117f1b4Smrg ADD_L ( EDI, EAX ) /* next vertex */ 3527117f1b4Smrg 3537117f1b4Smrg PFMUL ( MM0, MM4 ) /* | x0*m00 */ 3547117f1b4Smrg PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */ 3557117f1b4Smrg 3567117f1b4Smrg MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ 3577117f1b4Smrg ADD_L ( CONST(16), EDX ) /* next r */ 3587117f1b4Smrg 3597117f1b4Smrg DEC_L ( ESI ) /* decrement vertex counter */ 3607117f1b4Smrg JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */ 3617117f1b4Smrg 3627117f1b4SmrgLLBL( G3TP2NRR_3 ): 3637117f1b4Smrg 3647117f1b4Smrg FEMMS 3657117f1b4Smrg POP_L ( EDI ) 3667117f1b4Smrg POP_L ( ESI ) 3677117f1b4Smrg RET 3687117f1b4Smrg 3697117f1b4Smrg 3707117f1b4Smrg 3717117f1b4Smrg 3727117f1b4SmrgALIGNTEXT16 3737117f1b4SmrgGLOBL GLNAME( _mesa_3dnow_transform_points1_3d ) 3747117f1b4SmrgHIDDEN(_mesa_3dnow_transform_points1_3d) 3757117f1b4SmrgGLNAME( _mesa_3dnow_transform_points1_3d ): 3767ec681f3Smrg _CET_ENDBR 3777117f1b4Smrg PUSH_L ( ESI ) 3787117f1b4Smrg 3797117f1b4Smrg MOV_L ( ARG_DEST, ECX ) 3807117f1b4Smrg MOV_L ( ARG_MATRIX, ESI ) 3817117f1b4Smrg MOV_L ( ARG_SOURCE, EAX ) 3827117f1b4Smrg MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) ) 3837117f1b4Smrg OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) ) 3847117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), EDX ) 3857117f1b4Smrg MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) ) 3867117f1b4Smrg 3877117f1b4Smrg PUSH_L ( EDI ) 3887117f1b4Smrg 3897117f1b4Smrg MOV_L ( REGOFF(4, ECX), EDX ) 3907117f1b4Smrg MOV_L ( ESI, ECX ) 3917117f1b4Smrg MOV_L ( REGOFF(V4F_COUNT, EAX), ESI ) 3927117f1b4Smrg MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI ) 3937117f1b4Smrg MOV_L ( REGOFF(V4F_START, EAX), EAX ) 3947117f1b4Smrg 3957117f1b4Smrg TEST_L ( ESI, ESI ) 3967117f1b4Smrg JZ ( LLBL( G3TP3R_3 ) ) 3977117f1b4Smrg 3987117f1b4Smrg MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */ 3997117f1b4Smrg MOVD ( REGOFF(8, ECX), MM1 ) /* | m02 */ 4007117f1b4Smrg 4017117f1b4Smrg MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */ 4027117f1b4Smrg MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */ 4037117f1b4Smrg 4047117f1b4SmrgALIGNTEXT16 4057117f1b4SmrgLLBL( G3TP3R_2 ): 4067117f1b4Smrg 4077117f1b4Smrg MOVD ( REGIND(EAX), MM4 ) /* | x0 */ 4087117f1b4Smrg PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */ 4097117f1b4Smrg 4107117f1b4Smrg MOVQ ( MM4, MM5 ) /* | x0 */ 4117117f1b4Smrg PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */ 4127117f1b4Smrg 4137117f1b4Smrg PFMUL ( MM1, MM5 ) /* | x0*m02 */ 4147117f1b4Smrg PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */ 4157117f1b4Smrg 4167117f1b4Smrg PFADD ( MM3, MM5 ) /* | x0*m02+m32 */ 4177117f1b4Smrg MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */ 4187117f1b4Smrg 4197117f1b4Smrg MOVD ( MM5, REGOFF(8, EDX) ) /* write r2 */ 4207117f1b4Smrg ADD_L ( EDI, EAX ) /* next vertex */ 4217117f1b4Smrg 4227117f1b4Smrg ADD_L ( CONST(16), EDX ) /* next r */ 4237117f1b4Smrg DEC_L ( ESI ) /* decrement vertex counter */ 4247117f1b4Smrg 4257117f1b4Smrg JNZ ( LLBL( G3TP3R_2 ) ) /* cnt > 0 ? -> process next vertex */ 4267117f1b4Smrg 4277117f1b4SmrgLLBL( G3TP3R_3 ): 4287117f1b4Smrg 4297117f1b4Smrg FEMMS 4307117f1b4Smrg POP_L ( EDI ) 4317117f1b4Smrg POP_L ( ESI ) 4327117f1b4Smrg RET 4337117f1b4Smrg 4347117f1b4Smrg#endif 4357117f1b4Smrg 4367117f1b4Smrg#if defined (__ELF__) && defined (__linux__) 4377117f1b4Smrg .section .note.GNU-stack,"",%progbits 4387117f1b4Smrg#endif 439