[haiku-development] Re: Fixing get_cpu_model_string(), Ticket 3541

  • From: Urias McCullough <umccullough@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 20 Jun 2009 07:27:57 -0700

On Sat, Jun 20, 2009 at 7:20 AM, Christian
Packmann<Christian.Packmann@xxxxxx> wrote:
>> BOINC servers use all this info to determine what optimized client
>> could/should sent to the individual machine requesting the work.
>
> Hm. I'm currently working on a CPU feature detection system as part of my
> benchmarking code, and I'd like to know what format you need that
> information in.

I basically need a space-delimited string like what you find in Linux
/proc/cpuinfo features.

Upper or lowercase works (I ended up re-creating what's in sysinfo,
but using lowercase, in retrospect, I should have just kept it all
uppercase)

Most BOINC projects only care about the various SSE version support -
but the client passes all features it can detect just in case.

> I'm currently breaking down the information in a "logical" format, i.e. I
> group all flags for MMX/SSE/3DNow! in one uint32 or string. This makes it
> easier for the programmer when needing specific info, as all needed
> information is stored in one place. For a K10, the generated string looks
> like this:
> "MMX 3DNow! 3DNow!+ SSE SSE-Integer SSE2 SSE3 SSE4a SSE128 MOVU
> 3DNow!Prefetch"
>
> But I don't know how the BOINC protocol handles this, do they use any
> self-defined standards, or do they follow the "physical" way of using the
> flags in the order they appear in the registers? I could adapt/extend my
> code appropriately if there's a need for a specific format. As I will
> release the code anyway, this could save other people some hassle...
> And offering special calls like GetBOINCFeatureString() can't hurt. :-)
>
>
> And before someone else starts writing new CPUID code, please mail me, maybe
> we can pool resources. :)

Here's where I got my code:

http://dev.haiku-os.org/browser/haiku/trunk/src/bin/sysinfo.c#L510

Note that the list of features is incomplete when compared to the
Intel/AMD specs:

http://www.intel.com/assets/pdf/appnote/241618.pdf
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25481.pdf

When I reused bits of the code, I updated the arrays with a few
missing features and also renamed a few things that didn't seem to
have "standard" feature names :P It was my intention to provide a
sysinfo patch with my changes, but I forgot.

- Urias

Other related posts: