Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th June 2002, 01:38   #1  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
CPU (AMD, Intel) detection

Hi,

i try to know how to find if a processor it an AMD or Intel.
i think the best way is to try to detect if the CPU support SSE or 3D Now feature.

does somethink like this is correct ?

detect SSE => Pentium III
detect SSE2 => Pentium IV
detect 3D Now! => AMD (perhaps K7)
detect 3D Now! Extensions => AMD (perhaps AMD XP)

is it the best way ? or perhaps a detection of the ID (GenuieIntel...) or perhaps by the family, model and stepping.

thank u

bye.
Dark-Cracker is offline   Reply With Quote
Old 14th June 2002, 06:24   #2  |  Link
DaveEL
Moderator
 
Join Date: Nov 2001
Posts: 581
Re: CPU (AMD, Intel) detection

detect SSE => Pentium III
detect SSE2 => Pentium IV
detect 3D Now! => AMD K6-2/K6-3
detect 3D Now! Extensions => AMD Athlon
detect 3d Now! pro => Athlon Xp/MP


DaveEL
DaveEL is offline   Reply With Quote
Old 14th June 2002, 06:44   #3  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
thank i don't have the ams fonction for the 3D now pro but your answer will help me much, thank u ver very much.
Dark-Cracker is offline   Reply With Quote
Old 19th June 2002, 05:48   #4  |  Link
Richard Berg
developer wannabe
 
Richard Berg's Avatar
 
Join Date: Nov 2001
Location: Brooklyn, NY
Posts: 1,212
Athlon XP has SSE, and Hammer will have SSE2, so this probably isn't a good way to go about things.
Richard Berg is offline   Reply With Quote
Old 19th June 2002, 05:59   #5  |  Link
DaveEL
Moderator
 
Join Date: Nov 2001
Posts: 581
If the tests are done in the order given xp will be detected as such and hammers will also be detected as xps which means the tests will answer the initial question of who made the processor.


Then again if your just trying to work out amd or intel then

Type = intel
If (Processor does 3dnow) type = amd

that will work assuming not run on anything but amd or intel and no amd before k6-2 if you want to be sure the checking the id of GenuineIntel or AuthenticAmd would be best.

Of course im not sure why you would want that information?

DaveEL

Last edited by DaveEL; 19th June 2002 at 06:16.
DaveEL is offline   Reply With Quote
Old 24th June 2002, 15:38   #6  |  Link
drstock
Registered User
 
Join Date: Mar 2002
Posts: 5
From the top of my head:

Code:
void main() {
  char vendor[13];
  _asm {
    xor eax,eax
    db 0fh,0a2h // CPUID
    mov vendor,ebx
    mov [vendor+4],edx
    mov [vendor+8],ecx
  }
  vendor[12] = '\0';
  printf("%s\n",vendor);
}
This is far from the best way to do it but you can do a lot more magic with the CPUID instruction.

Btw, it's been a while since i coded assembler, but you should get the picture. =)
drstock is offline   Reply With Quote
Old 24th June 2002, 23:43   #7  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
I don't have a link but AMD offers sample code on their site that determines what features are supported.

There is also a function for this in DVD2AVI, including SSE2 support. A save-oe assembler version source of this can be found in www.trbarry.com/DVD2AVIT3.zip .

- Tom
trbarry is offline   Reply With Quote
Old 26th June 2002, 23:46   #8  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
thank u all for your answer and thank u very , i think i will use the vendor id. Bye.
Dark-Cracker is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.