summaryrefslogtreecommitdiff
path: root/src/mesa/x86/x86_cliptest.S
diff options
context:
space:
mode:
authorGareth Hughes <gareth@valinux.com>2001-05-13 18:55:15 +0000
committerGareth Hughes <gareth@valinux.com>2001-05-13 18:55:15 +0000
commit53e4ebd4e36c0ae462d71c87cda3533f9d001324 (patch)
tree0fc3cbaf4c8a028a6b1b7c5d48568ed2fba752f4 /src/mesa/x86/x86_cliptest.S
parentd29e9dfe93cc4ff22cbffba400741f726b953c66 (diff)
Fix long-standing FP exception bug in _mesa_x86_cliptest_points4().
Diffstat (limited to 'src/mesa/x86/x86_cliptest.S')
-rw-r--r--src/mesa/x86/x86_cliptest.S19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mesa/x86/x86_cliptest.S b/src/mesa/x86/x86_cliptest.S
index f228274ded..76f34d5d5c 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 ):