1 /* $Id: 3dnow.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * 3DNow! optimizations contributed by
30 * Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
42 void gl_init_3dnow_asm_transforms (void);
48 GLvector4f
*gl_project_points( GLvector4f
*proj_vec
,
49 const GLvector4f
*clip_vec
)
54 " movq (%0), %%mm0 # x1 | x0 \n"
55 " movq 8(%0), %%mm1 # oow | x2 \n"
57 "1: movq %%mm1, %%mm2 # oow | x2 \n"
58 " addl %2, %0 # next point \n"
60 " punpckhdq %%mm2, %%mm2 # oow | oow \n"
61 " addl $16, %1 # next point \n"
63 " pfrcp %%mm2, %%mm3 # 1/oow | 1/oow \n"
66 " pfmul %%mm3, %%mm0 # x1/oow | x0/oow \n"
67 " movq %%mm0, -16(%1) # write r0, r1 \n"
69 " pfmul %%mm3, %%mm1 # 1 | x2/oow \n"
70 " movq (%0), %%mm0 # x1 | x0 \n"
72 " movd %%mm1, 8(%1) # write r2 \n"
73 " movd %%mm3, 12(%1) # write r3 \n"
75 " movq 8(%0), %%mm1 # oow | x2 \n"
80 ::"a" (clip_vec
->start
),
81 "c" (proj_vec
->start
),
82 "g" (clip_vec
->stride
),
86 proj_vec
->flags
|= VEC_SIZE_4
;
88 proj_vec
->count
= clip_vec
->count
;