[AD] CPU info changes

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



What do you guys think of trashing the current cpu_* variables and having instead the following:

const char *cpu_id - Contains the full CPU ID in a string (details follow)
int cpu_capabilities - Special instruction set the CPU cupports.

* cpu_id will be of the form:
"Intel Pentium III (686, model 5 stepping 6)", which should be read as:

sscanf("%s %s (%i, model %i stepping %i", cpu_vendor, cpu_class, cpu_name, &cpu_family, &cpu_model, &cpu_stepping);

cpu_id will be filled in by check_cpu().


* cpu_capabilities will be a bit flag containing cpu_fpu, cpu_mmx, cpu_sse and cpu_3dnow, which can be checked with simple defines. This makes it easier to test for multiple conditions, and also reduces the number of (useless?) variables that must be exported for the DLL. I can code this during the week if no one objects.


--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



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