Commit 3ea2a3dd authored by Sam Lantinga's avatar Sam Lantinga

Date: Sat, 24 Jan 2004 14:49:58 +0100

From: Stephane Marchesin
Subject: Re: [SDL] 3DNow! detection on a P4 system

Well... I found another bug : 3dnow was detected on P2/P3 cpus. So I
took one more look at the code and found a mistake in
CPU_getCPUIDFeaturesExt :
The condition for having extended cpuinfo is that when we query extended
cpuinfo we get a result >=  0x80000001. So we must exit if eax < 0x80000001.
The attached patch does that.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40788
parent f423ef91
...@@ -128,7 +128,7 @@ static __inline__ int CPU_getCPUIDFeaturesExt() ...@@ -128,7 +128,7 @@ static __inline__ int CPU_getCPUIDFeaturesExt()
" movl $0x80000000,%%eax # Query for extended functions \n" " movl $0x80000000,%%eax # Query for extended functions \n"
" cpuid # Get extended function limit \n" " cpuid # Get extended function limit \n"
" cmpl $0x80000001,%%eax \n" " cmpl $0x80000001,%%eax \n"
" jbe 1f # Nope, we dont have function 800000001h\n" " jl 1f # Nope, we dont have function 800000001h\n"
" movl $0x80000001,%%eax # Setup extended function 800000001h\n" " movl $0x80000001,%%eax # Setup extended function 800000001h\n"
" cpuid # and get the information \n" " cpuid # and get the information \n"
" movl %%edx,%0 \n" " movl %%edx,%0 \n"
...@@ -143,7 +143,7 @@ static __inline__ int CPU_getCPUIDFeaturesExt() ...@@ -143,7 +143,7 @@ static __inline__ int CPU_getCPUIDFeaturesExt()
mov eax,80000000h ; Query for extended functions mov eax,80000000h ; Query for extended functions
cpuid ; Get extended function limit cpuid ; Get extended function limit
cmp eax,80000001h cmp eax,80000001h
jbe done ; Nope, we dont have function 800000001h jl done ; Nope, we dont have function 800000001h
mov eax,80000001h ; Setup extended function 800000001h mov eax,80000001h ; Setup extended function 800000001h
cpuid ; and get the information cpuid ; and get the information
mov features,edx mov features,edx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment