On Tue, Mar 24, 2026 at 2:16 PM Lukas Fittl <[email protected]> wrote:
>
> Hi John,
>
> On Mon, Mar 23, 2026 at 12:01 AM John Naylor <[email protected]> wrote:
> > It's not that bad that the hard-coded indexes are in two places, but
> > it's also not necessary. I think "#define EAX 0 ...etc" is a fine,
> > straightforward increase in readability compared to what we have now,
> > and I don't see any downside. I suppose one argument in favor of the
> > struct is that it avoids declaring variables of type
> > array-of-4-unsigned in multiple places, but I think the array is fine,
> > and adding a new typedef is additional cognitive friction.
>
> Sounds good, lets do it that way - adjusted to use macros instead of a struct.

Looks good. The only thing that I would change is the single-letter
parameter/variable name "r". We could call it "reg" and it'd still be
pretty short. If you agree or have another suggestion, I can change
locally before pushing 0001 -- no need for a new patch set yet.

> > Speaking of signedness, why is the array of ints sometimes signed and
> > sometimes unsigned?
>
> The signedness is a MSVC-ism - I think its reasonable for us to work
> with unsigned integers in our code, and pass them by casting to
> __cpuid/__cpuidex (the MSVC variants).

CI works with this, so fine by me.

--
John Naylor
Amazon Web Services


Reply via email to