public inbox for gentoo-project@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-project] Looking for someone with AVX-512 capable CPU
@ 2019-05-27 16:25 Michał Górny
  2019-05-27 17:05 ` Thomas Deutschmann
  0 siblings, 1 reply; 3+ messages in thread
From: Michał Górny @ 2019-05-27 16:25 UTC (permalink / raw
  To: gentoo-project

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

Hi,

I'm looking for someone having AVX-512 capable CPU, for the purpose of
XSAVE support development in LLDB.  If you have such a CPU, could you
compile and run the following program, and send me the output?  If you
could in the future provide me with a shell account (unprivileged user
is sufficient) to build and test LLDB, that'd be even better.

The program is meant to grab offsets and sizes of XSAVE components.  It
should run unprivileged.  However, it might require a new-ish kernel. 
TIA.

---

#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

#include <cpuid.h>

int main()
{
	int i;
	uint32_t eax, ebx, ecx, edx;
	uint64_t xcr0;

	asm volatile(
		"xorq %%rcx, %%rcx\n\t"
		"xgetbv\n\t"
		: "=a"(eax), "=d"(edx)
		:
		:
	);

	printf("XCR0: EAX = %08" PRIx32 "; EDX = %08" PRIx32 "\n", eax, edx);
	xcr0 = ((uint64_t)edx << 32) | eax;

	if (!__get_cpuid_count(0x0D, 0, &eax, &ebx, &ecx, &edx))
		return 0;

	printf("0Dh(0): EAX = %08" PRIx32 "; EDX = %08" PRIx32 "\n", eax, edx);
	printf("0Dh(0): ECX = %" PRId32 "; EBX = %" PRId32 "\n", ecx, ebx);

	for (i = 2; i < 64; ++i)
	{
		if (!(xcr0 & ((uint64_t)1 << i)))
			continue;

		__cpuid_count(0x0D, i, eax, ebx, ecx, edx);
		printf("0Dh(%d): EAX = %" PRId32 "; EBX = %" PRId32 "; ECX = %"
				PRIx32 "\n", i, eax, ebx, ecx);
	}
}



-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-27 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-27 16:25 [gentoo-project] Looking for someone with AVX-512 capable CPU Michał Górny
2019-05-27 17:05 ` Thomas Deutschmann
2019-05-27 20:21   ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox