Skip to content

Commit

Permalink
correct SSSE3 detection; fixes #300
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sneves committed Apr 21, 2023
1 parent a9750c7 commit 9ac0a9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c/blake3_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static
if (*edx & (1UL << 26))
features |= SSE2;
#endif
if (*ecx & (1UL << 0))
if (*ecx & (1UL << 9))
features |= SSSE3;
if (*ecx & (1UL << 19))
features |= SSE41;
Expand Down

0 comments on commit 9ac0a9b

Please sign in to comment.