Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86: Add support of vpclmulqdq and avx512 flags #25

Closed
wants to merge 3 commits into from

Conversation

AngryLoki
Copy link
Contributor

This PR sorts existing flags alphabetically and adds support of AVX-512 flags (completing table https://en.wikichip.org/wiki/x86/avx512_vnni#Microarchitecture_support) and vpclmulqdq.

Names for flags are reused from /proc/cpuinfo.

Test results:

CPU /proc/cpuinfo flags cpuid2cpuflags
AMD Ryzen 9 7950X3D 16-Core Processor fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d CPU_FLAGS_X86: aes avx avx2 avx512bw avx512cd avx512dq avx512f avx512vbmi avx512vl f16c fma3 avx512_vbmi2 vpclmulqdq avx512_vnni avx512ifma avx512_bitalg avx512_vpopcntdq avx512_bf16 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3
Intel(R) Xeon(R) Platinum 8480+ fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 invpcid_single intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities CPU_FLAGS_X86: aes avx avx2 avx512bw avx512cd avx512dq avx512f avx512vbmi avx512vl f16c fma3 avx512_vbmi2 vpclmulqdq avx512_vnni avx512_fp16 avx512ifma avx512_bitalg avx512_vpopcntdq avx512_bf16 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3

Bug: https://bugs.gentoo.org/908556

@mgorny
Copy link
Member

mgorny commented Jan 18, 2024

To confirm: all these flag names correspond to /proc/cpuinfo, correct?

@AngryLoki
Copy link
Contributor Author

To confirm: all these flag names correspond to /proc/cpuinfo, correct?

Yes, all new flags are exact copies of /proc/cpuinfo. I noticed that some old flags are slightly different (sha-ni maps to sha, pni maps to sse3, etc.), but new flags are exactly the same as in cpuinfo.

src/x86.c Show resolved Hide resolved
Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you either copy signoff to the remaining commits, or ACK that it's fine for me to copy it?

@mgorny
Copy link
Member

mgorny commented Jan 21, 2024

Also, would you be interested in making a PR to https://github.com/gentoo/gentoo to add these to profiles/desc/cpu_flags_x86.desc? I suppose listing them all would be a good idea, to avoid people accidentally adding them using a different name later.

@AngryLoki
Copy link
Contributor Author

Could you either copy signoff to the remaining commits

Done!

add these to profiles/desc/cpu_flags_x86.desc

Please check: gentoo/gentoo#34943

@mgorny
Copy link
Member

mgorny commented Jan 22, 2024

Thanks. I've added some wrapping and updated docs for new constants.

@mgorny mgorny closed this in 11c37c2 Jan 22, 2024
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants