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

  • From: Christian Packmann <Christian.Packmann@xxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 11 Aug 2004 09:01:01 +0200

On 2004-08-10 20:40:45 [+0200], Axel Dörfler wrote:

> What we could also do is to add another bitmap flag to force an ideal
> alignment for the current CPU.

This would be perfect. 

One other thing: will the kernel have some kind of CPU feature 
identification? A quick grep on the headers didn't turn up any relevant hit 
on MMX (only B_CPU_INTEL_PENTIUM_MMX*). A function returning the CPUs 
features would be very useful, to write code like this:

uint32 cpuFlags = get_cpu_capabilities();
if(cpuFlags & CPU_HAS_SSE) {
 ...
} else if(cpuFlags & CPU_HAS_MMX) {
 ...
} else { 
 ...
}

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...

Bye,
Chris

Other related posts: