dd86k / ddcpuid

🔬 dd's x86 CPU Identification tool
MIT License
36 stars 1 forks source link

Consider using bitfields instead of single bytes #22

Closed dd86k closed 4 years ago

dd86k commented 4 years ago

Consider using bit fields in the CPUINFO structure instead of bytes for every feature. Possibly per sections (e.g. ACPI) and per extension group (e.g. SSE grouping SSE, SSE2, etc., and AVX512 and all its stuff).

This would benefit in a few areas:

We wouldn't really lose a whole lot in speed. At worse it's an inlined function/template that performs a single AND (&) operation.

This would be best implemented using uint (u32) fields. The VendorID could also be included in CPUINFO. The memset could be moved in the fetchInfo function. And CHECK could have an extra or two parameters.

TODO:

dd86k commented 4 years ago

done