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

C-cpuid (very small) bug? #300

Closed
fcorbelli opened this issue Apr 20, 2023 · 1 comment
Closed

C-cpuid (very small) bug? #300

fcorbelli opened this issue Apr 20, 2023 · 1 comment

Comments

@fcorbelli
Copy link

Hello, here

https://github.com/BLAKE3-team/BLAKE3/blob/master/c/blake3_dispatch.c

@lines 104-105

    if (*ecx & (1UL << 0))
      features |= SSSE3;

But the SSSE3 should be bit 9
https://www.felixcloutier.com/x86/cpuid

SSE3 is bit 0, just like in your code
(Intel, I really love you!)

@sneves
Copy link
Collaborator

sneves commented Apr 21, 2023

You're right; I can't tell whether this was a typo or a SSE3/SSSE3 mixup.

@sneves sneves closed this as completed in 9ac0a9b Apr 21, 2023
oconnor663 added a commit to oconnor663/K12 that referenced this issue Apr 21, 2023
kevingoh pushed a commit to ITS-AT-dev/BLAKE3 that referenced this issue Oct 23, 2023
SSSE3 is indicated by bit 9 of ECX, not bit 0, which indicates the
presence of SSE3.

There are very few CPUs in use affected by this bug; SSE3 was part of
the Prescott new instructions, introduced in the later Pentium 4 chips,
whereas SSSE3 was introduced in Intel's Core 2 and AMD's Bulldozer. This
leaves a few Pentium 4 and Athlon 64 models that will potentially run an
illegal pshufb or pblendw.
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

No branches or pull requests

2 participants