CPUID Patch for IDT Winchip

Uros Bizjak ubizjak@gmail.com
Mon May 20 18:57:00 GMT 2019


On Mon, May 20, 2019 at 6:12 PM tedheadster <tedheadster@gmail.com> wrote:
>
> On Mon, May 20, 2019 at 11:52 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> > How about the attached patch that enables zeroing only for 32bit
> > processors, and only for cpuid leaf 1? Usually, __get_cpuid is used
> > with a constant leaf argument, so we benefit from constant propagation
> > into inline function. Also, according to the confusing documentation,
> > it looks to me that zeroing %ecx and %edx regs should be enough.
>
> Uros,
>   you said "zeroing %ecx and %edx regs should be enough". That confuses me. The older documentation says that for %eax = 1 it is guaranteed to return a value in %eax and %edx, with %ebx and %ecx  being 'Intel reserved. Do not use'.
>
> Did you instead mean "zeroing %EBX and %ECX regs should be enough"?

Ah, yes. This is what I meant to say. The patch clears %ebx and %ecx.

Uros.

> Otherwise I like your proposal, I just have to fully understand the changed inline assembly and test it on actual hardware.
>
> - Matthew
>



More information about the Gcc-patches mailing list