several x86 fixes from from mesa_4_0_branch:

commit ea3ce085ab46ead05ce384f82194a487997883e1
Author: Alan Hourihane <alanh@tungstengraphics.com>
Date:   Sun Nov 10 23:15:35 2002 +0000

    fix 3dnow misdetection on new p4's (from trunk)

commit 6d0fd19a71a83e26d775ca9e8c61b453108474c1
Author: Brian Paul <brian.paul@tungstengraphics.com>
Date:   Thu Jul 11 15:32:00 2002 +0000

    applied Eric Anholt's patch for Athlon SSE

commit d8f5422a372647d2b8764b2c0bf5bfd6eda213a1
Author: Brian Paul <brian.paul@tungstengraphics.com>
Date:   Thu Sep 19 16:06:13 2002 +0000

    push and pop ESI (Daniel Borca)
(after commit 6d0fd19a71a83e26d775ca9e8c61b453108474c1)

commit 53e4ebd4e36c0ae462d71c87cda3533f9d001324
Author: Gareth Hughes <gareth@valinux.com>
Date:   Sun May 13 18:55:15 2001 +0000

    Fix long-standing FP exception bug in _mesa_x86_cliptest_points4().

commit e7e38a47a8dd567fd5a848cbef09b14018fb2fe0
Author: Gareth Hughes <gareth@valinux.com>
Date:   Mon May 21 16:33:41 2001 +0000
(after commit 53e4ebd4e36c0ae462d71c87cda3533f9d001324)

    Initial commit of cliptest work.  More to come shortly.
    [.....]
     - Remove divide-by-zero test in x86 cliptest, and set clipped vertices
       to [0,0,0,1] instead of leaving them uninitialized.

diff -urNp Mesa-3.4.2/src/X86/common_x86_asm.S Mesa-3.4.2x/src/X86/common_x86_asm.S
--- Mesa-3.4.2/src/X86/common_x86_asm.S	2001-02-10 01:20:27.000000000 +0200
+++ Mesa-3.4.2x/src/X86/common_x86_asm.S	2016-03-03 22:10:00.000000000 +0200
@@ -72,6 +72,7 @@ GLOBL GLNAME( gl_identify_x86_cpu_featur
 GLNAME( gl_identify_x86_cpu_features ):
 
 	PUSH_L	( EBX )
+	PUSH_L	( ESI )
 
 	/* Test for the CPUID command.  If the ID Flag bit in EFLAGS
 	 * (bit 21) is writable, the CPUID command is present.
@@ -111,6 +112,11 @@ GLNAME( gl_identify_x86_cpu_features ):
 	MOV_L	( CONST(0x1), EAX )
 	CPUID
 	MOV_L	( EDX, EAX )
+
+	/* Mask out highest bit, which is used by AMD for 3dnow
+         * Newer Intel have this bit set, but do not support 3dnow 
+ 	 */
+        AND_L   ( CONST(0X7FFFFFFF), EAX)
 	JMP	( LLBL( cpuid_done ) )
 
 LLBL( cpuid_amd ):
@@ -129,6 +135,15 @@ LLBL( cpuid_amd ):
 	 * information after we verify that the extended functions are
 	 * supported.
 	 */
+	/* The features we need are almost all in the extended set.  The
+	 * exception is SSE enable, which is in the standard set (0x1).
+	 */
+	MOV_L	( CONST(0x1), EAX )
+	CPUID
+	TEST_L	( EAX, EAX )
+	JZ	( LLBL (cpuid_failed) )
+	MOV_L	( EDX, ESI )
+
 	MOV_L	( CONST(0x80000000), EAX )
 	CPUID
 	TEST_L	( EAX, EAX )
@@ -137,6 +152,10 @@ LLBL( cpuid_amd ):
 	MOV_L	( CONST(0x80000001), EAX )
 	CPUID
 	MOV_L	( EDX, EAX )
+	
+	AND_L	( CONST(0x02000000), ESI )	/* OR in the SSE bit */
+	OR_L	( ESI, EAX )
+	
 	JMP	( LLBL ( cpuid_done ) )
 
 LLBL( cpuid_other ):
@@ -154,6 +173,7 @@ LLBL( cpuid_failed ):
 
 LLBL ( cpuid_done ):
 
+	POP_L	( ESI )
 	POP_L	( EBX )
 	RET
 
diff -urNp Mesa-3.4.2/src/X86/x86.c Mesa-3.4.2x/src/X86/x86.c
--- Mesa-3.4.2/src/X86/x86.c	2000-10-23 02:10:51.000000000 +0300
+++ Mesa-3.4.2x/src/X86/x86.c	2016-03-03 22:10:00.000000000 +0200
@@ -116,7 +116,6 @@ void gl_init_x86_transform_asm( void )
    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 3, masked );
    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 4, masked );
 
-   /* XXX this function has been found to cause FP overflow exceptions */
    gl_clip_tab[4] = gl_x86_cliptest_points4;
 
 #ifdef DEBUG
diff -urNp Mesa-3.4.2/src/X86/x86_cliptest.S Mesa-3.4.2x/src/X86/x86_cliptest.S
--- Mesa-3.4.2/src/X86/x86_cliptest.S	2000-10-23 02:10:51.000000000 +0300
+++ Mesa-3.4.2x/src/X86/x86_cliptest.S	2016-03-03 22:10:00.000000000 +0200
@@ -27,9 +27,6 @@
 #include "assyntax.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,8 +146,8 @@ LLBL( ctp4_clip_table_ready ):
 ALIGNTEXT16
 LLBL( ctp4_top ):
 
-	FLD1			/* F3 */
-	FDIV_S( SRC(3) )
+	FLD1				/* F3 */
+	FDIV_S( SRC(3) )		/* GH: don't care about div-by-zero */
 
 	MOV_L( SRC(3), EBP )
 	MOV_L( SRC(2), EBX )
@@ -198,7 +195,15 @@ LLBL( ctp4_top ):
 
 	JZ( LLBL( ctp4_proj ) )
 
+LLBL( ctp4_noproj ):
+
 	FSTP( ST(0) )			/* */
+
+	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 ) )
 
 LLBL( ctp4_proj ):
