diff options
author | Gareth Hughes <[email protected]> | 2001-05-21 16:33:41 +0000 |
---|---|---|
committer | Gareth Hughes <[email protected]> | 2001-05-21 16:33:41 +0000 |
commit | e7e38a47a8dd567fd5a848cbef09b14018fb2fe0 (patch) | |
tree | d10dc2886dbca967d560a4972f40a719489f29c5 /src/mesa/x86 | |
parent | e9482d004f7b4bdc99312a89c33c061f31552bda (diff) |
Initial commit of cliptest work. More to come shortly.
- Add debug, benchmark code.
- Change linux/x86 FAST_MATH code to GCC/x86, and clear FP exceptions
before exiting the fast math block.
- Remove divide-by-zero test in x86 cliptest, and set clipped vertices
to [0,0,0,1] instead of leaving them uninitialized.
Diffstat (limited to 'src/mesa/x86')
-rw-r--r-- | src/mesa/x86/clip_args.h | 6 | ||||
-rw-r--r-- | src/mesa/x86/x86.c | 5 | ||||
-rw-r--r-- | src/mesa/x86/x86_cliptest.S | 54 |
3 files changed, 29 insertions, 36 deletions
diff --git a/src/mesa/x86/clip_args.h b/src/mesa/x86/clip_args.h index eeb10236b3b..9d415ea0149 100644 --- a/src/mesa/x86/clip_args.h +++ b/src/mesa/x86/clip_args.h @@ -1,4 +1,4 @@ -/* $Id: clip_args.h,v 1.3 2001/03/28 20:44:43 gareth Exp $ */ +/* $Id: clip_args.h,v 1.4 2001/05/21 16:33:41 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -38,8 +38,8 @@ /* * Offsets for clip_func arguments * - * typedef GLvector4f *(*clip_func)( GLvector4f *vClip, - * GLvector4f *vProj, + * typedef GLvector4f *(*clip_func)( GLvector4f *clip_vec, + * GLvector4f *proj_vec, * GLubyte clipMask[], * GLubyte *orMask, * GLubyte *andMask ); diff --git a/src/mesa/x86/x86.c b/src/mesa/x86/x86.c index b2b442c87e2..03104d5370e 100644 --- a/src/mesa/x86/x86.c +++ b/src/mesa/x86/x86.c @@ -1,4 +1,4 @@ -/* $Id: x86.c,v 1.22 2001/05/13 18:55:15 gareth Exp $ */ +/* $Id: x86.c,v 1.23 2001/05/21 16:33:41 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -90,6 +90,7 @@ void _mesa_init_x86_transform_asm( void ) #ifdef DEBUG _math_test_all_transform_functions( "x86" ); + _math_test_all_cliptest_functions( "x86" ); #endif #endif } @@ -100,7 +101,7 @@ void _mesa_init_x86_vertex_asm( void ) _mesa_xform_points3_v16_general = _mesa_v16_x86_general_xform; _mesa_cliptest_points4_v16 = _mesa_v16_x86_cliptest_points4; -#ifdef DEBUG +#ifdef 0 /* DEBUG */ _math_test_all_vertex_functions( "x86" ); #endif #endif diff --git a/src/mesa/x86/x86_cliptest.S b/src/mesa/x86/x86_cliptest.S index 76f34d5d5c2..08e34ecbd6f 100644 --- a/src/mesa/x86/x86_cliptest.S +++ b/src/mesa/x86/x86_cliptest.S @@ -1,4 +1,4 @@ -/* $Id: x86_cliptest.S,v 1.7 2001/05/13 18:55:15 gareth Exp $ */ +/* $Id: x86_cliptest.S,v 1.8 2001/05/21 16:33:41 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -27,9 +27,6 @@ #include "matypes.h" #include "clip_args.h" -#define FP_ONE 1065353216 -#define FP_ZERO 0 - #define SRC(i) REGOFF(i * 4, ESI) #define DST(i) REGOFF(i * 4, EDI) #define MAT(i) REGOFF(i * 4, EDX) @@ -50,22 +47,22 @@ SEG_DATA clip_table: - D_BYTE 0, 1, 0, 2, 4, 5, 4, 6 - D_BYTE 0, 1, 0, 2, 8, 9, 8, 10 - D_BYTE 32, 33, 32, 34, 36, 37, 36, 38 - D_BYTE 32, 33, 32, 34, 40, 41, 40, 42 - D_BYTE 0, 1, 0, 2, 4, 5, 4, 6 - D_BYTE 0, 1, 0, 2, 8, 9, 8, 10 - D_BYTE 16, 17, 16, 18, 20, 21, 20, 22 - D_BYTE 16, 17, 16, 18, 24, 25, 24, 26 - D_BYTE 63, 61, 63, 62, 55, 53, 55, 54 - D_BYTE 63, 61, 63, 62, 59, 57, 59, 58 - D_BYTE 47, 45, 47, 46, 39, 37, 39, 38 - D_BYTE 47, 45, 47, 46, 43, 41, 43, 42 - D_BYTE 63, 61, 63, 62, 55, 53, 55, 54 - D_BYTE 63, 61, 63, 62, 59, 57, 59, 58 - D_BYTE 31, 29, 31, 30, 23, 21, 23, 22 - D_BYTE 31, 29, 31, 30, 27, 25, 27, 26 + D_BYTE 0x00, 0x01, 0x00, 0x02, 0x04, 0x05, 0x04, 0x06 + D_BYTE 0x00, 0x01, 0x00, 0x02, 0x08, 0x09, 0x08, 0x0a + D_BYTE 0x20, 0x21, 0x20, 0x22, 0x24, 0x25, 0x24, 0x26 + D_BYTE 0x20, 0x21, 0x20, 0x22, 0x28, 0x29, 0x28, 0x2a + D_BYTE 0x00, 0x01, 0x00, 0x02, 0x04, 0x05, 0x04, 0x06 + D_BYTE 0x00, 0x01, 0x00, 0x02, 0x08, 0x09, 0x08, 0x0a + D_BYTE 0x10, 0x11, 0x10, 0x12, 0x14, 0x15, 0x14, 0x16 + D_BYTE 0x10, 0x11, 0x10, 0x12, 0x18, 0x19, 0x18, 0x1a + D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x37, 0x35, 0x37, 0x36 + D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x3b, 0x39, 0x3b, 0x3a + D_BYTE 0x2f, 0x2d, 0x2f, 0x2e, 0x27, 0x25, 0x27, 0x26 + D_BYTE 0x2f, 0x2d, 0x2f, 0x2e, 0x2b, 0x29, 0x2b, 0x2a + D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x37, 0x35, 0x37, 0x36 + D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x3b, 0x39, 0x3b, 0x3a + D_BYTE 0x1f, 0x1d, 0x1f, 0x1e, 0x17, 0x15, 0x17, 0x16 + D_BYTE 0x1f, 0x1d, 0x1f, 0x1e, 0x1b, 0x19, 0x1b, 0x1a SEG_TEXT @@ -149,13 +146,8 @@ LLBL( ctp4_clip_table_ready ): ALIGNTEXT16 LLBL( ctp4_top ): - MOV_L( SRC(3), ECX ) FLD1 /* F3 */ - - TEST_L( ECX, ECX ) /* GH: If src[3] is zero, abort */ - JZ( LLBL( ctp4_noproj ) ) - - FDIV_S( SRC(3) ) + FDIV_S( SRC(3) ) /* GH: don't care about div-by-zero */ MOV_L( SRC(3), EBP ) MOV_L( SRC(2), EBX ) @@ -205,12 +197,12 @@ LLBL( ctp4_top ): LLBL( ctp4_noproj ): - FLDZ /* F0 F3 */ + FSTP( ST(0) ) /* */ - FST_S( DST(0) ) /* F0 F3 */ - FST_S( DST(1) ) /* F0 F3 */ - FSTP_S( DST(2) ) /* F3 */ - FSTP_S( DST(3) ) /* */ + MOV_L( CONST(0), DST(0) ) + MOV_L( CONST(0), DST(1) ) + MOV_L( CONST(0), DST(2) ) + MOV_L( CONST(0x3f800000), DST(3) ) JMP( LLBL( ctp4_next ) ) |