Add 3DNow SIMD implementation of computationally intensive routines.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3649 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/jpeg/simd/jsimdcpu.asm b/common/jpeg/simd/jsimdcpu.asm
index 862de29..b65699e 100644
--- a/common/jpeg/simd/jsimdcpu.asm
+++ b/common/jpeg/simd/jsimdcpu.asm
@@ -67,6 +67,21 @@
 	or	edi, byte JSIMD_MMX
 .no_mmx:
 
+	; Check for 3DNow! instruction support
+	mov	eax, 0x80000000
+	cpuid
+	cmp	eax, 0x80000000
+	jbe	short .return
+
+	mov	eax, 0x80000001
+	cpuid
+	mov	eax,edx			; eax = Extended feature flags
+
+	test	eax, 1<<31		; bit31:3DNow!(vendor independent)
+	jz	short .no_3dnow
+	or	edi, byte JSIMD_3DNOW
+.no_3dnow:
+
 .return:
 	mov	eax,edi