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

Added changes to cpuinfo.h, isa.c and isa-info.c #269

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rrwinterton
Copy link

detect AVX10.1 ISA

@facebook-github-bot
Copy link
Contributor

Hi @rrwinterton!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

src/x86/isa.c Outdated
/*
* AVX 10.1 instructions:
*/
isa.avx10_1 = (structured_feature_info1.edx & UINT32_C(1 << 19));
Copy link
Contributor

Choose a reason for hiding this comment

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

refer a UINT32_C constant like the others
Replace UINT32_C(1 << 19)
with UINT32_C(0x00080000)

To confirm the bits, I look at libyuv AVX10 support

It is in the same register as avxvnniint8
((cpu_einfo7[3] & 0x00000010) ? kCpuHasAVXVNNIINT8 : 0);
((cpu_einfo7[3] & 0x00080000) ? kCpuHasAVX10 : 0)

It looks right except in libyuv it checks for if ((GetXCR0() & 0xe0) == 0xe0) which says the OS supports saving ymm16 to ymm31.
So I think you should also check avx512_regs &&

Copy link
Author

Choose a reason for hiding this comment

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

The reason I didn't check for AVX512 is because in the future there may not be 512 on some systems that support AVX10.2 in 256 bit form but that is still TBD. I think it is a good idea for now since we can change this in the future if this is the case.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Copy link
Contributor

@fbarchard fbarchard left a comment

Choose a reason for hiding this comment

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

Comment about other avx10 is not needed and subject to change.
The 'avx512 registers' is a misnomer. The OSS indicates the OS supports saving 32 vector registers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants