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.

> 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).

> + * Returns false if the CPUID leaf/subleaf is not supported.
>
> Okay, thanks. I'd suggest using "true if X is supported" or "true if X
> is supported, false otherwise" phrasing.

Yup, agreed, that reads better, adjusted.

See attached v13 with your feedback addressed in 0001 and 0005,
otherwise the same as before.

Thanks,
Lukas

-- 
Lukas Fittl

Attachment: v13-0001-Refactor-handling-of-x86-CPUID-instructions.patch
Description: Binary data

Attachment: v13-0002-Check-for-HAVE__CPUIDEX-and-HAVE__GET_CPUID_COUN.patch
Description: Binary data

Attachment: v13-0003-pg_test_timing-Reduce-per-loop-overhead.patch
Description: Binary data

Attachment: v13-0004-instrumentation-Streamline-ticks-to-nanosecond-c.patch
Description: Binary data

Attachment: v13-0005-instrumentation-Use-Time-Stamp-Counter-TSC-on-x8.patch
Description: Binary data

Attachment: v13-0006-pg_test_timing-Also-test-RDTSC-RDTSCP-timing-and.patch
Description: Binary data

Attachment: v13-0007-instrumentation-ARM-support-for-fast-time-measur.patch
Description: Binary data

Reply via email to