Patrick Georgi wrote:
Am Freitag 13 Februar 2009 14:44:20 schrieb Carl-Daniel Hailfinger:
I created a patch against a tree with your original patch applied. It should be able to handle all generations since the invention of CPUID just fine. Fam11h and later are handled as well.
Looks nice, and I tested it in SimNow after some trivial changes to make it build. I think it's ready for integration now.
Regards, Patrick
What this patch does:
- Enable SSE (to get some more registers to play with)
- Determine CPUID, and stash it in an XMM register, and reference value for comparison in another XMM register (mangled somewhat to simplify inequality comparisons)
- Add a macro jmp_if_k8, which jumps if the CPU is K8 (using an SSE compare)
- Replace #if CAR_FAM10 sections with runtime checks using jmp_if_k8. This is pretty mechanical work. The macro uses local labels (1: and 2:) to prevent namespace issues
- At one time, CPU_ADDR_BITS is used to fill a register. This is replaced with hardcoded values for both cases, and switched appropriately.
- Disable SSE
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Stefan Reinauer stepan@coresystems.de