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

Do not use AVX2 instructions if the CPU doesn't support it #67

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

Commits on Oct 16, 2019

  1. First check CPUID, and then use xgetbv

    Otherwise we crash with SIGILL on a CPU without AVX (e.g. AMD Opteron 6172).
    
    Signed-off-by: Edwin Török <[email protected]>
    edwintorok committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    eb2f70b View commit details
    Browse the repository at this point in the history
  2. Use non-AVX2 codepaths on non-AVX2 CPUs

    To avoid a SIGILL on non-AVX2 CPU use the correct codepath.
    `ASM_TYPES & PREAVX2_MASK` is always `1`, which chooses the avx2 path
    and crashes.
    Use `ASM_TYPES & AVX2_MASK` which should be `0` if the CPU doesn't
    support AVX2, choosing the non-AVX2 path and avoiding a SIGILL.
    
    Signed-off-by: Edwin Török <[email protected]>
    edwintorok committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    0dc9806 View commit details
    Browse the repository at this point in the history