Re: [AD] Two patches for test.c |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] Two patches for test.c
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Sun, 06 Mar 2005 12:10:02 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=T5mqV19NUNS4g2uE4TmfOzvjugFSBSJ/Br8vzt3dOPTBZQVVjP94Ed9APzQVsTLwWLnymVzUmBg3Un6Xnzuf8FhGnIIKGL31VYwEwBJETRHJ0aCGHh89d2f2kvANLyLnSz0wkOEUjrOOXyj2OR4N+DDEQn+2C5+qlhua/Pg2eQw=
Evert Glebbeek wrote:
There's a problem with the CPU capabilities though. The detection for AMD64
and IA64 depends on the CPUID instruction. However, on AMD64 Allegro is
compiled without inline assembler code (at least in Linux), so the CPUID
instruction is never used and the processor type is in fact unknown. I
don't see an easy way around this at the moment. Any suggestions?
Under Linux/Unix at least, you could attempt to parse /proc/cpuinfo if
assembly is unavailable.
With hindsight, I also think the cpu_capabilities flag is probably
inappropriate for this task and it would have been better to somehow use
the cpu_family and cpu_model variables. Thoughts?
cpu_family and cpu_model are directly mapped from CPUID, I believe. At
least /proc/cpuinfo has these two for my athlon-tbird:
cpu family : 6
model : 4
If they're different from their predecessors, it's be enough for me.