summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorGareth Hughes <[email protected]>2001-05-13 18:55:15 +0000
committerGareth Hughes <[email protected]>2001-05-13 18:55:15 +0000
commit53e4ebd4e36c0ae462d71c87cda3533f9d001324 (patch)
tree0fc3cbaf4c8a028a6b1b7c5d48568ed2fba752f4 /src/mesa
parentd29e9dfe93cc4ff22cbffba400741f726b953c66 (diff)
Fix long-standing FP exception bug in _mesa_x86_cliptest_points4().
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/x86/x86.c3
-rw-r--r--src/mesa/x86/x86_cliptest.S19
2 files changed, 17 insertions, 5 deletions
diff --git a/src/mesa/x86/x86.c b/src/mesa/x86/x86.c
index ddcfe86a752..b2b442c87e2 100644
--- a/src/mesa/x86/x86.c
+++ b/src/mesa/x86/x86.c
@@ -1,4 +1,4 @@
-/* $Id: x86.c,v 1.21 2001/03/30 14:44:43 gareth Exp $ */
+/* $Id: x86.c,v 1.22 2001/05/13 18:55:15 gareth Exp $ */
/*
* Mesa 3-D graphics library
@@ -85,7 +85,6 @@ void _mesa_init_x86_transform_asm( void )
ASSIGN_XFORM_GROUP( x86, 3 );
ASSIGN_XFORM_GROUP( x86, 4 );
- /* XXX this function has been found to cause FP overflow exceptions */
_mesa_clip_tab[4] = _mesa_x86_cliptest_points4;
_mesa_clip_np_tab[4] = _mesa_x86_cliptest_points4_np;
diff --git a/src/mesa/x86/x86_cliptest.S b/src/mesa/x86/x86_cliptest.S
index f228274dedf..76f34d5d5c2 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.6 2001/03/28 20:44:44 gareth Exp $ */
+/* $Id: x86_cliptest.S,v 1.7 2001/05/13 18:55:15 gareth Exp $ */
/*
* Mesa 3-D graphics library
@@ -149,7 +149,12 @@ LLBL( ctp4_clip_table_ready ):
ALIGNTEXT16
LLBL( ctp4_top ):
- FLD1 /* F3 */
+ 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) )
MOV_L( SRC(3), EBP )
@@ -198,7 +203,15 @@ LLBL( ctp4_top ):
JZ( LLBL( ctp4_proj ) )
- FSTP( ST(0) ) /* */
+LLBL( ctp4_noproj ):
+
+ FLDZ /* F0 F3 */
+
+ FST_S( DST(0) ) /* F0 F3 */
+ FST_S( DST(1) ) /* F0 F3 */
+ FSTP_S( DST(2) ) /* F3 */
+ FSTP_S( DST(3) ) /* */
+
JMP( LLBL( ctp4_next ) )
LLBL( ctp4_proj ):