We are currently in the process of converting the website to the new design. Some pages, like this one, are still broken. We appreciate your patience.
Handmade Network»Forums»Work-in-Progress
Jeroen van Rijn
248 posts
A big ball of Wibbly-Wobbly, Timey-Wimey _stuff_
[Poll] Announcing the CPU Info library, and a question.
Edited by Jeroen van Rijn on
Hi fellow community members,

I'm working on a single file stb-style library that makes available to the developer a great deal of information that can be gleaned from the cpuid instruction, to be released later this month. Like many of the programming problems we solve, there's a certain amount of tedium involved. That in a nutshell is the impetus for this work.

A description:
Originally written as a labour-saving library to save future-me the drudge work, I hope it may in some way be useful to you as well. No reading of the Intel® and AMD® manuals required to get the information you want out of the processor.

Find out hassle-free:

The vendor and model of the CPU
The human-readable name of the CPU, where available, like "AMD Athlon(tm) X4 860K Quad Core Processor"
ISA extensions supported by this processor, like SSE2, SSE3, AVX, FMA3, XOP and whether virtualisation is supported.
Find out cache level and cache line sizes, where available
(more, TBD)

To that end, I'd appreciate it if you could fill out this poll, so as to help me decide which way to order the vendor enum, or whether support for detecting/interrogating a certain vendor's CPU can be moved behind a #define so as to allow for a smaller footprint that covers the actual CPUs you'll likely encounter in practice.

Thanks in advance.
Jeremiah Goerdt
208 posts / 1 project
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
[Poll] Announcing the CPU Info library, and a question.
I endorse this product.

I'd use that