Re: [AD] Two patches for test.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


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.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/