[openbeos] Re: app_server: MMX/SSE help wanted

On 2004-08-11 18:46:55 [+0200], François Revol wrote:

>> I already do it this way, using my own CPU ID routine; but this should 
>> really be a kernel function. Of course that routine should also 
>> identify all other relevant features, not only SIMD instruction sets.
>> I can write that routine if you want, I imagine the kernel team has 
>> other things to do...

> It's called CPUID, and even userland apps can use a syscall which returns 
> the value of that opcode.
> (note using the kernel's get_cpuid() instead of the opcode directly 
> ensures it is run on the CPU you want, not any, even thougth SMP systems 
> are supposed to have "ideally" equal CPUs.

Sorry, I didn't express myself clearly.

I already use get_cpuid(), but to get all relevant flags requires a pretty 
complicated process; my current CPU identification routine is 30 lines, and 
just queries for MMX/SSE/3DNow!. Checks for SSE2 and other advanced CPU 
features like CMOV instructions will make that yet bigger. This code would 
have to be duplicated in every program which wants to use advanced CPU 
capabilities, hence my interest in moving that functionality into the 
kernel.

Bye,
Chris

Other related posts: